瀏覽代碼

履职任务详情 录像相关bug修改

jingyuanchao 1 年之前
父節點
當前提交
a32c720911

+ 7 - 7
soc-modules/soc-modules-iot/src/main/java/com/xunmei/iot/service/impl/IotServiceImpl.java

@@ -1,12 +1,12 @@
 package com.xunmei.iot.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.xunmei.common.core.domain.iot.domain.IotDvrChannel;
 import com.xunmei.common.core.domain.video.MediatorVideoDiagnosisRecord;
-import com.xunmei.iot.mapper.IotDvrChannelMapper;
+import com.xunmei.iot.mapper.IotDeviceInfoMapper;
 import com.xunmei.iot.mapper.VideoDaysCheckMapper;
 import com.xunmei.iot.mapper.VideoDiagnosisRecordMapper;
 import com.xunmei.iot.service.IotService;
+import com.xunmei.system.api.domain.iot.IotDeviceInfo;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
@@ -19,8 +19,7 @@ public class IotServiceImpl implements IotService {
     @Resource
     VideoDiagnosisRecordMapper diagnosisRecordMapper;
     @Resource
-    IotDvrChannelMapper channelMapper;
-
+    IotDeviceInfoMapper iotDeviceInfoMapper;
     @Override
     public Integer selectVideoDayExceptionChannelNums(Long orgId) {
         //此处考虑录像完整性和录像天数,任意一个异常就算异常
@@ -30,9 +29,10 @@ public class IotServiceImpl implements IotService {
 
     @Override
     public Integer selectVideoDiagnosisExceptionChannelNums(Long orgId) {
-        LambdaQueryWrapper<IotDvrChannel> channelWrapper = new LambdaQueryWrapper<>();
-        channelWrapper.eq(IotDvrChannel::getOrgId, orgId);
-        if (channelMapper.selectCount(channelWrapper) < 1) {
+        LambdaQueryWrapper<IotDeviceInfo> channelWrapper = new LambdaQueryWrapper<>();
+        channelWrapper.eq(IotDeviceInfo::getOrgId, orgId);
+        channelWrapper.in(IotDeviceInfo::getDeviceType, 2,3);
+        if (iotDeviceInfoMapper.selectCount(channelWrapper) < 1) {
             return null;
         }
         LambdaQueryWrapper<MediatorVideoDiagnosisRecord> wrapper = new LambdaQueryWrapper<MediatorVideoDiagnosisRecord>();

+ 3 - 8
soc-modules/soc-modules-iot/src/main/resources/mapper/VideoDaysCheckMapper.xml

@@ -3,15 +3,10 @@
 <mapper namespace="com.xunmei.iot.mapper.VideoDaysCheckMapper">
 
     <select id="selectExceptionCount" resultType="java.lang.Integer">
-        select sum(CASE
-                       WHEN vdc.status = 0 and vic.status = 0 THEN 0
-                       ELSE if(vdc.status = 1 or vic.status > 0, 1, 0) END) as state
-        FROM iot_dvr_channel dc
-                 INNER JOIN mediator_video_days_check vdc
-                            on dc.host_code = vdc.equipment_code and dc.channel_code = vdc.channel_code
+        select sum(if(vic.status > 0, 1, 0)) as state
+        FROM iot_device_info dc
                  INNER JOIN mediator_video_integrity_check vic
-                            on dc.host_code = vic.equipment_code and dc.channel_code = vic.channel_code
-
+                            on dc.host_code = vic.equipment_code and dc.device_code = vic.channel_code
         where dc.org_id = #{orgId}
           and dc.deleted = 0
     </select>