|
@@ -642,12 +642,7 @@
|
|
|
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
|
|
|
- </if>
|
|
|
- <if test="flag == 1">
|
|
|
- ,case when t7.offline_alarm_count>0 then 2 when t7.alarm_count>0 then 1 else 0 end device_state
|
|
|
- </if>
|
|
|
+ ,t6.ENABLE_STATE device_state
|
|
|
from sms_scene t1
|
|
|
<include refid="deviceInnerJoins"/>
|
|
|
left join(
|