From ed468c85c0d3d3faf089d031d6f7133cf30e2606 Mon Sep 17 00:00:00 2001 From: wuweida <2918581207@qq.com> Date: Tue, 5 Jul 2022 14:47:37 +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=E4=BA=8B=E4=BB=B6=EF=BC=8C=E5=B7=A5=E5=9C=B0=E6=89=AC?= =?UTF-8?q?=E5=B0=98=EF=BC=8C=E5=B7=A5=E5=9C=B0=E5=99=AA=E5=A3=B0=E4=BA=8B?= =?UTF-8?q?=E4=BB=B6=E6=80=BB=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/BuildingController.java | 13 +++++++++++-- .../monitormanage/controller/QidiController.java | 3 +-- .../monitormanage/mapper/BuildingRecordsMapper.java | 7 +++++++ 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/hisense/monitormanage/controller/BuildingController.java b/src/main/java/com/hisense/monitormanage/controller/BuildingController.java index e146290..96e7347 100644 --- a/src/main/java/com/hisense/monitormanage/controller/BuildingController.java +++ b/src/main/java/com/hisense/monitormanage/controller/BuildingController.java @@ -18,6 +18,7 @@ import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; import java.util.Map; @@ -109,7 +110,11 @@ public class BuildingController { @ApiOperation("查询工地扬尘事件") public Result selectRaise(Integer page,Integer pageSize){ List recordsDtos = buildingRecordsMapper.selectRaise(page,pageSize); - Result success = Result.success(recordsDtos); + Integer integer = buildingRecordsMapper.selectCountRaise(); + Map map = new HashMap<>(); + map.put("sum",integer); + map.put("data",recordsDtos); + Result success = Result.success(map); return success; } @@ -121,7 +126,11 @@ public class BuildingController { @ApiOperation("查询工地噪声事件") public Result selectNoiceEvent(Integer page,Integer pageSize){ List recordsDtos = buildingRecordsMapper.selectNoiceEvent(page,pageSize); - Result success = Result.success(recordsDtos); + Integer integer = buildingRecordsMapper.selectCountNoice(); + Map map = new HashMap<>(); + map.put("sum",integer); + map.put("data",recordsDtos); + Result success = Result.success(map); return success; } diff --git a/src/main/java/com/hisense/monitormanage/controller/QidiController.java b/src/main/java/com/hisense/monitormanage/controller/QidiController.java index 64d080c..00c2b28 100644 --- a/src/main/java/com/hisense/monitormanage/controller/QidiController.java +++ b/src/main/java/com/hisense/monitormanage/controller/QidiController.java @@ -300,9 +300,8 @@ public class QidiController { public Result selectRoadData(Integer page,Integer pageSize){ List roadData = roadDataMapper.selectRoadData(page,pageSize); Integer integer = roadDataMapper.selectCountRoadData(); - page = integer/pageSize + 1; Map map = new HashMap<>(); - map.put("page",page); + map.put("sum",integer); map.put("roadData",roadData); Result success = Result.success(map); return success; diff --git a/src/main/java/com/hisense/monitormanage/mapper/BuildingRecordsMapper.java b/src/main/java/com/hisense/monitormanage/mapper/BuildingRecordsMapper.java index dda16e7..fa1e86b 100644 --- a/src/main/java/com/hisense/monitormanage/mapper/BuildingRecordsMapper.java +++ b/src/main/java/com/hisense/monitormanage/mapper/BuildingRecordsMapper.java @@ -38,6 +38,13 @@ public interface BuildingRecordsMapper extends BaseMapper { List selectNoiceEvent(@Param("page") Integer page,@Param("pageSize") Integer pageSize); + @Select("select COUNT(*) from (select br.pm10 from t_building_records br JOIN t_building_new_site bs ON br.project_name = bs.gdmc where br.pm10 > 80) a ") + Integer selectCountRaise(); + + @Select("SELECT COUNT(*) FROM (SELECT br.noice,br.push_time FROM t_building_records br JOIN t_building_new_site bs ON br.project_name = bs.gdmc WHERE (hour(br.push_time)>=22 or 6 > hour(br.push_time)) AND br.noice > 55 " + + "UNION SELECT br.noice,br.push_time FROM t_building_records br JOIN t_building_new_site bs ON br.project_name = bs.gdmc WHERE DATE_FORMAT(br.push_time,'%H')>=6 AND DATE_FORMAT(br.push_time,'%H')<=22 AND br.noice > 70) a") + Integer selectCountNoice(); + @Select("select br.*,bs.sgwz,bs.jd,bs.wd,bs.ssdq,bs.yjsg from t_building_records br JOIN t_building_new_site bs on br.project_name = bs.gdmc" + " where br.project_name like concat('%',#{projectName},'%')") List selectByProjectName(String projectName);