From c8575c1dab81903890168cdddaf00c685790f5c3 Mon Sep 17 00:00:00 2001 From: wuweida <2918581207@qq.com> Date: Mon, 13 Jun 2022 17:53:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=81=93=E8=B7=AF=E6=B1=A1?= =?UTF-8?q?=E6=9F=93=E7=B4=AF=E8=AE=A1=E4=BA=8B=E4=BB=B6=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../monitormanage/controller/Controller.java | 14 +++------ .../monitormanage/mapper/RoadDataMapper.java | 2 +- .../monitormanage/service/MonitorService.java | 30 ++++++++++++------- .../service/RoadDataService.java | 7 +++++ src/main/resources/mapper/RoadDataMapper.xml | 4 +-- 5 files changed, 34 insertions(+), 23 deletions(-) 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 @@ -