diff --git a/src/main/java/com/hisense/monitormanage/controller/BuildingController.java b/src/main/java/com/hisense/monitormanage/controller/BuildingController.java index 1fcaa0e..95d9a19 100644 --- a/src/main/java/com/hisense/monitormanage/controller/BuildingController.java +++ b/src/main/java/com/hisense/monitormanage/controller/BuildingController.java @@ -83,7 +83,7 @@ public class BuildingController { public Result selectAllBuilding(){ List records = buildingRecordsMapper.selectAllBuilding(); records.forEach(record ->{ - + record.setProjectName(record.getGdmc()); }); Result success = Result.success(records); return success; @@ -222,8 +222,11 @@ public class BuildingController { ) public Result selectByJdWd(Double jd,Double wd,Integer radius){ double[] around = LongLatUtil.getAround(jd, wd, radius); - List c = buildingRecordsMapper.selectByJdWd(around[0], around[2], around[1], around[3]); - Result success = Result.success(c); + List buildingRecordsDtos = buildingRecordsMapper.selectByJdWd(around[0], around[2], around[1], around[3]); + buildingRecordsDtos.forEach(buildingRecordsDto->{ + buildingRecordsDto.setProjectName(buildingRecordsDto.getGdmc()); + }); + Result success = Result.success(buildingRecordsDtos); return success; } diff --git a/src/main/java/com/hisense/monitormanage/dto/BuildingRecordsDto.java b/src/main/java/com/hisense/monitormanage/dto/BuildingRecordsDto.java index b1d4191..381db52 100644 --- a/src/main/java/com/hisense/monitormanage/dto/BuildingRecordsDto.java +++ b/src/main/java/com/hisense/monitormanage/dto/BuildingRecordsDto.java @@ -10,6 +10,8 @@ public class BuildingRecordsDto { @ExcelProperty(value = {"工地名称"},index = 0) private String projectName;//工地名称 + private String gdmc;//工地名称 + @ExcelProperty(value = {"建筑编号"},index = 1) private String buildLicense;//建筑编号 diff --git a/src/main/java/com/hisense/monitormanage/mapper/BuildingRecordsMapper.java b/src/main/java/com/hisense/monitormanage/mapper/BuildingRecordsMapper.java index 5df5197..cbd8e69 100644 --- a/src/main/java/com/hisense/monitormanage/mapper/BuildingRecordsMapper.java +++ b/src/main/java/com/hisense/monitormanage/mapper/BuildingRecordsMapper.java @@ -29,7 +29,7 @@ public interface BuildingRecordsMapper extends BaseMapper { void batchUpdate(@Param("list") List list); - @Select("select * from (select bs.sgwz,bs.jd,bs.wd,bs.ssdq,bs.yjsg,bs.channel_code,bs.channel_name,b.* from t_building_site bs LEFT JOIN (select a.*,br.appid,br.noice,br.pm10,br.project_name FROM t_building_records br JOIN (select build_license,MAX(push_time) AS push_time from t_building_records GROUP BY build_license) a ON br.build_license = a.build_license AND br.push_time = a.push_time) b ON bs.gdmc = b.project_name ) c LEFT JOIN t_channel_picture cp ON c.channel_code = cp.channel_code") + @Select("select * from (select bs.gdmc,bs.sgwz,bs.jd,bs.wd,bs.ssdq,bs.yjsg,bs.channel_code,bs.channel_name,b.* from t_building_site bs LEFT JOIN (select a.*,br.appid,br.noice,br.pm10,br.project_name FROM t_building_records br JOIN (select build_license,MAX(push_time) AS push_time from t_building_records GROUP BY build_license) a ON br.build_license = a.build_license AND br.push_time = a.push_time) b ON bs.gdmc = b.project_name ) c LEFT JOIN t_channel_picture cp ON c.channel_code = cp.channel_code ORDER BY c.pm10 DESC") List selectAllBuilding(); List selectWeekPmAndNoice(@Param("buildLicense") String buildLicense); @@ -55,7 +55,7 @@ public interface BuildingRecordsMapper extends BaseMapper { @Select("select * from t_building_site bs JOIN (select a.*,br.appid,br.noice,br.pm10,br.project_name FROM t_building_records br JOIN (select build_license,MAX(push_time) AS push_time from t_building_records GROUP BY build_license) a ON br.build_license = a.build_license AND br.push_time = a.push_time) b on b.project_name = bs.gdmc where b.project_name like concat('%',#{projectName},'%') ORDER BY b.push_time DESC") List selectByProjectName(String projectName); - @Select("select * from t_building_site bs LEFT JOIN (select a.*,br.appid,br.noice,br.pm10,br.project_name FROM t_building_records br JOIN (select build_license,MAX(push_time) AS push_time from t_building_records GROUP BY build_license) a ON br.build_license = a.build_license AND br.push_time = a.push_time) b ON b.project_name = bs.gdmc WHERE (bs.jd between #{jd} and #{jd1}) and (bs.wd between #{wd} and #{wd1}") + @Select("select * from t_building_site bs LEFT JOIN (select a.*,br.appid,br.noice,br.pm10,br.project_name FROM t_building_records br JOIN (select build_license,MAX(push_time) AS push_time from t_building_records GROUP BY build_license) a ON br.build_license = a.build_license AND br.push_time = a.push_time) b ON b.project_name = bs.gdmc WHERE (bs.jd between #{jd} and #{jd1}) and (bs.wd between #{wd} and #{wd1})") List selectByJdWd(@Param("jd") Double jd, @Param("jd1") Double jd1, @Param("wd") Double wd,