浏览代码

按管网名称分类查询设备修改

yuejiaying 4 年之前
父节点
当前提交
7f3a4c907e
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      sms_water/src/main/resources/mapper/OnlineMonitorMapper.xml

+ 2 - 2
sms_water/src/main/resources/mapper/OnlineMonitorMapper.xml

@@ -309,11 +309,11 @@
     <select id="selectDeviceCount" resultType="java.util.Map">
         select  t1.id sceneId,t1.scene_name sceneName,sum(if(t5.id is null,0,1)) deviceCount,sum(if(t7.device_id is null,0,1)) alarmCount
         from sms_scene t1
-        <include refid="deviceLeftJoins"/>
+        <include refid="deviceInnerJoins"/>
         left join(
             select a1.scene_id, a1.device_id from sms_alarm_details a1 where a1.`status` = 1 and a1.state = 1 group by a1.scene_id, a1.device_id
         )t7 on t7.scene_id=t2.scene_id and t7.device_id=t2.device_id
-        where t1.parent_scene_id = 0 and t1. status = 1 and t1. enable_state = 1 and t3.scene_type_name = '管网'
+        where t1.parent_scene_id = 0 and t1. status = 1 and t1. enable_state = 1 and t3.scene_type_name = '管网' and t5.scene_type_name = #{sceneTypeName}
         <if test="sceneIds != null and sceneIds.size() > 0">
             and t1.id  in
             <foreach collection="sceneIds" item="item" open="(" close=")" separator=",">