浏览代码

soc-modules-iot模块,告警中心-列表查询缺陷修复

humingshi-7@163.com 11 月之前
父节点
当前提交
b6799a546c
共有 1 个文件被更改,包括 5 次插入5 次删除
  1. 5 5
      soc-modules/soc-modules-iot/src/main/resources/mapper/IotAlarmDataMapper.xml

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

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