添加道路污染事件,工地扬尘,工地噪声事件总数

This commit is contained in:
wuweida 2022-07-05 14:47:37 +08:00
parent 1ae322e435
commit ed468c85c0
3 changed files with 19 additions and 4 deletions

View File

@ -18,6 +18,7 @@ import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -109,7 +110,11 @@ public class BuildingController {
@ApiOperation("查询工地扬尘事件")
public Result selectRaise(Integer page,Integer pageSize){
List<BuildingRecordsDto> recordsDtos = buildingRecordsMapper.selectRaise(page,pageSize);
Result success = Result.success(recordsDtos);
Integer integer = buildingRecordsMapper.selectCountRaise();
Map<String,Object> map = new HashMap<>();
map.put("sum",integer);
map.put("data",recordsDtos);
Result success = Result.success(map);
return success;
}
@ -121,7 +126,11 @@ public class BuildingController {
@ApiOperation("查询工地噪声事件")
public Result selectNoiceEvent(Integer page,Integer pageSize){
List<BuildingRecordsDto> recordsDtos = buildingRecordsMapper.selectNoiceEvent(page,pageSize);
Result success = Result.success(recordsDtos);
Integer integer = buildingRecordsMapper.selectCountNoice();
Map<String,Object> map = new HashMap<>();
map.put("sum",integer);
map.put("data",recordsDtos);
Result success = Result.success(map);
return success;
}

View File

@ -300,9 +300,8 @@ public class QidiController {
public Result selectRoadData(Integer page,Integer pageSize){
List<RoadData> roadData = roadDataMapper.selectRoadData(page,pageSize);
Integer integer = roadDataMapper.selectCountRoadData();
page = integer/pageSize + 1;
Map<String,Object> map = new HashMap<>();
map.put("page",page);
map.put("sum",integer);
map.put("roadData",roadData);
Result success = Result.success(map);
return success;

View File

@ -38,6 +38,13 @@ public interface BuildingRecordsMapper extends BaseMapper<BuildingRecords> {
List<BuildingRecordsDto> selectNoiceEvent(@Param("page") Integer page,@Param("pageSize") Integer pageSize);
@Select("select COUNT(*) from (select br.pm10 from t_building_records br JOIN t_building_new_site bs ON br.project_name = bs.gdmc where br.pm10 > 80) a ")
Integer selectCountRaise();
@Select("SELECT COUNT(*) FROM (SELECT br.noice,br.push_time FROM t_building_records br JOIN t_building_new_site bs ON br.project_name = bs.gdmc WHERE (hour(br.push_time)>=22 or 6 > hour(br.push_time)) AND br.noice > 55 " +
"UNION SELECT br.noice,br.push_time FROM t_building_records br JOIN t_building_new_site bs ON br.project_name = bs.gdmc WHERE DATE_FORMAT(br.push_time,'%H')>=6 AND DATE_FORMAT(br.push_time,'%H')<=22 AND br.noice > 70) a")
Integer selectCountNoice();
@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},'%')")
List<BuildingRecordsDto> selectByProjectName(String projectName);