diff --git a/src/main/java/com/hisense/monitormanage/controller/BuildingController.java b/src/main/java/com/hisense/monitormanage/controller/BuildingController.java index f861862..9a9eedb 100644 --- a/src/main/java/com/hisense/monitormanage/controller/BuildingController.java +++ b/src/main/java/com/hisense/monitormanage/controller/BuildingController.java @@ -148,37 +148,37 @@ public class BuildingController { } /** - * 查询近一天工地噪声和扬尘的信息 + * 根据工地名称查询近一天工地噪声和扬尘的信息 * @return */ @GetMapping("selectDayAll") - @ApiOperation("查询近一天工地噪声和扬尘的信息") - public Result selectDayAll(){ - List recordsDtos = buildingRecordsMapper.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(){ - List recordsDtos = buildingRecordsMapper.selectWeekAll(); + @ApiOperation("根据工地名称查询近一周工地噪声和扬尘的信息") + public Result selectWeekAll(String projectName){ + List recordsDtos = buildingRecordsMapper.selectWeekAll(projectName); Result success = Result.success(recordsDtos); return success; } /** - * 查询近一月工地噪声和扬尘的信息 + * 根据工地名称查询近一月工地噪声和扬尘的信息 * @return */ @GetMapping("selectMonthAll") - @ApiOperation("查询近一月工地噪声和扬尘的信息") - public Result selectMonthAll(){ - List recordsDtos = buildingRecordsMapper.selectMonthAll(); + @ApiOperation("根据工地名称查询近一月工地噪声和扬尘的信息") + public Result selectMonthAll(String projectName){ + List recordsDtos = buildingRecordsMapper.selectMonthAll(projectName); Result success = Result.success(recordsDtos); 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 1b8e184..9ceb73c 100644 --- a/src/main/java/com/hisense/monitormanage/mapper/BuildingRecordsMapper.java +++ b/src/main/java/com/hisense/monitormanage/mapper/BuildingRecordsMapper.java @@ -51,16 +51,16 @@ public interface BuildingRecordsMapper extends BaseMapper { List selectMonthNoice(); @Select("select * from t_building_records br JOIN t_building_site bs on br.project_name = bs.gdmc " + - " where to_days(br.push_time) = to_days(now())") - List selectDayAll(); + " 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)") - List selectWeekAll(); + " 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)") - List selectMonthAll(); + " where DATE_SUB(CURDATE(), INTERVAL 30 DAY) <= date(br.push_time) and br.project_name like concat('%',#{projectName},'%')") + List selectMonthAll(String projectName); @Select("select br.*,bs.sgwz,bs.jd,bs.wd,bs.ssdq from t_building_records br JOIN t_building_new_site bs on br.project_name = bs.gdmc" + " where br.project_name like concat('%',#{projectName},'%')")