| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 | 
							- <?xml version="1.0" encoding="UTF-8"?>
 
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 
- <mapper namespace="com.xunmei.iot.mapper.DiagnoseThresholdChMapper">
 
-     <select id="selectPageData" resultType="com.xunmei.iot.vo.sensor.DiagnoseThresholdPageVo">
 
-         select c.* from
 
-         (
 
-             select s.id,s.org_id, s.org_name,s.org_path, s.device_name, dvs.device_name as host_name,
 
-             (select group_concat(threshold_code) from iot_device_diagnose_threshold_ch ch where ch.iot_token = s.iot_token
 
-             and ch.device_product=s.device_product and ch.dvs = s.host_code and ch.channel = s.device_code) threshold_codes
 
-             from iot_device_info s
 
-             inner join iot_device_info dvs on dvs.iot_token = s.iot_token
 
-             and dvs.device_product = s.device_product and dvs.device_code = s.host_code
 
-             and dvs.deleted = 0 and s.enable = 0 and dvs.device_type = 1
 
-             where s.deleted=0 and s.enable=0 and s.device_type = 2
 
-             <if test="request.orgId!= null">
 
-                 and s.org_id=#{request.orgId}
 
-             </if>
 
-             <if test="request.orgPath!= null">
 
-                 and s.org_path like CONCAT(#{request.orgPath}, '%')
 
-             </if>
 
-             <if test="request.deviceName != null and request.deviceName!= ''">
 
-                 and s.device_name like CONCAT('%',#{request.deviceName},'%')
 
-             </if>
 
-             order by s.host_code ,cast(s.device_code as signed)
 
-         ) c where 1=1
 
-         <choose>
 
-             <when test=" request.state == null">
 
-             </when>
 
-             <when test=" request.state == 0">
 
-                 and c.threshold_codes is null
 
-             </when>
 
-             <otherwise>
 
-                 and c.threshold_codes is not null
 
-             </otherwise>
 
-         </choose>
 
-         <choose>
 
-             <when test=" request.thresholdCode != null and request.thresholdCode != '' ">
 
-                 and c.threshold_codes like CONCAT('%',#{request.thresholdCode}, '%')
 
-             </when>
 
-             <otherwise>
 
-             </otherwise>
 
-         </choose>
 
-     </select>
 
-     <select id="selectAllDiagnoseThreshold" resultType="com.xunmei.common.core.domain.iot.domain.IotDeviceDiagnoseThreshold">
 
-         select * from iot_device_diagnose_threshold
 
-     </select>
 
-     <select id="selectBindCount" resultType="java.lang.Integer">
 
-         select count(1) from iot_device_diagnose_threshold_ch where threshold_code = #{thresholdCode}
 
-     </select>
 
- </mapper>
 
 
  |