|
@@ -607,15 +607,16 @@
|
|
|
and t6.device_name like concat('%', #{deviceName},'%')
|
|
|
</if>
|
|
|
</select>
|
|
|
+
|
|
|
+
|
|
|
<!--分页查询管网实时数据列表-->
|
|
|
<select id="selectPipeNetPage" resultType="com.bz.zoneiot.water.api.vo.OnlineDataVo">
|
|
|
- select t1.id scene_id,t1.scene_name,t6.id device_id,t6.device_code,t6.device_name,t6.address,if (t7.alarm_count>0, 1, 0) deviceState
|
|
|
+ select t1.id scene_id,t1.scene_name,t6.id device_id,t6.device_code,t6.device_name,t6.address,t6.ENABLE_STATE deviceState
|
|
|
from sms_scene t1
|
|
|
<include refid="deviceInnerJoins"/>
|
|
|
- left join(
|
|
|
- select a1.scene_id, a1.device_id ,count(1) alarm_count 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 = '管网' and t5.scene_type_name = #{onlineDataDto.sceneTypeName}
|
|
|
+ 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 = #{onlineDataDto.sceneTypeName}
|
|
|
<if test="onlineDataDto.sceneIds != null and onlineDataDto.sceneIds.size() > 0">
|
|
|
and t1.id in
|
|
|
<foreach collection="onlineDataDto.sceneIds" item="item" open="(" close=")" separator=",">
|