From 01ecbf0a1d5d070a4cec21cd818f0198845bdac5 Mon Sep 17 00:00:00 2001 From: wuweida <2918581207@qq.com> Date: Thu, 12 May 2022 17:32:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=91=84=E5=83=8F=E5=A4=B4=E6=88=AA=E5=9B=BE?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../monitormanage/mapper/CameraChannelMapper.java | 4 ++-- .../monitormanage/service/MonitorService.java | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/hisense/monitormanage/mapper/CameraChannelMapper.java b/src/main/java/com/hisense/monitormanage/mapper/CameraChannelMapper.java index 6043bb2..a870c39 100644 --- a/src/main/java/com/hisense/monitormanage/mapper/CameraChannelMapper.java +++ b/src/main/java/com/hisense/monitormanage/mapper/CameraChannelMapper.java @@ -37,8 +37,8 @@ public interface CameraChannelMapper extends BaseMapper { List selectByChannelName(String channelName); @Select("select * from (select a.label_code,a.label_name,c.channel_code,c.channel_name from t_channel_mtm_label b JOIN t_label a JOIN t_camera_channel c " + - "ON a.label_code = b.label_code AND b.channel_code = c.channel_code where c.`status`!= 0) m where m.label_code = #{labelCode} ") - List selectLabelAndChannel(@Param("labelCode") String labelCode); + "ON a.label_code = b.label_code AND b.channel_code = c.channel_code where c.`status`!= 0) m where m.label_code in (#{labelCode},#{labelCode1}) ") + List selectLabelAndChannel(@Param("labelCode") String labelCode,@Param("labelCode1") String labelCode1); @Select("select cc.channel_code,cc.gps_x,cc.gps_y from t_camera_channel cc " + "where (gps_x between #{gpsX} and #{gpsX1}) and (gps_y between #{gpsY} and #{gpsY1} )") diff --git a/src/main/java/com/hisense/monitormanage/service/MonitorService.java b/src/main/java/com/hisense/monitormanage/service/MonitorService.java index d8d03e8..fb64050 100644 --- a/src/main/java/com/hisense/monitormanage/service/MonitorService.java +++ b/src/main/java/com/hisense/monitormanage/service/MonitorService.java @@ -211,7 +211,7 @@ public class MonitorService { log.info("[monitor-capture]: start capture"); - List labels = cameraChannelMapper.selectLabelAndChannel("1009"); + List labels = cameraChannelMapper.selectLabelAndChannel("1009","1008"); labels.forEach(label -> { String channelCode = label.getChannelCode(); try { @@ -224,12 +224,12 @@ public class MonitorService { ChannelPicture picture = new ChannelPicture(); picture.setChannelCode(channelCode); picture.setPicUrl(picUrl); - picture.setInsertTime(new Date()); - channelPictureMapper.insert(picture); - /*QueryWrapper queryWrapper = new QueryWrapper<>(); + /*picture.setInsertTime(new Date()); + channelPictureMapper.insert(picture);*/ + QueryWrapper queryWrapper = new QueryWrapper<>(); queryWrapper.eq("channel_code",channelCode); picture.setInsertTime(new Date()); - channelPictureMapper.update(picture,queryWrapper);*/ + channelPictureMapper.update(picture,queryWrapper); }catch (Exception e){ log.info( "[monitor-capture] " +channelCode + " 截图图片失败 " + e.getMessage()); @@ -249,7 +249,7 @@ public class MonitorService { log.info("[monitor-capture]: start capture"); - List labels = cameraChannelMapper.selectLabelAndChannel("1004"); + List labels = cameraChannelMapper.selectLabelAndChannel("1004","1006"); labels.forEach(label -> { String channelCode = label.getChannelCode(); try {