工地接口优化

This commit is contained in:
wuweida 2022-06-09 09:15:55 +08:00
parent 1fb6d19218
commit ce3f9b8350
2 changed files with 12 additions and 12 deletions

View File

@ -100,11 +100,11 @@ public class BuildingController {
} }
/** /**
* 查询近一月工地扬尘并排序 * 查询近30天工地扬尘并排序
* @return * @return
*/ */
@GetMapping("selectMonthPm10") @GetMapping("selectMonthPm10")
@ApiOperation("查询近一月工地扬尘并排序") @ApiOperation("查询近30天工地扬尘并排序")
public Result selectMonthPm10(){ public Result selectMonthPm10(){
List<BuildingRecordsDto> recordsDtos = buildingRecordsMapper.selectMonthPm10(); List<BuildingRecordsDto> recordsDtos = buildingRecordsMapper.selectMonthPm10();
Result success = Result.success(recordsDtos); Result success = Result.success(recordsDtos);
@ -136,11 +136,11 @@ public class BuildingController {
} }
/** /**
* 查询近一月工地噪声并排序 * 查询近30天工地噪声并排序
* @return * @return
*/ */
@GetMapping("selectMonthNoice") @GetMapping("selectMonthNoice")
@ApiOperation("查询近一月工地噪声并排序") @ApiOperation("查询近30天工地噪声并排序")
public Result selectMonthNoice(){ public Result selectMonthNoice(){
List<BuildingRecordsDto> recordsDtos = buildingRecordsMapper.selectMonthNoice(); List<BuildingRecordsDto> recordsDtos = buildingRecordsMapper.selectMonthNoice();
Result success = Result.success(recordsDtos); Result success = Result.success(recordsDtos);
@ -172,11 +172,11 @@ public class BuildingController {
} }
/** /**
* 根据工地名称查询近一月工地噪声和扬尘的信息 * 根据工地名称查询近30天工地噪声和扬尘的信息
* @return * @return
*/ */
@GetMapping("selectMonthAll") @GetMapping("selectMonthAll")
@ApiOperation("根据工地名称查询近一月工地噪声和扬尘的信息") @ApiOperation("根据工地名称查询近30天工地噪声和扬尘的信息")
public Result selectMonthAll(String projectName){ public Result selectMonthAll(String projectName){
List<BuildingRecordsDto> recordsDtos = buildingRecordsMapper.selectMonthAll(projectName); List<BuildingRecordsDto> recordsDtos = buildingRecordsMapper.selectMonthAll(projectName);
Result success = Result.success(recordsDtos); Result success = Result.success(recordsDtos);

View File

@ -31,11 +31,11 @@ public interface BuildingRecordsMapper extends BaseMapper<BuildingRecords> {
List<BuildingRecordsDto> selectDayPm10(); List<BuildingRecordsDto> selectDayPm10();
@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 7 DAY) < date(br.push_time) order by br.pm10 desc")
List<BuildingRecordsDto> selectWeekPm10(); List<BuildingRecordsDto> selectWeekPm10();
@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 30 DAY) <= date(br.push_time) order by br.pm10 desc") " where DATE_SUB(CURDATE(), INTERVAL 30 DAY) < date(br.push_time) order by br.pm10 desc")
List<BuildingRecordsDto> selectMonthPm10(); List<BuildingRecordsDto> selectMonthPm10();
@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 " +
@ -43,11 +43,11 @@ public interface BuildingRecordsMapper extends BaseMapper<BuildingRecords> {
List<BuildingRecordsDto> selectDayNoice(); List<BuildingRecordsDto> selectDayNoice();
@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.noice desc") " where DATE_SUB(CURDATE(), INTERVAL 7 DAY) < date(br.push_time) order by br.noice desc")
List<BuildingRecordsDto> selectWeekNoice(); List<BuildingRecordsDto> selectWeekNoice();
@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 30 DAY) <= date(br.push_time) order by br.noice desc") " where DATE_SUB(CURDATE(), INTERVAL 30 DAY) < date(br.push_time) order by br.noice desc")
List<BuildingRecordsDto> selectMonthNoice(); List<BuildingRecordsDto> selectMonthNoice();
@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" +
@ -55,11 +55,11 @@ public interface BuildingRecordsMapper extends BaseMapper<BuildingRecords> {
List<BuildingRecordsDto> selectDayAll(String 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" + @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},'%')") " where DATE_SUB(CURDATE(), INTERVAL 7 DAY) < date(br.push_time) and br.project_name like concat('%',#{projectName},'%')")
List<BuildingRecordsDto> selectWeekAll(String 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" + @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},'%')") " where DATE_SUB(CURDATE(), INTERVAL 30 DAY) < date(br.push_time) and br.project_name like concat('%',#{projectName},'%')")
List<BuildingRecordsDto> selectMonthAll(String 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" +