|
@@ -41,7 +41,7 @@
|
|
|
LEFT JOIN sms_device_attribute da ON da.id = r.ATTRIBUTE_ID
|
|
|
LEFT JOIN sms_device d ON d.id = r.DEVICE_ID
|
|
|
left join sms_scene s on s.id=p.PARENT_SCENE_ID
|
|
|
- where p.IS_CHART = 1 and p.`STATUS`= 1
|
|
|
+ where p.IS_CHART = 1 and p.`STATUS`= 1 and d.ENABLE_STATE = 1
|
|
|
and p.PARENT_SCENE_ID=#{sceneId}
|
|
|
and r.year=#{year}
|
|
|
and r.month=#{month}
|
|
@@ -95,7 +95,7 @@
|
|
|
LEFT JOIN sms_device_attribute da ON da.id = r.ATTRIBUTE_ID
|
|
|
LEFT JOIN sms_device d ON d.id = r.DEVICE_ID
|
|
|
left join sms_scene s on s.id=p.PARENT_SCENE_ID
|
|
|
- where p.IS_CHART = 1 and p.`STATUS`= 1
|
|
|
+ where p.IS_CHART = 1 and p.`STATUS`= 1 and d.ENABLE_STATE = 1
|
|
|
and p.PARENT_SCENE_ID=#{sceneId}
|
|
|
and r.year=#{year}
|
|
|
and r.month=#{month}
|
|
@@ -147,7 +147,7 @@
|
|
|
LEFT JOIN sms_device_attribute da ON da.id = r.ATTRIBUTE_ID
|
|
|
LEFT JOIN sms_device d ON d.id = r.DEVICE_ID
|
|
|
left join sms_scene s on s.id=p.PARENT_SCENE_ID
|
|
|
- where p.IS_CHART = 1 and p.`STATUS`= 1
|
|
|
+ where p.IS_CHART = 1 and p.`STATUS`= 1 and d.ENABLE_STATE = 1
|
|
|
and p.PARENT_SCENE_ID=#{sceneId}
|
|
|
and r.year=#{year}
|
|
|
<if test="tenantId != null and tenantId != '' ">
|
|
@@ -200,10 +200,10 @@
|
|
|
left join sms_scene s on s.id=p.parent_scene_id
|
|
|
left join sms_device_attribute da ON da.id = p.ATTRIBUTE_ID
|
|
|
LEFT JOIN sms_device d ON d.id = r.DEVICE_ID
|
|
|
- WHERE p.`STATUS`= 1 and p.parm_type in (3,5)
|
|
|
+ WHERE p.`STATUS`= 1 and p.parm_type in (3,5) and d.ENABLE_STATE = 1
|
|
|
AND r.YEAR = #{year} and r.month=#{month} and r.day=#{day}
|
|
|
<if test="sceneIds != null and sceneIds.size()>0">
|
|
|
- and r.PARENT_SCENE_ID in
|
|
|
+ and p.PARENT_SCENE_ID in
|
|
|
<foreach collection="sceneIds" item="item" open="(" close=")" separator=",">
|
|
|
#{item}
|
|
|
</foreach>
|
|
@@ -256,10 +256,10 @@
|
|
|
left join sms_scene s on s.id=p.parent_scene_id
|
|
|
left join sms_device_attribute da ON da.id = p.ATTRIBUTE_ID
|
|
|
LEFT JOIN sms_device d ON d.id = r.DEVICE_ID
|
|
|
- WHERE p.`STATUS`= 1 and p.parm_type in (3,5)
|
|
|
+ WHERE p.`STATUS`= 1 and p.parm_type in (3,5) and d.ENABLE_STATE = 1
|
|
|
AND r.YEAR = #{year} and r.month=#{month}
|
|
|
<if test="sceneIds != null and sceneIds.size()>0">
|
|
|
- and r.PARENT_SCENE_ID in
|
|
|
+ and p.PARENT_SCENE_ID in
|
|
|
<foreach collection="sceneIds" item="item" open="(" close=")" separator=",">
|
|
|
#{item}
|
|
|
</foreach>
|
|
@@ -312,10 +312,10 @@
|
|
|
left join sms_scene s on s.id=p.parent_scene_id
|
|
|
left join sms_device_attribute da ON da.id = p.ATTRIBUTE_ID
|
|
|
LEFT JOIN sms_device d ON d.id = r.DEVICE_ID
|
|
|
- WHERE p.`STATUS`= 1 and p.parm_type in (3,5)
|
|
|
+ WHERE p.`STATUS`= 1 and p.parm_type in (3,5) and d.ENABLE_STATE = 1
|
|
|
AND r.YEAR = #{year}
|
|
|
<if test="sceneIds != null and sceneIds.size()>0">
|
|
|
- and r.PARENT_SCENE_ID in
|
|
|
+ and p.PARENT_SCENE_ID in
|
|
|
<foreach collection="sceneIds" item="item" open="(" close=")" separator=",">
|
|
|
#{item}
|
|
|
</foreach>
|
|
@@ -370,10 +370,10 @@
|
|
|
left join sms_scene s on s.id=p.parent_scene_id
|
|
|
left join sms_device_attribute da ON da.id = p.ATTRIBUTE_ID
|
|
|
LEFT JOIN sms_device d ON d.id = r.DEVICE_ID
|
|
|
- WHERE p.`STATUS`= 1 and p.parm_type in (8,11,10)
|
|
|
+ WHERE p.`STATUS`= 1 and p.parm_type in (8,11,10) and d.ENABLE_STATE = 1
|
|
|
AND r.YEAR = #{year} and r.month=#{month} and r.day=#{day}
|
|
|
<if test="sceneIds != null and sceneIds.size()>0">
|
|
|
- and r.PARENT_SCENE_ID in
|
|
|
+ and p.PARENT_SCENE_ID in
|
|
|
<foreach collection="sceneIds" item="item" open="(" close=")" separator=",">
|
|
|
#{item}
|
|
|
</foreach>
|
|
@@ -426,10 +426,10 @@
|
|
|
left join sms_scene s on s.id=p.parent_scene_id
|
|
|
left join sms_device_attribute da ON da.id = p.ATTRIBUTE_ID
|
|
|
LEFT JOIN sms_device d ON d.id = r.DEVICE_ID
|
|
|
- WHERE p.`STATUS`= 1 and p.parm_type in (8,11,10)
|
|
|
+ WHERE p.`STATUS`= 1 and p.parm_type in (8,11,10) and d.ENABLE_STATE = 1
|
|
|
AND r.YEAR = #{year} and r.month=#{month}
|
|
|
<if test="sceneIds != null and sceneIds.size()>0">
|
|
|
- and r.PARENT_SCENE_ID in
|
|
|
+ and p.PARENT_SCENE_ID in
|
|
|
<foreach collection="sceneIds" item="item" open="(" close=")" separator=",">
|
|
|
#{item}
|
|
|
</foreach>
|
|
@@ -483,9 +483,9 @@
|
|
|
left join sms_device_attribute da ON da.id = p.ATTRIBUTE_ID
|
|
|
LEFT JOIN sms_device d ON d.id = r.DEVICE_ID
|
|
|
WHERE p.`STATUS`= 1 and p.parm_type in (8,11,10)
|
|
|
- AND r.YEAR = #{year}
|
|
|
+ AND r.YEAR = #{year} and d.ENABLE_STATE = 1
|
|
|
<if test="sceneIds != null and sceneIds.size()>0">
|
|
|
- and r.PARENT_SCENE_ID in
|
|
|
+ and p.PARENT_SCENE_ID in
|
|
|
<foreach collection="sceneIds" item="item" open="(" close=")" separator=",">
|
|
|
#{item}
|
|
|
</foreach>
|
|
@@ -551,7 +551,7 @@
|
|
|
from sms_alarm_details ad
|
|
|
left join sms_device d on ad.DEVICE_ID=d.ID
|
|
|
|
|
|
- where ad.ALARM_START_TIME < #{endDate} and ad.ALARM_START_TIME >= #{beginDate}
|
|
|
+ where ad.ALARM_START_TIME < #{endDate} and ad.ALARM_START_TIME >= #{beginDate} and d.ENABLE_STATE = 1
|
|
|
<if test="sceneIds != null and sceneIds.size()>0">
|
|
|
and ad.parent_scene_id in
|
|
|
<foreach collection="sceneIds" item="item" open="(" close=")" separator=",">
|