|
@@ -104,7 +104,7 @@
|
|
|
INNER JOIN sms_day_report c on a.ATTRIBUTE_ID=c.ATTRIBUTE_ID and a.DEVICE_ID=c.DEVICE_ID
|
|
|
INNER JOIN (select b.PARM_TYPE,max(d.collect_date) collect_date
|
|
|
from sms_day_report d
|
|
|
- INNER JOIN sms_device_parm b on d.ATTRIBUTE_ID=b.ID
|
|
|
+ INNER JOIN sms_device_parm b on d.ATTRIBUTE_ID=b.ID and b.`STATUS`=1
|
|
|
where d.DEVICE_ID = #{report.deviceId}
|
|
|
<if test="report.year != null ">and d.`YEAR`=#{report.year}</if>
|
|
|
<if test="report.month != null ">and d.`MONTH`=#{report.month}</if>
|
|
@@ -112,7 +112,7 @@
|
|
|
and (b.PARM_TYPE =3 or b.PARM_TYPE =4 or b.PARM_TYPE =5 or b.PARM_TYPE =6)
|
|
|
GROUP BY b.PARM_TYPE) as tab on a.PARM_TYPE=tab.PARM_TYPE and c.collect_date=tab.collect_date
|
|
|
where
|
|
|
- a.DEVICE_ID = #{report.deviceId}
|
|
|
+ a.DEVICE_ID = #{report.deviceId} and a.`STATUS`=1
|
|
|
<if test="report.sceneId != null ">and a.PARENT_SCENE_ID = #{report.sceneId}</if>
|
|
|
<if test="report.year != null ">and c.`YEAR`=#{report.year}</if>
|
|
|
<if test="report.month != null ">and c.`MONTH`=#{report.month}</if>
|