From da7839b9f6b5124371fcf6fe087feeea34755c0b Mon Sep 17 00:00:00 2001 From: wuweida <2918581207@qq.com> Date: Mon, 6 Jun 2022 17:38:22 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=A5=E5=9C=B0=E6=8E=A5=E5=8F=A3=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/BuildingController.java | 24 +++++++++---------- .../mapper/BuildingRecordsMapper.java | 12 +++++----- 2 files changed, 18 insertions(+), 18 deletions(-) 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},'%')")