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