ソースを参照

修改查询判断设备是否被删除

xujie 1 年間 前
コミット
b4f63f788f

+ 4 - 2
soc-modules/soc-modules-iot/src/main/resources/mapper/IotAlarmDataMapper.xml

@@ -10,7 +10,8 @@
         FROM
         iot_alarm_data a
         LEFT JOIN sys_org b ON a.org_id = b.id
-        where 1=1
+        LEFT JOIN iot_device_info d ON a.device_id = d.id
+        where 1=1 and d.deleted = 0
         <if test="param.deviceName != null and param.deviceName != ''">
             and a.device_name like concat('%',#{param.deviceName},'%')
         </if>
@@ -71,7 +72,8 @@
         FROM
         iot_alarm_data a
         LEFT JOIN sys_org b ON a.org_id = b.id
-        where 1=1
+        LEFT JOIN iot_device_info d ON a.device_id = d.id
+        where 1=1 and d.deleted = 0
         <if test="param.deviceName != null and param.deviceName != ''">
             and a.device_name like concat('%',#{param.deviceName},'%')
         </if>