|
@@ -102,7 +102,7 @@
|
|
|
b.parent_scene_id as "parentSceneId",
|
|
|
c.SCENE_NAME as "parentSceneName"
|
|
|
FROM sms_month_report a
|
|
|
- inner join sms_device_parm b on a.DEVICE_ID = b.DEVICE_ID and a.ATTRIBUTE_ID=b.ATTRIBUTE_ID
|
|
|
+ inner join sms_device_parm b on a.DEVICE_ID = b.DEVICE_ID and a.ATTRIBUTE_ID=b.ATTRIBUTE_ID and b.`STATUS`=1
|
|
|
inner join sms_scene c on b.PARENT_SCENE_ID=c.id
|
|
|
<where>
|
|
|
b.IS_REPORT=1
|
|
@@ -131,7 +131,7 @@
|
|
|
INNER JOIN sms_device_attribute b on a.ATTRIBUTE_ID=b.ID
|
|
|
INNER JOIN sms_month_report c on a.ATTRIBUTE_ID=c.ATTRIBUTE_ID and a.DEVICE_ID=c.DEVICE_ID
|
|
|
where
|
|
|
- a.IS_REPORT=1
|
|
|
+ a.IS_REPORT=1 and a.`STATUS`=1
|
|
|
<if test="report.deviceIds != null and report.deviceIds.size() > 0">
|
|
|
and a.DEVICE_ID in
|
|
|
<foreach collection="report.deviceIds" item="dramaId" open="(" close=")" separator=",">
|
|
@@ -177,7 +177,7 @@
|
|
|
<if test="report.year != null ">and c.`YEAR`=#{report.year}</if>
|
|
|
<if test="report.month != null ">and c.`MONTH`=#{report.month}</if>
|
|
|
<if test="report.parentSceneId != null ">and c.PARENT_SCENE_ID=#{report.parentSceneId}</if>
|
|
|
- and (a.PARM_TYPE =3 or a.PARM_TYPE =4 or a.PARM_TYPE =5 or a.PARM_TYPE =6)) tab
|
|
|
+ and (a.PARM_TYPE =3 or a.PARM_TYPE =4 or a.PARM_TYPE =5 or a.PARM_TYPE =6) and a.`STATUS`=1) tab
|
|
|
group by tab.year,tab.month,tab.day
|
|
|
order by tab.year desc,tab.month desc,tab.day desc
|
|
|
</select>
|
|
@@ -191,7 +191,7 @@
|
|
|
a.COLLECT_DATE as "collectDate"
|
|
|
FROM sms_month_report a
|
|
|
inner join sms_device d on d.id = a.DEVICE_ID
|
|
|
- inner join sms_device_parm b on a.DEVICE_ID = b.DEVICE_ID and a.ATTRIBUTE_ID=b.ATTRIBUTE_ID
|
|
|
+ inner join sms_device_parm b on a.DEVICE_ID = b.DEVICE_ID and a.ATTRIBUTE_ID=b.ATTRIBUTE_ID and b.`STATUS`=1
|
|
|
<if test="monthReport.type == 1">
|
|
|
and b.PARM_TYPE = 13
|
|
|
</if>
|
|
@@ -200,7 +200,7 @@
|
|
|
</if>
|
|
|
<where>
|
|
|
<if test="monthReport.tenantId != null and monthReport.tenantId != ''">and a.tenant_id =
|
|
|
- #{dayReport.tenantId}
|
|
|
+ #{monthReport.tenantId}
|
|
|
</if>
|
|
|
<if test="monthReport.year != null ">and a.year = #{monthReport.year}</if>
|
|
|
<if test="monthReport.month != null ">and a.month = #{monthReport.month}</if>
|
|
@@ -238,7 +238,7 @@
|
|
|
a.year,a.month,a.day
|
|
|
FROM sms_month_report a
|
|
|
inner join sms_device d on d.id = a.DEVICE_ID
|
|
|
- inner join sms_device_parm b on a.DEVICE_ID = b.DEVICE_ID and a.ATTRIBUTE_ID=b.ATTRIBUTE_ID
|
|
|
+ inner join sms_device_parm b on a.DEVICE_ID = b.DEVICE_ID and a.ATTRIBUTE_ID=b.ATTRIBUTE_ID and b.`STATUS`=1
|
|
|
and (b.PARM_TYPE = 7 or b.PARM_TYPE = 10 or b.PARM_TYPE = 11)
|
|
|
<where>
|
|
|
<if test="monthReport.tenantId != null and monthReport.tenantId != ''">and a.tenant_id =
|