工地接口优化

This commit is contained in:
wuweida 2022-06-06 17:38:22 +08:00
parent 62d1e930b3
commit da7839b9f6
2 changed files with 18 additions and 18 deletions

View File

@ -148,37 +148,37 @@ public class BuildingController {
} }
/** /**
* 查询近一天工地噪声和扬尘的信息 * 根据工地名称查询近一天工地噪声和扬尘的信息
* @return * @return
*/ */
@GetMapping("selectDayAll") @GetMapping("selectDayAll")
@ApiOperation("查询近一天工地噪声和扬尘的信息") @ApiOperation("根据工地名称查询近一天工地噪声和扬尘的信息")
public Result selectDayAll(){ public Result selectDayAll(String projectName){
List<BuildingRecordsDto> recordsDtos = buildingRecordsMapper.selectDayAll(); List<BuildingRecordsDto> recordsDtos = buildingRecordsMapper.selectDayAll(projectName);
Result success = Result.success(recordsDtos); Result success = Result.success(recordsDtos);
return success; return success;
} }
/** /**
* 查询近一周工地噪声和扬尘的信息 * 根据工地名称查询近一周工地噪声和扬尘的信息
* @return * @return
*/ */
@GetMapping("selectWeekAll") @GetMapping("selectWeekAll")
@ApiOperation("查询近一周工地噪声和扬尘的信息") @ApiOperation("根据工地名称查询近一周工地噪声和扬尘的信息")
public Result selectWeekAll(){ public Result selectWeekAll(String projectName){
List<BuildingRecordsDto> recordsDtos = buildingRecordsMapper.selectWeekAll(); List<BuildingRecordsDto> recordsDtos = buildingRecordsMapper.selectWeekAll(projectName);
Result success = Result.success(recordsDtos); Result success = Result.success(recordsDtos);
return success; return success;
} }
/** /**
* 查询近一月工地噪声和扬尘的信息 * 根据工地名称查询近一月工地噪声和扬尘的信息
* @return * @return
*/ */
@GetMapping("selectMonthAll") @GetMapping("selectMonthAll")
@ApiOperation("查询近一月工地噪声和扬尘的信息") @ApiOperation("根据工地名称查询近一月工地噪声和扬尘的信息")
public Result selectMonthAll(){ public Result selectMonthAll(String projectName){
List<BuildingRecordsDto> recordsDtos = buildingRecordsMapper.selectMonthAll(); List<BuildingRecordsDto> recordsDtos = buildingRecordsMapper.selectMonthAll(projectName);
Result success = Result.success(recordsDtos); Result success = Result.success(recordsDtos);
return success; return success;
} }

View File

@ -51,16 +51,16 @@ public interface BuildingRecordsMapper extends BaseMapper<BuildingRecords> {
List<BuildingRecordsDto> selectMonthNoice(); List<BuildingRecordsDto> selectMonthNoice();
@Select("select * from t_building_records br JOIN t_building_site bs on br.project_name = bs.gdmc " + @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())") " where to_days(br.push_time) = to_days(now()) and br.project_name like concat('%',#{projectName},'%')")
List<BuildingRecordsDto> selectDayAll(); 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)") " where DATE_SUB(CURDATE(), INTERVAL 7 DAY) <= date(br.push_time) and br.project_name like concat('%',#{projectName},'%')")
List<BuildingRecordsDto> selectWeekAll(); 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)") " where DATE_SUB(CURDATE(), INTERVAL 30 DAY) <= date(br.push_time) and br.project_name like concat('%',#{projectName},'%')")
List<BuildingRecordsDto> selectMonthAll(); List<BuildingRecordsDto> 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" + @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},'%')") " where br.project_name like concat('%',#{projectName},'%')")