概率统计-电量指标默认7天

This commit is contained in:
2025-07-01 21:21:55 +08:00
parent ed025d2750
commit 259784f525
3 changed files with 18 additions and 3 deletions

View File

@ -379,8 +379,10 @@
from ( SELECT p.site_id, p.device_id,p.date_month,p.date_day, MAX(p.data_update_time) AS max_update_time
FROM ems_pcs_data p
where p.site_id = #{siteId}
<if test="startDate != null and endDate != null">
<if test="startDate != null">
and p.data_update_time &gt;= #{startDate}
</if>
<if test="endDate != null">
and p.data_update_time &lt; DATE_ADD(#{endDate}, INTERVAL 1 DAY)
</if>
GROUP BY p.site_id,p.device_id,p.date_month,p.date_day