diff --git a/src/main/java/com/hisense/monitormanage/controller/BuildingController.java b/src/main/java/com/hisense/monitormanage/controller/BuildingController.java index aa4ffe8..faafb9b 100644 --- a/src/main/java/com/hisense/monitormanage/controller/BuildingController.java +++ b/src/main/java/com/hisense/monitormanage/controller/BuildingController.java @@ -2,7 +2,9 @@ package com.hisense.monitormanage.controller; import com.hisense.monitormanage.dto.BuildingRecordsDto; import com.hisense.monitormanage.dto.BuildingRecordsDtos; +import com.hisense.monitormanage.dto.EventDto; import com.hisense.monitormanage.entity.BuildingRecords; +import com.hisense.monitormanage.entity.Event; import com.hisense.monitormanage.entity.Result; import com.hisense.monitormanage.entity.RoadData; import com.hisense.monitormanage.mapper.BuildingRecordsMapper; @@ -161,6 +163,29 @@ public class BuildingController { return success; } + /** + * 查询工地视频感知事件 + * @return + */ + @GetMapping("selectByAllEvent") + @ApiOperation("查询工地视频感知事件") + @ApiImplicitParams({ + @ApiImplicitParam(name = "page", value = "页码", required = true, dataType = "Integer"), + @ApiImplicitParam(name = "pageSize", value = "页码大小", required = true, dataType = "Integer") + }) + public Result selectByAllEvent(Integer page,Integer pageSize){ + List eventDtos = buildingRecordsMapper.selectByAllEvent(page, pageSize); + eventDtos.forEach(eventDto -> { + eventDto.setEventNewName(eventDto.getEventCnName()); + }); + Integer integer = buildingRecordsMapper.selectCountEvent(); + Map map = new HashMap<>(); + map.put("sum",integer); + map.put("data",eventDtos); + Result success = Result.success(map); + return success; + } + /** * 根据工地名称搜索工地 * @param projectName @@ -196,6 +221,24 @@ public class BuildingController { return success; } + /** + * 查询当天工地视频感知事件 + * @return + */ + @GetMapping("selectByEvent") + @ApiOperation("查询当天工地视频感知事件") + public Result selectByEvent(){ + List events = buildingRecordsMapper.selectByEvent(); + events.forEach(eventDto -> { + eventDto.setEventNewName(eventDto.getEventCnName()); + }); + Map map = new HashMap<>(); + map.put("sum",events.size()); + map.put("data",events); + Result success = Result.success(map); + return success; + } + /** * 查询当天扬尘事件 * @return diff --git a/src/main/java/com/hisense/monitormanage/mapper/BuildingRecordsMapper.java b/src/main/java/com/hisense/monitormanage/mapper/BuildingRecordsMapper.java index a049aa7..c96e5ac 100644 --- a/src/main/java/com/hisense/monitormanage/mapper/BuildingRecordsMapper.java +++ b/src/main/java/com/hisense/monitormanage/mapper/BuildingRecordsMapper.java @@ -3,7 +3,9 @@ package com.hisense.monitormanage.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.hisense.monitormanage.dto.BuildingRecordsDto; import com.hisense.monitormanage.dto.BuildingRecordsDtos; +import com.hisense.monitormanage.dto.EventDto; import com.hisense.monitormanage.entity.BuildingRecords; +import com.hisense.monitormanage.entity.Event; import com.hisense.monitormanage.entity.RoadData; import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; @@ -38,6 +40,11 @@ public interface BuildingRecordsMapper extends BaseMapper { List selectNoiceEvent(@Param("page") Integer page,@Param("pageSize") Integer pageSize); + List selectByAllEvent(@Param("page") Integer page,@Param("pageSize") Integer pageSize); + + @Select("select COUNT(*) from t_event WHERE camera_name IN ('博海建设南昌路127号现场','青城建设蚌埠路以北宁乡路以西门') AND track_event = 'START'") + Integer selectCountEvent(); + @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(); @@ -63,4 +70,8 @@ public interface BuildingRecordsMapper extends BaseMapper { @Select("select * from t_road_data where pm10 > 150 AND dt = #{dt}") List selectByDayRoadData(String dt); + + @Select("select * from t_event WHERE camera_name IN ('博海建设南昌路127号现场','青城建设蚌埠路以北宁乡路以西门') AND track_event = 'START' AND TO_DAYS(capture_time) = TO_DAYS(NOW())") + List selectByEvent(); + } diff --git a/src/main/resources/mapper/BuildingRecordsMapper.xml b/src/main/resources/mapper/BuildingRecordsMapper.xml index 7ddc489..89e4e4f 100644 --- a/src/main/resources/mapper/BuildingRecordsMapper.xml +++ b/src/main/resources/mapper/BuildingRecordsMapper.xml @@ -50,6 +50,14 @@ limit #{page},#{pageSize} + +