|
@@ -32,12 +32,21 @@
|
|
|
|
|
|
<select id="findPage" resultType="com.huaxu.vo.DataAlarmManageVo">
|
|
|
select
|
|
|
- <include refid="alarmManage_result_list"></include>
|
|
|
- from sms_data_alarm_manage a
|
|
|
-
|
|
|
- inner join sms_device t1 on m
|
|
|
- inner join sms_device_attribute t2 on t1.device_type_id = t2.device_type_id and t2.status = 1
|
|
|
- inner join sms_device_parm t3 on t3.device_id = t1.id and t3.attribute_id=t2.id and t3.status=1
|
|
|
+ m.id,m.alarm_name, t2.name as be_attribute_name,s.SCENE_NAME as be_scene_name,
|
|
|
+ m.compute_rules,m.alar_rules,m.alar_value,mm.to_attribute_name,mm.to_scene_name
|
|
|
+ from
|
|
|
+ sms_data_alarm_manage m
|
|
|
+ INNER JOIN sms_scene s on s.id = m.be_scene_id and s.status = 1
|
|
|
+ INNER JOIN sms_device t1 on m.be_device_id = t1.id and t1.status = 1
|
|
|
+ INNER JOIN sms_device_attribute t2 on m.be_attribute_id=t2.id and t2.status =1
|
|
|
+ LEFT JOIN (
|
|
|
+ select m.id, t2.name as to_attribute_name,s.SCENE_NAME as to_scene_name
|
|
|
+ from
|
|
|
+ sms_data_alarm_manage m
|
|
|
+ INNER JOIN sms_scene s on s.id = m.to_scene_id and s.status = 1
|
|
|
+ INNER JOIN sms_device t1 on m.to_device_id = t1.id and t1.status = 1
|
|
|
+ INNER JOIN sms_device_attribute t2 on m.to_attribute_id=t2.id and t2.status =1
|
|
|
+ ) mm on mm.id = m.id
|
|
|
<where>
|
|
|
<if test="dto.userType != null and dto.userType != -999 and dto.userType!=-9999 and dto.programItems != null and dto.programItems.size() > 0">
|
|
|
<if test="dto.permissonType == 5 or dto.permissonType == 2">
|