浏览代码

soc-modules-host模块,入库视频诊断后,更新摄像机绑定数量字段

humingshi-7@163.com 11 月之前
父节点
当前提交
3f64f7e099

+ 3 - 0
soc-modules/soc-modules-host/src/main/java/com/xunmei/host/iot/mapper/IotDeviceDiagnoseMissionChMapper.java

@@ -22,4 +22,7 @@ public interface IotDeviceDiagnoseMissionChMapper extends BaseMapper<IotDeviceDi
     List<IotDeviceDiagnoseMissionCh> selectMissionChns(@Param("missionId")String missionId,@Param("iotCodes")List<String> iotCodes);
     List<IotDeviceDiagnoseThresholdReq> selectThresholds();
     List<IotDeviceDiagnoseThresholdCh> selectThresholdChns(@Param("thresholdCode")String thresholdCode,@Param("iotCodes")List<String> iotCodes);
+
+    //修改阈值绑定的设备数量
+    Integer updateDiagnoseNumber(@Param("thresholdCode")String thresholdCode);
 }

+ 2 - 0
soc-modules/soc-modules-host/src/main/java/com/xunmei/host/iot/service/impl/IotCameraMissionRuleServiceImpl.java

@@ -157,6 +157,8 @@ public class IotCameraMissionRuleServiceImpl implements IotCameraMissionRuleServ
                         }
                     }
                 }
+                //更新绑定通道数量
+                missionChMapper.updateDiagnoseNumber(threshold.getThresholdCode());
             }
 
 

+ 8 - 0
soc-modules/soc-modules-host/src/main/resources/mapper/IotDeviceDiagnoseMissionChMapper.xml

@@ -24,4 +24,12 @@
             #{item}
         </foreach>
     </select>
+
+    <select id="updateDiagnoseNumber" resultType="java.lang.Integer">
+        update iot_device_diagnose_threshold set diagnose_number =
+        (
+           select count(1) from iot_device_diagnose_threshold_ch where threshold_code = #{thresholdCode}
+        )
+        where threshold_code =  #{thresholdCode}
+    </select>
 </mapper>