添加工地场景视频感知事件

This commit is contained in:
wuweida 2022-08-10 10:02:51 +08:00
parent 43d36fff08
commit 6eff04bf7d
3 changed files with 62 additions and 0 deletions

View File

@ -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<EventDto> eventDtos = buildingRecordsMapper.selectByAllEvent(page, pageSize);
eventDtos.forEach(eventDto -> {
eventDto.setEventNewName(eventDto.getEventCnName());
});
Integer integer = buildingRecordsMapper.selectCountEvent();
Map<String,Object> 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<EventDto> events = buildingRecordsMapper.selectByEvent();
events.forEach(eventDto -> {
eventDto.setEventNewName(eventDto.getEventCnName());
});
Map<String,Object> map = new HashMap<>();
map.put("sum",events.size());
map.put("data",events);
Result success = Result.success(map);
return success;
}
/**
* 查询当天扬尘事件
* @return

View File

@ -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<BuildingRecords> {
List<BuildingRecordsDto> selectNoiceEvent(@Param("page") Integer page,@Param("pageSize") Integer pageSize);
List<EventDto> 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<BuildingRecords> {
@Select("select * from t_road_data where pm10 > 150 AND dt = #{dt}")
List<RoadData> 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<EventDto> selectByEvent();
}

View File

@ -50,6 +50,14 @@
limit #{page},#{pageSize}
</select>
<select id="selectByAllEvent" resultType="com.hisense.monitormanage.dto.EventDto">
select * from t_event
WHERE camera_name IN ('博海建设南昌路127号现场','青城建设蚌埠路以北宁乡路以西门')
AND track_event = 'START'
<bind name="page" value="(page-1)*pageSize"/>
limit #{page},#{pageSize}
</select>
<select id="selectWeekPmAndNoice" resultType="com.hisense.monitormanage.dto.BuildingRecordsDtos">
select a.pushTime,b.pm10,b.noice
from (