工地接口优化
This commit is contained in:
parent
a5ab06eee5
commit
9f95d18be1
|
@ -83,7 +83,7 @@ public class BuildingController {
|
|||
public Result selectAllBuilding(){
|
||||
List<BuildingRecordsDto> 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<BuildingRecordsDto> c = buildingRecordsMapper.selectByJdWd(around[0], around[2], around[1], around[3]);
|
||||
Result success = Result.success(c);
|
||||
List<BuildingRecordsDto> 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;
|
||||
}
|
||||
|
||||
|
|
|
@ -10,6 +10,8 @@ public class BuildingRecordsDto {
|
|||
@ExcelProperty(value = {"工地名称"},index = 0)
|
||||
private String projectName;//工地名称
|
||||
|
||||
private String gdmc;//工地名称
|
||||
|
||||
@ExcelProperty(value = {"建筑编号"},index = 1)
|
||||
private String buildLicense;//建筑编号
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ public interface BuildingRecordsMapper extends BaseMapper<BuildingRecords> {
|
|||
|
||||
void batchUpdate(@Param("list") List<Map> 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<BuildingRecordsDto> selectAllBuilding();
|
||||
|
||||
List<BuildingRecordsDtos> selectWeekPmAndNoice(@Param("buildLicense") String buildLicense);
|
||||
|
@ -55,7 +55,7 @@ public interface BuildingRecordsMapper extends BaseMapper<BuildingRecords> {
|
|||
@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<BuildingRecordsDto> 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<BuildingRecordsDto> selectByJdWd(@Param("jd") Double jd,
|
||||
@Param("jd1") Double jd1,
|
||||
@Param("wd") Double wd,
|
||||
|
|
Loading…
Reference in New Issue