This commit is contained in:
wuweida 2022-07-21 15:12:06 +08:00
parent ec821744db
commit d3e0b3bdad
7 changed files with 58 additions and 16 deletions

View File

@ -128,8 +128,9 @@ public class BuildingController {
@ApiOperation("查询工地扬尘事件") @ApiOperation("查询工地扬尘事件")
public Result selectRaise(Integer page,Integer pageSize){ public Result selectRaise(Integer page,Integer pageSize){
List<BuildingRecordsDto> records = buildingRecordsMapper.selectRaise(page,pageSize); List<BuildingRecordsDto> records = buildingRecordsMapper.selectRaise(page,pageSize);
Integer integer = buildingRecordsMapper.selectCountRaise();
Map<String,Object> map = new HashMap<>(); Map<String,Object> map = new HashMap<>();
map.put("sum",records.size()); map.put("sum",integer);
map.put("data",records); map.put("data",records);
Result success = Result.success(map); Result success = Result.success(map);
return success; return success;
@ -143,8 +144,9 @@ public class BuildingController {
@ApiOperation("查询工地噪声事件") @ApiOperation("查询工地噪声事件")
public Result selectNoiceEvent(Integer page,Integer pageSize){ public Result selectNoiceEvent(Integer page,Integer pageSize){
List<BuildingRecordsDto> records = buildingRecordsMapper.selectNoiceEvent(page,pageSize); List<BuildingRecordsDto> records = buildingRecordsMapper.selectNoiceEvent(page,pageSize);
Integer integer = buildingRecordsMapper.selectCountNoice();
Map<String,Object> map = new HashMap<>(); Map<String,Object> map = new HashMap<>();
map.put("sum",records.size()); map.put("sum",integer);
map.put("data",records); map.put("data",records);
Result success = Result.success(map); Result success = Result.success(map);
return success; return success;

View File

@ -252,6 +252,7 @@ public class Controller {
return success; return success;
} }
/** /**
* 根据标签名字模糊查询标签 * 根据标签名字模糊查询标签
* @param labelName * @param labelName

View File

@ -208,8 +208,9 @@ public class EventController {
for (EventDto list: lists) { for (EventDto list: lists) {
list.setEventNewName("环境卫生"); list.setEventNewName("环境卫生");
} }
Integer integer = eventMapper.selectCountByName("'塑料篮子','纸箱','街头散落垃圾'");
Map<String,Object> map = new HashMap<>(); Map<String,Object> map = new HashMap<>();
map.put("sum",lists.size()); map.put("sum",integer);
map.put("events",lists); map.put("events",lists);
Result success = Result.success(map); Result success = Result.success(map);
return success; return success;
@ -218,8 +219,9 @@ public class EventController {
for (EventDto list: lists) { for (EventDto list: lists) {
list.setEventNewName("占道经营"); list.setEventNewName("占道经营");
} }
Integer integer = eventMapper.selectCountByName("'街头伞篷','水果和食品摊','地摊','户外桌椅'");
Map<String,Object> map = new HashMap<>(); Map<String,Object> map = new HashMap<>();
map.put("sum",lists.size()); map.put("sum",integer);
map.put("events",lists); map.put("events",lists);
Result success = Result.success(map); Result success = Result.success(map);
return success; return success;
@ -228,8 +230,9 @@ public class EventController {
for (EventDto list: lists) { for (EventDto list: lists) {
list.setEventNewName("沿街晾晒"); list.setEventNewName("沿街晾晒");
} }
Integer integer = eventMapper.selectCountByName("'沿街晾晒衣物被单'");
Map<String,Object> map = new HashMap<>(); Map<String,Object> map = new HashMap<>();
map.put("sum",lists.size()); map.put("sum",integer);
map.put("events",lists); map.put("events",lists);
Result success = Result.success(map); Result success = Result.success(map);
return success; return success;
@ -238,8 +241,9 @@ public class EventController {
for (EventDto list: lists) { for (EventDto list: lists) {
list.setEventNewName("违章停车"); list.setEventNewName("违章停车");
} }
Integer integer = eventMapper.selectCountByName("'机动车违停'");
Map<String,Object> map = new HashMap<>(); Map<String,Object> map = new HashMap<>();
map.put("sum",lists.size()); map.put("sum",integer);
map.put("events",lists); map.put("events",lists);
Result success = Result.success(map); Result success = Result.success(map);
return success; return success;
@ -248,8 +252,9 @@ public class EventController {
for (EventDto list : lists) { for (EventDto list : lists) {
list.setEventNewName("渣土车发现"); list.setEventNewName("渣土车发现");
} }
Integer integer = eventMapper.selectCountByName("'渣土车发现'");
Map<String,Object> map = new HashMap<>(); Map<String,Object> map = new HashMap<>();
map.put("sum",lists.size()); map.put("sum",integer);
map.put("events",lists); map.put("events",lists);
Result success = Result.success(map); Result success = Result.success(map);
return success; return success;
@ -258,8 +263,9 @@ public class EventController {
for (EventDto list : lists) { for (EventDto list : lists) {
list.setEventNewName("安保区域人员滞留"); list.setEventNewName("安保区域人员滞留");
} }
Integer integer = eventMapper.selectCountByName("'安保区域人员滞留'");
Map<String,Object> map = new HashMap<>(); Map<String,Object> map = new HashMap<>();
map.put("sum",lists.size()); map.put("sum",integer);
map.put("events",lists); map.put("events",lists);
Result success = Result.success(map); Result success = Result.success(map);
return success; return success;
@ -268,8 +274,9 @@ public class EventController {
for (EventDto list : lists) { for (EventDto list : lists) {
list.setEventNewName("安保区域人员徘徊"); list.setEventNewName("安保区域人员徘徊");
} }
Integer integer = eventMapper.selectCountByName("'安保区域人员徘徊'");
Map<String,Object> map = new HashMap<>(); Map<String,Object> map = new HashMap<>();
map.put("sum",lists.size()); map.put("sum",integer);
map.put("events",lists); map.put("events",lists);
Result success = Result.success(map); Result success = Result.success(map);
return success; return success;
@ -278,8 +285,9 @@ public class EventController {
for (EventDto list : lists) { for (EventDto list : lists) {
list.setEventNewName("渣土车未密闭"); list.setEventNewName("渣土车未密闭");
} }
Integer integer = eventMapper.selectCountByName("'渣土车未密闭'");
Map<String,Object> map = new HashMap<>(); Map<String,Object> map = new HashMap<>();
map.put("sum",lists.size()); map.put("sum",integer);
map.put("events",lists); map.put("events",lists);
Result success = Result.success(map); Result success = Result.success(map);
return success; return success;
@ -288,8 +296,9 @@ public class EventController {
for (EventDto list : lists) { for (EventDto list : lists) {
list.setEventNewName("道路积水事件"); list.setEventNewName("道路积水事件");
} }
Integer integer = eventMapper.selectCountByName("'道路积水事件'");
Map<String,Object> map = new HashMap<>(); Map<String,Object> map = new HashMap<>();
map.put("sum",lists.size()); map.put("sum",integer);
map.put("events",lists); map.put("events",lists);
Result success = Result.success(map); Result success = Result.success(map);
return success; 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); 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" + @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},'%')") " where br.project_name like concat('%',#{projectName},'%')")
List<BuildingRecordsDto> selectByProjectName(String projectName); List<BuildingRecordsDto> selectByProjectName(String projectName);

View File

@ -58,6 +58,6 @@ public interface CameraChannelMapper extends BaseMapper<CameraChannel> {
List<CameraChannelNLDto> selectNLAll(@Param("page") Integer page,@Param("pageSize") Integer pageSize); List<CameraChannelNLDto> selectNLAll(@Param("page") Integer page,@Param("pageSize") Integer pageSize);
@Select("SELECT * FROM t_camera_channel WHERE channel_code < '183_37028301831321231117' AND channel_code > '183_37028301001328630804' ORDER BY channel_code DESC") @Select("SELECT * FROM t_camera_channel WHERE channel_code < '183_37028301831315320208' AND channel_code > '183_37028301001328630804' ORDER BY channel_code DESC")
List<CameraChannel> selectCameraChannel(); List<CameraChannel> selectCameraChannel();
} }

View File

@ -22,6 +22,9 @@ public interface EventMapper extends BaseMapper<Event> {
List<EventDto> selectByName(@Param("eventNewName") String eventNewName,@Param("page") Integer page,@Param("pageSize") Integer pageSize); List<EventDto> selectByName(@Param("eventNewName") String eventNewName,@Param("page") Integer page,@Param("pageSize") Integer pageSize);
@Select("select count(*) from t_event where track_event = 'START' and event_cn_name in (${eventNewName})")
Integer selectCountByName(@Param("eventNewName")String eventNewName);
@Select("SELECT * FROM t_event where TO_DAYS(capture_time) = TO_DAYS(NOW()) AND event_cn_name in (${eventNewName}) AND track_event = 'START'") @Select("SELECT * FROM t_event where TO_DAYS(capture_time) = TO_DAYS(NOW()) AND event_cn_name in (${eventNewName}) AND track_event = 'START'")
List<EventDto> selectByTimeAndName(@Param("eventNewName") String eventNewName); List<EventDto> selectByTimeAndName(@Param("eventNewName") String eventNewName);
} }

View File

@ -1,29 +1,49 @@
package com.hisense.monitormanage; package com.hisense.monitormanage;
import cn.hutool.crypto.SecureUtil;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.hisense.monitormanage.service.MonitorService; import com.hisense.monitormanage.entity.PassengerFlow;
import com.hisense.monitormanage.entity.RoadData;
import com.hisense.monitormanage.service.*;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List;
import java.util.Map; import java.util.Map;
@SpringBootTest @SpringBootTest
class MonitorManageApplicationTests { class MonitorManageApplicationTests {
@Autowired
private RoadDataService roadDataService;
@Autowired @Autowired
private MonitorService monitorService; private MonitorService monitorService;
@Autowired
private QidiService qidiService;
@Autowired
private BuildingRecordsService buildingRecordsService;
@Test @Test
void contextLoads() { void contextLoads() {
qidiService.resCatalogApplyHJWSZY();
} }
@Test @Test
void start1() { void start1(){
monitorService.start1(); buildingRecordsService.getAndSaveRecords();
}
@Test
void start2(){
roadDataService.saveRoadData();
} }