|
@@ -100,10 +100,11 @@
|
|
|
a.month as "month" ,
|
|
|
a.day as "day" ,
|
|
|
a.hour as "hour" ,
|
|
|
- a.parent_scene_id as "parentSceneId",
|
|
|
- a.parent_scene_name as "parentSceneName"
|
|
|
+ b.parent_scene_id as "parentSceneId",
|
|
|
+ c.SCENE_NAME as "parentSceneName"
|
|
|
FROM sms_day_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_scene c on b.PARENT_SCENE_ID=c.id
|
|
|
<where>
|
|
|
b.IS_REPORT=1
|
|
|
<if test="dayReport.tenantId != null and dayReport.tenantId != ''">and a.tenant_id =
|
|
@@ -112,12 +113,12 @@
|
|
|
<if test="dayReport.year != null ">and a.year = #{dayReport.year}</if>
|
|
|
<if test="dayReport.month != null ">and a.month = #{dayReport.month}</if>
|
|
|
<if test="dayReport.day != null ">and a.day = #{dayReport.day}</if>
|
|
|
- and a.parent_scene_id in
|
|
|
+ and b.parent_scene_id in
|
|
|
<foreach collection="dayReport.parentSceneIds" item="dramaId" open="(" close=")" separator=",">
|
|
|
#{dramaId}
|
|
|
</foreach>
|
|
|
</where>
|
|
|
- order by a.parent_scene_id,a.year,a.month,a.day,a.hour
|
|
|
+ order by b.parent_scene_id,a.year,a.month,a.day,a.hour
|
|
|
</select>
|
|
|
<select id="findAttributeList" resultType="com.huaxu.dto.ReportAttributeDto">
|
|
|
SELECT tab.attributeName,tab.ATTRIBUTE_TYPE,min(tab.minValue) as "minValue",
|
|
@@ -143,7 +144,7 @@
|
|
|
<if test="report.month != null ">and c.`MONTH`=#{report.month}</if>
|
|
|
<if test="report.day != null ">and c.`DAY`=#{report.day}</if>
|
|
|
<if test="report.hour != null ">and c.`HOUR`=#{report.hour}</if>
|
|
|
- <if test="report.parentSceneId != null ">and c.PARENT_SCENE_ID=#{report.parentSceneId}</if>
|
|
|
+ <if test="report.parentSceneId != null ">and a.PARENT_SCENE_ID=#{report.parentSceneId}</if>
|
|
|
ORDER BY a.SEQ
|
|
|
) as tab
|
|
|
group by tab.attributeName,tab.ATTRIBUTE_TYPE
|
|
@@ -179,7 +180,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.day != null ">and c.`DAY`=#{report.day}</if>
|
|
|
- <if test="report.parentSceneId != null ">and c.PARENT_SCENE_ID=#{report.parentSceneId}</if>
|
|
|
+ <if test="report.parentSceneId != null ">and a.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
|
|
|
group by tab.year,tab.month,tab.day,tab.HOUR
|
|
|
order by tab.year desc,tab.month desc,tab.day desc,tab.hour desc
|