|
@@ -443,7 +443,8 @@
|
|
|
<!--查询设备地图参数数据-->
|
|
|
<select id="selectDeviceMapParam" resultMap="deviceDataMap">
|
|
|
select distinct t1.id device_id,t1.device_code,t1.device_name,t1.point_x,point_y,t1.address,t2.attribute_id, ifnull(t2.remark, t3.`name`) attribute_name,t3.unit,t2.parm_type attribute_type,
|
|
|
- t2.seq,case when t2.attribute_id is null then null when t6.id is null then 0 else 1 end is_alarm,concat(t12.operator,cast(t12.operator as char)+0) alarm_range
|
|
|
+ t2.seq,case when t2.attribute_id is null then null when t6.id is null then 0 else 1 end is_alarm,
|
|
|
+ (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
|
|
|
<if test="flag == null or flag ==0">
|
|
|
,if (t4.alarm_count>0, 1, 0) device_state
|
|
|
</if>
|
|
@@ -466,7 +467,6 @@
|
|
|
)t4 on t4.device_id=t1.id
|
|
|
left join sms_alarm_details t6 on t6.device_id=t1.id and t6.attribute_id=t2.attribute_id and t6.status = 1 and t6.state=1
|
|
|
left join sms_alarm_type t11 on t6.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. status = 1 and t1.id= #{deviceId}
|
|
|
order by t2.seq
|
|
|
</select>
|