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);