根据新图工地接口优化

This commit is contained in:
wuweida 2022-06-24 15:12:33 +08:00
parent 596b2b7f09
commit e3cea5eea5
3 changed files with 27 additions and 121 deletions

View File

@ -74,110 +74,39 @@ public class BuildingController {
Result success = Result.success(recordsDtos); Result success = Result.success(recordsDtos);
return success; return success;
} }
/** /**
* 查询当天工地扬尘并排序 * 查询近7天工地噪声和扬尘的信息
* @return * @return
*/ */
@GetMapping("selectDayPm10") @GetMapping("selectWeekPmAndNoice")
@ApiOperation("查询当天工地扬尘并排序") @ApiOperation("查询近7天工地噪声和扬尘的信息")
public Result selectDayPm10(){ public Result selectWeekPmAndNoice(){
List<BuildingRecordsDto> recordsDtos = buildingRecordsMapper.selectDayPm10(); List<BuildingRecordsDto> recordsDtos = buildingRecordsMapper.selectWeekPmAndNoice();
Result success = Result.success(recordsDtos); Result success = Result.success(recordsDtos);
return success; return success;
} }
/** /**
* 查询近一周工地扬尘并排序 * 查询工地扬尘事件
* @return * @return
*/ */
@GetMapping("selectWeekPm10") @GetMapping("selectRaise")
@ApiOperation("查询近一周工地扬尘并排序") @ApiOperation("查询工地扬尘事件")
public Result selectWeekPm10(){ public Result selectRaise(){
List<BuildingRecordsDto> recordsDtos = buildingRecordsMapper.selectWeekPm10(); List<BuildingRecordsDto> recordsDtos = buildingRecordsMapper.selectRaise();
Result success = Result.success(recordsDtos); Result success = Result.success(recordsDtos);
return success; return success;
} }
/** /**
* 查询近30天工地扬尘并排序 * 查询近30天工地噪声和扬尘的信息
* @return * @return
*/ */
@GetMapping("selectMonthPm10") @GetMapping("selectMonthPmAndNoice")
@ApiOperation("查询近30天工地扬尘并排序") @ApiOperation("查询近30天工地噪声和扬尘的信息")
public Result selectMonthPm10(){ public Result selectMonthPmAndNoice(){
List<BuildingRecordsDto> recordsDtos = buildingRecordsMapper.selectMonthPm10(); List<BuildingRecordsDto> recordsDtos = buildingRecordsMapper.selectMonthPmAndNoice();
Result success = Result.success(recordsDtos);
return success;
}
/**
* 查询当天工地噪声并排序
* @return
*/
@GetMapping("selectDayNoice")
@ApiOperation("查询当天工地噪声并排序")
public Result selectDayNoice(){
List<BuildingRecordsDto> recordsDtos = buildingRecordsMapper.selectDayNoice();
Result success = Result.success(recordsDtos);
return success;
}
/**
* 查询近一周工地噪声并排序
* @return
*/
@GetMapping("selectWeekNoice")
@ApiOperation("查询近一周工地噪声并排序")
public Result selectWeekNoice(){
List<BuildingRecordsDto> recordsDtos = buildingRecordsMapper.selectWeekNoice();
Result success = Result.success(recordsDtos);
return success;
}
/**
* 查询近30天工地噪声并排序
* @return
*/
@GetMapping("selectMonthNoice")
@ApiOperation("查询近30天工地噪声并排序")
public Result selectMonthNoice(){
List<BuildingRecordsDto> recordsDtos = buildingRecordsMapper.selectMonthNoice();
Result success = Result.success(recordsDtos);
return success;
}
/**
* 根据工地名称查询近一天工地噪声和扬尘的信息
* @return
*/
@GetMapping("selectDayAll")
@ApiOperation("根据工地名称查询近一天工地噪声和扬尘的信息")
public Result selectDayAll(String projectName){
List<BuildingRecordsDto> recordsDtos = buildingRecordsMapper.selectDayAll(projectName);
Result success = Result.success(recordsDtos);
return success;
}
/**
* 根据工地名称查询近一周工地噪声和扬尘的信息
* @return
*/
@GetMapping("selectWeekAll")
@ApiOperation("根据工地名称查询近一周工地噪声和扬尘的信息")
public Result selectWeekAll(String projectName){
List<BuildingRecordsDto> recordsDtos = buildingRecordsMapper.selectWeekAll(projectName);
Result success = Result.success(recordsDtos);
return success;
}
/**
* 根据工地名称查询近30天工地噪声和扬尘的信息
* @return
*/
@GetMapping("selectMonthAll")
@ApiOperation("根据工地名称查询近30天工地噪声和扬尘的信息")
public Result selectMonthAll(String projectName){
List<BuildingRecordsDto> recordsDtos = buildingRecordsMapper.selectMonthAll(projectName);
Result success = Result.success(recordsDtos); Result success = Result.success(recordsDtos);
return success; return success;
} }
@ -190,6 +119,7 @@ public class BuildingController {
*/ */
@GetMapping("selectByProjectName") @GetMapping("selectByProjectName")
@ApiOperation("根据工地名称搜索工地") @ApiOperation("根据工地名称搜索工地")
@ApiImplicitParam(name = "projectName", value = "工地名称",required = true,dataType ="String")
public Result selectByProjectName(String projectName){ public Result selectByProjectName(String projectName){
List<BuildingRecordsDto> recordsDtos = buildingRecordsMapper.selectByProjectName(projectName); List<BuildingRecordsDto> recordsDtos = buildingRecordsMapper.selectByProjectName(projectName);
Result success = Result.success(recordsDtos); Result success = Result.success(recordsDtos);

View File

@ -16,4 +16,6 @@ public class BuildingRecordsDto {
private double noice;//噪声 private double noice;//噪声
private String yjsg;//夜间施工 private String yjsg;//夜间施工
private String picUrl;//图片路径 private String picUrl;//图片路径
private String channelCode;//摄像头编号
private String channelName;//摄像头名称
} }

View File

@ -21,45 +21,19 @@ public interface BuildingRecordsMapper extends BaseMapper<BuildingRecords> {
void batchUpdate(@Param("list") List<Map> list); void batchUpdate(@Param("list") List<Map> list);
@Select("SELECT bns.*,br.project_name,br.push_time,br.pm10,br.noice FROM " + @Select("SELECT * FROM t_building_new_site bns JOIN t_building_records br ON bns.gdmc = br.project_name")
"t_building_new_site bns JOIN t_building_records br ON bns.gdmc = br.project_name")
List<BuildingRecordsDto> selectAllBuilding(); List<BuildingRecordsDto> selectAllBuilding();
@Select("select * from t_building_records br JOIN t_building_new_site bs on br.project_name = bs.gdmc" + @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") " where DATE_SUB(CURDATE(), INTERVAL 7 DAY) < date(br.push_time)")
List<BuildingRecordsDto> selectDayPm10(); List<BuildingRecordsDto> selectWeekPmAndNoice();
@Select("select * from t_building_records br JOIN t_building_new_site bs on br.project_name = bs.gdmc" + @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") " where DATE_SUB(CURDATE(), INTERVAL 30 DAY) < date(br.push_time)")
List<BuildingRecordsDto> selectWeekPm10(); List<BuildingRecordsDto> selectMonthPmAndNoice();
@Select("select * from t_building_records br JOIN t_building_new_site bs on br.project_name = bs.gdmc" + @Select("select * from t_building_records br JOIN t_building_new_site bs on br.project_name = bs.gdmc where br.pm10 > 200")
" where DATE_SUB(CURDATE(), INTERVAL 30 DAY) < date(br.push_time) order by br.pm10 desc") List<BuildingRecordsDto> selectRaise();
List<BuildingRecordsDto> 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<BuildingRecordsDto> 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<BuildingRecordsDto> 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<BuildingRecordsDto> 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<BuildingRecordsDto> 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<BuildingRecordsDto> 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<BuildingRecordsDto> selectMonthAll(String projectName);
@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" + @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},'%')") " where br.project_name like concat('%',#{projectName},'%')")