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 {