摄像头截图优化

This commit is contained in:
wuweida 2022-05-12 17:32:52 +08:00
parent 22ed4014a6
commit 01ecbf0a1d
2 changed files with 8 additions and 8 deletions

View File

@ -37,8 +37,8 @@ public interface CameraChannelMapper extends BaseMapper<CameraChannel> {
List<CameraChannel> 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<ChannelLabelDto> 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<ChannelLabelDto> 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} )")

View File

@ -211,7 +211,7 @@ public class MonitorService {
log.info("[monitor-capture]: start capture");
List<ChannelLabelDto> labels = cameraChannelMapper.selectLabelAndChannel("1009");
List<ChannelLabelDto> 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<ChannelPicture> queryWrapper = new QueryWrapper<>();
/*picture.setInsertTime(new Date());
channelPictureMapper.insert(picture);*/
QueryWrapper<ChannelPicture> 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<ChannelLabelDto> labels = cameraChannelMapper.selectLabelAndChannel("1004");
List<ChannelLabelDto> labels = cameraChannelMapper.selectLabelAndChannel("1004","1006");
labels.forEach(label -> {
String channelCode = label.getChannelCode();
try {