实时运行逻辑

This commit is contained in:
2025-07-07 15:00:59 +08:00
parent 733afa99bd
commit b2a964cb82
4 changed files with 66 additions and 9 deletions

View File

@ -373,7 +373,7 @@
</select>
<select id="getPcsDataByDay" resultType="com.xzzn.ems.domain.vo.SiteMonitorDataVo">
select CONCAT(t.date_month,'/',t.date_day) as ammeterDate,
select DATE(latest.max_update_time) as ammeterDate,
sum(t.total_ac_charge_energy) as chargedCap,
sum(t.total_ac_discharge_energy) as disChargedCap
from ( SELECT p.site_id, p.device_id,p.date_month,p.date_day, MAX(p.data_update_time) AS max_update_time
@ -453,7 +453,7 @@
</select>
<select id="getPcsDataByMonth" resultType="com.xzzn.ems.domain.vo.SiteMonitorDataVo">
select t.date_month as ammeterDate,
select DATE_FORMAT(latest.max_update_time, '%Y-%m') as ammeterDate,
sum(t.total_ac_charge_energy) as chargedCap,
sum(t.total_ac_discharge_energy) as disChargedCap
from ( SELECT p.site_id, p.device_id,p.date_month,MAX(p.data_update_time) AS max_update_time
@ -478,7 +478,7 @@
select latest.dateHour as ammeterDate,
sum(t.total_ac_charge_energy) as chargedCap,
sum(t.total_ac_discharge_energy) as disChargedCap
from ( SELECT p.site_id, p.device_id,DATE_FORMAT(p.data_update_time, '%H') AS dateHour,MAX(p.data_update_time) as max_update_time
from ( SELECT p.site_id, p.device_id,DATE_FORMAT(p.data_update_time, '%H')+1 AS dateHour,MAX(p.data_update_time) as max_update_time
FROM ems_pcs_data p
where p.site_id = #{siteId}
<if test="startDate != null">