diff --git a/src/main/java/com/hisense/monitormanage/controller/BuildingController.java b/src/main/java/com/hisense/monitormanage/controller/BuildingController.java index 3312842..156c378 100644 --- a/src/main/java/com/hisense/monitormanage/controller/BuildingController.java +++ b/src/main/java/com/hisense/monitormanage/controller/BuildingController.java @@ -74,110 +74,39 @@ public class BuildingController { Result success = Result.success(recordsDtos); return success; } + /** - * 查询当天工地扬尘并排序 + * 查询近7天工地噪声和扬尘的信息 * @return */ - @GetMapping("selectDayPm10") - @ApiOperation("查询当天工地扬尘并排序") - public Result selectDayPm10(){ - List recordsDtos = buildingRecordsMapper.selectDayPm10(); + @GetMapping("selectWeekPmAndNoice") + @ApiOperation("查询近7天工地噪声和扬尘的信息") + public Result selectWeekPmAndNoice(){ + List recordsDtos = buildingRecordsMapper.selectWeekPmAndNoice(); Result success = Result.success(recordsDtos); return success; } /** - * 查询近一周工地扬尘并排序 + * 查询工地扬尘事件 * @return */ - @GetMapping("selectWeekPm10") - @ApiOperation("查询近一周工地扬尘并排序") - public Result selectWeekPm10(){ - List recordsDtos = buildingRecordsMapper.selectWeekPm10(); + @GetMapping("selectRaise") + @ApiOperation("查询工地扬尘事件") + public Result selectRaise(){ + List recordsDtos = buildingRecordsMapper.selectRaise(); Result success = Result.success(recordsDtos); return success; } /** - * 查询近30天工地扬尘并排序 + * 查询近30天工地噪声和扬尘的信息 * @return */ - @GetMapping("selectMonthPm10") - @ApiOperation("查询近30天工地扬尘并排序") - public Result selectMonthPm10(){ - List recordsDtos = buildingRecordsMapper.selectMonthPm10(); - Result success = Result.success(recordsDtos); - return success; - } - - /** - * 查询当天工地噪声并排序 - * @return - */ - @GetMapping("selectDayNoice") - @ApiOperation("查询当天工地噪声并排序") - public Result selectDayNoice(){ - List recordsDtos = buildingRecordsMapper.selectDayNoice(); - Result success = Result.success(recordsDtos); - return success; - } - - /** - * 查询近一周工地噪声并排序 - * @return - */ - @GetMapping("selectWeekNoice") - @ApiOperation("查询近一周工地噪声并排序") - public Result selectWeekNoice(){ - List recordsDtos = buildingRecordsMapper.selectWeekNoice(); - Result success = Result.success(recordsDtos); - return success; - } - - /** - * 查询近30天工地噪声并排序 - * @return - */ - @GetMapping("selectMonthNoice") - @ApiOperation("查询近30天工地噪声并排序") - public Result selectMonthNoice(){ - List recordsDtos = buildingRecordsMapper.selectMonthNoice(); - Result success = Result.success(recordsDtos); - return success; - } - - /** - * 根据工地名称查询近一天工地噪声和扬尘的信息 - * @return - */ - @GetMapping("selectDayAll") - @ApiOperation("根据工地名称查询近一天工地噪声和扬尘的信息") - public Result selectDayAll(String projectName){ - List recordsDtos = buildingRecordsMapper.selectDayAll(projectName); - Result success = Result.success(recordsDtos); - return success; - } - - /** - * 根据工地名称查询近一周工地噪声和扬尘的信息 - * @return - */ - @GetMapping("selectWeekAll") - @ApiOperation("根据工地名称查询近一周工地噪声和扬尘的信息") - public Result selectWeekAll(String projectName){ - List recordsDtos = buildingRecordsMapper.selectWeekAll(projectName); - Result success = Result.success(recordsDtos); - return success; - } - - /** - * 根据工地名称查询近30天工地噪声和扬尘的信息 - * @return - */ - @GetMapping("selectMonthAll") - @ApiOperation("根据工地名称查询近30天工地噪声和扬尘的信息") - public Result selectMonthAll(String projectName){ - List recordsDtos = buildingRecordsMapper.selectMonthAll(projectName); + @GetMapping("selectMonthPmAndNoice") + @ApiOperation("查询近30天工地噪声和扬尘的信息") + public Result selectMonthPmAndNoice(){ + List recordsDtos = buildingRecordsMapper.selectMonthPmAndNoice(); Result success = Result.success(recordsDtos); return success; } @@ -190,6 +119,7 @@ public class BuildingController { */ @GetMapping("selectByProjectName") @ApiOperation("根据工地名称搜索工地") + @ApiImplicitParam(name = "projectName", value = "工地名称",required = true,dataType ="String") public Result selectByProjectName(String projectName){ List recordsDtos = buildingRecordsMapper.selectByProjectName(projectName); Result success = Result.success(recordsDtos); diff --git a/src/main/java/com/hisense/monitormanage/dto/BuildingRecordsDto.java b/src/main/java/com/hisense/monitormanage/dto/BuildingRecordsDto.java index eb5beaa..c83b63f 100644 --- a/src/main/java/com/hisense/monitormanage/dto/BuildingRecordsDto.java +++ b/src/main/java/com/hisense/monitormanage/dto/BuildingRecordsDto.java @@ -16,4 +16,6 @@ public class BuildingRecordsDto { private double noice;//噪声 private String yjsg;//夜间施工 private String picUrl;//图片路径 + private String channelCode;//摄像头编号 + private String channelName;//摄像头名称 } diff --git a/src/main/java/com/hisense/monitormanage/mapper/BuildingRecordsMapper.java b/src/main/java/com/hisense/monitormanage/mapper/BuildingRecordsMapper.java index d663928..51754a4 100644 --- a/src/main/java/com/hisense/monitormanage/mapper/BuildingRecordsMapper.java +++ b/src/main/java/com/hisense/monitormanage/mapper/BuildingRecordsMapper.java @@ -21,45 +21,19 @@ public interface BuildingRecordsMapper extends BaseMapper { void batchUpdate(@Param("list") List list); - @Select("SELECT bns.*,br.project_name,br.push_time,br.pm10,br.noice FROM " + - "t_building_new_site bns JOIN t_building_records br ON bns.gdmc = br.project_name") + @Select("SELECT * FROM t_building_new_site bns JOIN t_building_records br ON bns.gdmc = br.project_name") List selectAllBuilding(); - @Select("select * from t_building_records br JOIN t_building_new_site bs on br.project_name = bs.gdmc " + - " where to_days(br.push_time) = to_days(now()) order by br.pm10 desc") - List selectDayPm10(); + @Select("select * from t_building_records br JOIN t_building_new_site bs on br.project_name = bs.gdmc" + + " where DATE_SUB(CURDATE(), INTERVAL 7 DAY) < date(br.push_time)") + List selectWeekPmAndNoice(); @Select("select * from t_building_records br JOIN t_building_new_site bs on br.project_name = bs.gdmc" + - " where DATE_SUB(CURDATE(), INTERVAL 7 DAY) < date(br.push_time) order by br.pm10 desc") - List selectWeekPm10(); + " where DATE_SUB(CURDATE(), INTERVAL 30 DAY) < date(br.push_time)") + List selectMonthPmAndNoice(); - @Select("select * from t_building_records br JOIN t_building_new_site bs on br.project_name = bs.gdmc" + - " where DATE_SUB(CURDATE(), INTERVAL 30 DAY) < date(br.push_time) order by br.pm10 desc") - List selectMonthPm10(); - - @Select("select * from t_building_records br JOIN t_building_new_site bs on br.project_name = bs.gdmc " + - " where to_days(br.push_time) = to_days(now()) order by br.noice desc") - List selectDayNoice(); - - @Select("select * from t_building_records br JOIN t_building_new_site bs on br.project_name = bs.gdmc" + - " where DATE_SUB(CURDATE(), INTERVAL 7 DAY) < date(br.push_time) order by br.noice desc") - List selectWeekNoice(); - - @Select("select * from t_building_records br JOIN t_building_new_site bs on br.project_name = bs.gdmc" + - " where DATE_SUB(CURDATE(), INTERVAL 30 DAY) < date(br.push_time) order by br.noice desc") - List selectMonthNoice(); - - @Select("select * from t_building_records br JOIN t_building_new_site bs on br.project_name = bs.gdmc" + - " where to_days(br.push_time) = to_days(now()) and br.project_name like concat('%',#{projectName},'%')") - List selectDayAll(String projectName); - - @Select("select * from t_building_records br JOIN t_building_new_site bs on br.project_name = bs.gdmc" + - " where DATE_SUB(CURDATE(), INTERVAL 7 DAY) < date(br.push_time) and br.project_name like concat('%',#{projectName},'%')") - List selectWeekAll(String projectName); - - @Select("select * from t_building_records br JOIN t_building_new_site bs on br.project_name = bs.gdmc" + - " where DATE_SUB(CURDATE(), INTERVAL 30 DAY) < date(br.push_time) and br.project_name like concat('%',#{projectName},'%')") - List selectMonthAll(String projectName); + @Select("select * from t_building_records br JOIN t_building_new_site bs on br.project_name = bs.gdmc where br.pm10 > 200") + List selectRaise(); @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},'%')")