|
@@ -639,7 +639,8 @@
|
|
|
</select>
|
|
|
<!--查询管网地图图层及设备-->
|
|
|
<select id="selectPipeNetLayer" resultMap="layerMap">
|
|
|
- select t4.id scene_id,t4.scene_name,t5.scene_type_name,t6.id device_id,t6.device_code,t6.device_name,t6.point_x,t6.point_y,t6.address,concat(t12.operator,cast(t12.value as char)+0) alarm_range
|
|
|
+ select t4.id scene_id,t4.scene_name,t5.scene_type_name,t6.id device_id,t6.device_code,t6.device_name,t6.point_x,t6.point_y,t6.address,
|
|
|
+ (select GROUP_CONCAT(t12.relation , ' ',t12.operator,' ',t12.value, ' ' SEPARATOR '') as `alarm_range` from sms_alarm_rule t12 where t12.alarm_type_id = t11.id) alarm_range
|
|
|
,t8.attribute_id ,ifnull(t8.remark, t9.`name`) attribute_name,t9.unit,case when t8.attribute_id is null then null when t10.id is null then 0 else 1 end is_alarm
|
|
|
<if test="flag == null or flag ==0">
|
|
|
,if (t7.alarm_count>0, 1, 0) device_state
|
|
@@ -664,7 +665,6 @@
|
|
|
left join sms_device_attribute t9 on t8.attribute_id=t9.id and t9.status = 1
|
|
|
left join sms_alarm_details t10 on t10.scene_id=t2.scene_id and t10.device_id=t2.device_id and t10.attribute_id=t8.attribute_id and t10.status = 1 and t10.state=1
|
|
|
left join sms_alarm_type t11 on t10.ALARM_ID=t11.id and t11.status = 1
|
|
|
- left join sms_alarm_rule t12 on t12.alarm_type_id=t11.id and t12.status = 1
|
|
|
where t1.parent_scene_id = 0 and t1. status = 1 and t1. enable_state = 1 and t3.scene_type_name = '管网'
|
|
|
<choose>
|
|
|
<when test="sceneTypeName != null and sceneTypeName !=''">
|