From 6eff04bf7dac6c4acb080bf12b43a13346a258d1 Mon Sep 17 00:00:00 2001 From: wuweida <2918581207@qq.com> Date: Wed, 10 Aug 2022 10:02:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=B7=A5=E5=9C=B0=E5=9C=BA?= =?UTF-8?q?=E6=99=AF=E8=A7=86=E9=A2=91=E6=84=9F=E7=9F=A5=E4=BA=8B=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/BuildingController.java | 43 +++++++++++++++++++ .../mapper/BuildingRecordsMapper.java | 11 +++++ .../mapper/BuildingRecordsMapper.xml | 8 ++++ 3 files changed, 62 insertions(+) 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} + +