From f7c4d8b6c3eac2f8ba305257aa3dc5a062f2c293 Mon Sep 17 00:00:00 2001 From: wuweida <2918581207@qq.com> Date: Fri, 26 Aug 2022 11:26:06 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E7=82=B9=E5=8C=BA=E5=9F=9F=E5=9C=BA?= =?UTF-8?q?=E6=99=AF=E6=B7=BB=E5=8A=A0=E8=8E=B7=E5=8F=96=E5=9B=BE=E7=89=87?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../monitormanage/controller/KeyAreaController.java | 12 ++++++++++++ .../com/hisense/monitormanage/dto/KeyAreaDto.java | 6 ++++++ .../com/hisense/monitormanage/entity/KeyArea.java | 4 ++++ .../hisense/monitormanage/mapper/KeyAreaMapper.java | 3 +++ .../monitormanage/service/MonitorService.java | 2 +- src/main/resources/mapper/KeyAreaMapper.xml | 8 ++++---- .../monitormanage/MonitorManageApplicationTests.java | 9 +-------- 7 files changed, 31 insertions(+), 13 deletions(-) diff --git a/src/main/java/com/hisense/monitormanage/controller/KeyAreaController.java b/src/main/java/com/hisense/monitormanage/controller/KeyAreaController.java index 6534fda..9c797a9 100644 --- a/src/main/java/com/hisense/monitormanage/controller/KeyAreaController.java +++ b/src/main/java/com/hisense/monitormanage/controller/KeyAreaController.java @@ -301,5 +301,17 @@ public class KeyAreaController { return success; } + /** + * 查询重点区域抓图照片 + * @return + */ + @GetMapping("selectByAreaImage") + @ApiOperation("查询重点区域抓图照片") + public Result selectByAreaImage(String areaName){ + List keyAreaDtos = keyAreaMapper.selectByAreaImage(areaName); + Result success = Result.success(keyAreaDtos); + return success; + } + } diff --git a/src/main/java/com/hisense/monitormanage/dto/KeyAreaDto.java b/src/main/java/com/hisense/monitormanage/dto/KeyAreaDto.java index 40a4def..9bd03b7 100644 --- a/src/main/java/com/hisense/monitormanage/dto/KeyAreaDto.java +++ b/src/main/java/com/hisense/monitormanage/dto/KeyAreaDto.java @@ -33,4 +33,10 @@ public class KeyAreaDto { private String point; + private String channelCode; + + private String channelName; + + private String picUrl; + } diff --git a/src/main/java/com/hisense/monitormanage/entity/KeyArea.java b/src/main/java/com/hisense/monitormanage/entity/KeyArea.java index 9e943ff..5b0bd93 100644 --- a/src/main/java/com/hisense/monitormanage/entity/KeyArea.java +++ b/src/main/java/com/hisense/monitormanage/entity/KeyArea.java @@ -25,4 +25,8 @@ public class KeyArea { private String about;//简介 + private String channelCode; + + private String channelName; + } diff --git a/src/main/java/com/hisense/monitormanage/mapper/KeyAreaMapper.java b/src/main/java/com/hisense/monitormanage/mapper/KeyAreaMapper.java index 1f33564..2f737ba 100644 --- a/src/main/java/com/hisense/monitormanage/mapper/KeyAreaMapper.java +++ b/src/main/java/com/hisense/monitormanage/mapper/KeyAreaMapper.java @@ -47,4 +47,7 @@ public interface KeyAreaMapper extends BaseMapper { List selectLocalMonthArea(@Param("areaName") String areaName); + @Select("select * from t_key_area ka LEFT JOIN t_channel_picture cp ON ka.channel_code = cp.channel_code where ka.area_name = #{areaName} ") + List selectByAreaImage(@Param("areaName") String areaName); + } diff --git a/src/main/java/com/hisense/monitormanage/service/MonitorService.java b/src/main/java/com/hisense/monitormanage/service/MonitorService.java index cf275e6..512aac4 100644 --- a/src/main/java/com/hisense/monitormanage/service/MonitorService.java +++ b/src/main/java/com/hisense/monitormanage/service/MonitorService.java @@ -271,7 +271,7 @@ public class MonitorService{ log.info("[monitor-capture]: start capture"); - List labels = cameraChannelMapper.selectLabelAndChannel("1006,1004"); + List labels = cameraChannelMapper.selectLabelAndChannel("1006,1004,1001"); labels.forEach(label -> { String channelCode = label.getChannelCode(); try { diff --git a/src/main/resources/mapper/KeyAreaMapper.xml b/src/main/resources/mapper/KeyAreaMapper.xml index f493267..60845d6 100644 --- a/src/main/resources/mapper/KeyAreaMapper.xml +++ b/src/main/resources/mapper/KeyAreaMapper.xml @@ -4,7 +4,7 @@ SELECT * FROM (SELECT ka.type,ka.location,ka.service_time,ka.management,ka.scenic_level, - ka.about,ka.area_id,ka.area_name,ss.allNums,ss.localNums,ss.nonlocalNums + ka.about,ka.area_id,ka.area_name,ka.channel_code,ka.channel_name,ss.allNums,ss.localNums,ss.nonlocalNums FROM t_key_area ka LEFT JOIN (SELECT pt.area_name,SUM(pf.all_nums) AS allNums,SUM(pf.local_nums) AS localNums, SUM(pf.nonlocal_nums) AS nonlocalNums diff --git a/src/test/java/com/hisense/monitormanage/MonitorManageApplicationTests.java b/src/test/java/com/hisense/monitormanage/MonitorManageApplicationTests.java index b9a9e13..24d2b9b 100644 --- a/src/test/java/com/hisense/monitormanage/MonitorManageApplicationTests.java +++ b/src/test/java/com/hisense/monitormanage/MonitorManageApplicationTests.java @@ -1,19 +1,12 @@ package com.hisense.monitormanage; -import cn.hutool.crypto.SecureUtil; import com.alibaba.fastjson.JSONObject; -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.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; @SpringBootTest class MonitorManageApplicationTests { @@ -32,7 +25,7 @@ class MonitorManageApplicationTests { @Test void contextLoads() { - qidiService.resCatalogApplyHJWSZY(); + monitorService.buildingImage(); } @Test