diff --git a/src/main/java/com/hisense/monitormanage/controller/Controller.java b/src/main/java/com/hisense/monitormanage/controller/Controller.java index ba0b5c0..a59fb1f 100644 --- a/src/main/java/com/hisense/monitormanage/controller/Controller.java +++ b/src/main/java/com/hisense/monitormanage/controller/Controller.java @@ -571,19 +571,13 @@ public class Controller { } /** - * 分页查询全部道路污染数据 - * @param page - * @param pageSize + * 查询全部道路污染累计事件数量 * @return */ @GetMapping("selectRoadData") - @ApiOperation("分页查询全部道路污染数据") - @ApiImplicitParams({ - @ApiImplicitParam(name = "page", value = "页码", paramType = "query", dataType = "Integer", required = true), - @ApiImplicitParam(name = "pageSize", value = "大小", paramType = "query", dataType = "Integer", required = true) - }) - public Result selectRoadData(Integer page,Integer pageSize){ - List roadData = roadDataMapper.selectRoadData(page,pageSize); + @ApiOperation("查询全部道路污染累计事件数量") + public Result selectRoadData(){ + List roadData = roadDataService.selectRoadData(); Result success = Result.success(roadData); return success; } diff --git a/src/main/java/com/hisense/monitormanage/mapper/RoadDataMapper.java b/src/main/java/com/hisense/monitormanage/mapper/RoadDataMapper.java index 6451cc2..cb1aade 100644 --- a/src/main/java/com/hisense/monitormanage/mapper/RoadDataMapper.java +++ b/src/main/java/com/hisense/monitormanage/mapper/RoadDataMapper.java @@ -17,5 +17,5 @@ import java.util.Map; public interface RoadDataMapper extends BaseMapper { public void batchSave(List list); - List selectRoadData(@Param("page") Integer page, @Param("pageSize") Integer pageSize); + /*List selectRoadData(@Param("page") Integer page, @Param("pageSize") Integer pageSize);*/ } diff --git a/src/main/java/com/hisense/monitormanage/service/MonitorService.java b/src/main/java/com/hisense/monitormanage/service/MonitorService.java index 28e3e6d..c5c1653 100644 --- a/src/main/java/com/hisense/monitormanage/service/MonitorService.java +++ b/src/main/java/com/hisense/monitormanage/service/MonitorService.java @@ -227,7 +227,8 @@ public class MonitorService { picture.setPicUrl(picUrl); /*picture.setInsertTime(new Date()); channelPictureMapper.insert(picture);*/ - if (channelCode == null){ + ChannelPicture id = channelPictureMapper.selectById(channelCode); + if (id == null){ channelPictureMapper.insert(picture); }else { QueryWrapper queryWrapper = new QueryWrapper<>(); @@ -269,7 +270,8 @@ public class MonitorService { picture.setPicUrl(picUrl); /*picture.setInsertTime(new Date()); channelPictureMapper.insert(picture);*/ - if (channelCode == null){ + ChannelPicture id = channelPictureMapper.selectById(channelCode); + if (id == null){ channelPictureMapper.insert(picture); }else { QueryWrapper queryWrapper = new QueryWrapper<>(); @@ -311,7 +313,8 @@ public class MonitorService { picture.setPicUrl(picUrl); /*picture.setInsertTime(new Date()); channelPictureMapper.insert(picture);*/ - if (channelCode == null){ + ChannelPicture id = channelPictureMapper.selectById(channelCode); + if (id == null){ channelPictureMapper.insert(picture); }else { QueryWrapper queryWrapper = new QueryWrapper<>(); @@ -353,7 +356,8 @@ public class MonitorService { picture.setPicUrl(picUrl); /*picture.setInsertTime(new Date()); channelPictureMapper.insert(picture);*/ - if (channelCode == null){ + ChannelPicture id = channelPictureMapper.selectById(channelCode); + if (id == null){ channelPictureMapper.insert(picture); }else { QueryWrapper queryWrapper = new QueryWrapper<>(); @@ -395,7 +399,8 @@ public class MonitorService { picture.setPicUrl(picUrl); /*picture.setInsertTime(new Date()); channelPictureMapper.insert(picture);*/ - if (channelCode == null){ + ChannelPicture id = channelPictureMapper.selectById(channelCode); + if (id == null){ channelPictureMapper.insert(picture); }else { QueryWrapper queryWrapper = new QueryWrapper<>(); @@ -437,7 +442,8 @@ public class MonitorService { picture.setPicUrl(picUrl); /*picture.setInsertTime(new Date()); channelPictureMapper.insert(picture);*/ - if (channelCode == null){ + ChannelPicture id = channelPictureMapper.selectById(channelCode); + if (id == null){ channelPictureMapper.insert(picture); }else { QueryWrapper queryWrapper = new QueryWrapper<>(); @@ -479,7 +485,8 @@ public class MonitorService { picture.setPicUrl(picUrl); /*picture.setInsertTime(new Date()); channelPictureMapper.insert(picture);*/ - if (channelCode == null){ + ChannelPicture id = channelPictureMapper.selectById(channelCode); + if (id == null){ channelPictureMapper.insert(picture); }else { QueryWrapper queryWrapper = new QueryWrapper<>(); @@ -521,7 +528,8 @@ public class MonitorService { picture.setPicUrl(picUrl); /*picture.setInsertTime(new Date()); channelPictureMapper.insert(picture);*/ - if (channelCode == null){ + ChannelPicture id = channelPictureMapper.selectById(channelCode); + if (id == null){ channelPictureMapper.insert(picture); }else { QueryWrapper queryWrapper = new QueryWrapper<>(); @@ -562,7 +570,8 @@ public class MonitorService { picture.setPicUrl(picUrl); /*picture.setInsertTime(new Date()); channelPictureMapper.insert(picture);*/ - if (channelCode == null){ + ChannelPicture id = channelPictureMapper.selectById(channelCode); + if (id == null){ channelPictureMapper.insert(picture); }else { QueryWrapper queryWrapper = new QueryWrapper<>(); @@ -604,7 +613,8 @@ public class MonitorService { picture.setPicUrl(picUrl); /*picture.setInsertTime(new Date()); channelPictureMapper.insert(picture);*/ - if (channelCode == null){ + ChannelPicture id = channelPictureMapper.selectById(channelCode); + if (id == null){ channelPictureMapper.insert(picture); }else { QueryWrapper queryWrapper = new QueryWrapper<>(); diff --git a/src/main/java/com/hisense/monitormanage/service/RoadDataService.java b/src/main/java/com/hisense/monitormanage/service/RoadDataService.java index 64bdb41..e94cffe 100644 --- a/src/main/java/com/hisense/monitormanage/service/RoadDataService.java +++ b/src/main/java/com/hisense/monitormanage/service/RoadDataService.java @@ -90,6 +90,13 @@ public class RoadDataService { return list; } + public List selectRoadData(){ + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.gt("pm10",200); + List list = roadDataMapper.selectList(queryWrapper); + return list; + } + //获取当前日期的时间串,2022-05-08 00:00:00 private String dateTimeStr(){ LocalDate localDate = LocalDate.now(); diff --git a/src/main/resources/mapper/RoadDataMapper.xml b/src/main/resources/mapper/RoadDataMapper.xml index 9f42eb6..843666b 100644 --- a/src/main/resources/mapper/RoadDataMapper.xml +++ b/src/main/resources/mapper/RoadDataMapper.xml @@ -16,10 +16,10 @@ -