Browse Source

过滤已删除关联

lin 4 years ago
parent
commit
8229bcee8e
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/main/resources/mapper/DeviceMapper.xml

+ 1 - 1
src/main/resources/mapper/DeviceMapper.xml

@@ -617,7 +617,7 @@
     SUM(IF(sd.device_status = 4, 1, 0)) as offline_count,
     SUM(IF(sd.device_status = 5, 1, 0)) as device_unused_count
     from sc_device sd
-    <if test="userId != null"> left join sc_grid_management scm on(scm.device_id = sd.id) </if>
+    <if test="userId != null"> left join sc_grid_management scm on(scm.device_id = sd.id and scm.status = 1) </if>
     WHERE sd.status = 1
     <if test="siteId != null"> and sd.site_id = #{siteId} </if>
     <if test="sysId != null"> and sd.sys_id = #{sysId} </if>