IotDeviceDiagnoseMissionChMapper.xml 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.xunmei.host.iot.mapper.IotDeviceDiagnoseMissionChMapper">
  4. <select id="selectMissions" resultType="com.xunmei.host.iot.dto.IotDeviceDiagnoseMissionReq">
  5. select * from iot_device_diagnose_mission
  6. </select>
  7. <select id="selectMissionChns" resultType="com.xunmei.common.core.domain.iot.domain.IotDeviceDiagnoseMissionCh">
  8. select * from iot_device_diagnose_mission_ch where mission_id = #{missionId}
  9. and iot_token in
  10. <foreach collection="iotCodes" index="index" item="item" open="(" separator="," close=")">
  11. #{item}
  12. </foreach>
  13. </select>
  14. <select id="selectThresholds" resultType="com.xunmei.host.iot.dto.IotDeviceDiagnoseThresholdReq">
  15. select * from iot_device_diagnose_threshold
  16. </select>
  17. <select id="selectThresholdChns" resultType="com.xunmei.common.core.domain.iot.domain.IotDeviceDiagnoseThresholdCh">
  18. select * from iot_device_diagnose_threshold_ch where threshold_code = #{thresholdCode}
  19. and iot_token in
  20. <foreach collection="iotCodes" index="index" item="item" open="(" separator="," close=")">
  21. #{item}
  22. </foreach>
  23. </select>
  24. <select id="updateDiagnoseNumber" resultType="java.lang.Integer">
  25. update iot_device_diagnose_threshold set diagnose_number =
  26. (
  27. select count(1) from iot_device_diagnose_threshold_ch where threshold_code = #{thresholdCode}
  28. )
  29. where threshold_code = #{thresholdCode}
  30. </select>
  31. <select id="selectIotTokensByCamera" resultType="java.lang.String">
  32. select distinct iot_token from iot_device_info where device_type in (2,3) and deleted = 0
  33. </select>
  34. </mapper>