节能减排

This commit is contained in:
jiang 2025-07-24 21:33:47 +08:00
parent 9499c91f60
commit 82a4cdcab9
1 changed files with 3 additions and 4 deletions

View File

@ -8,10 +8,9 @@
<select id="selectEnergyStatsByDateRange" resultType="com.securitycontrol.screen.domain.DeviceEnergyAnalysis">
SELECT DATE(stat_date) AS statDate, -- 截断为日期(去掉小时)
SUM(consumption_kwh) AS consumptionKwh,
SUM(renewable_used_kwh * 0.997) AS renewableUsedKwh
SUM(renewable_used_kwh * 0.9) AS renewableUsedKwh
FROM device_energy_analysis
WHERE stat_date >= #{startDate}
AND stat_date &lt; DATE_ADD(#{endDate}, INTERVAL 1 DAY)
WHERE stat_date BETWEEN #{startDate} AND #{endDate}
and pro_id = #{proId}
GROUP BY DATE(stat_date)
ORDER BY statDate ASC
@ -20,7 +19,7 @@
<select id="selectDeviceEnergyByDateRange" resultType="com.securitycontrol.screen.domain.DeviceEnergyAnalysis">
SELECT device_name AS deviceName,
SUM(consumption_kwh) AS consumptionKwh,
SUM(renewable_used_kwh * 0.997) AS renewableUsedKwh
SUM(renewable_used_kwh * 0.9) AS renewableUsedKwh
FROM device_energy_analysis
WHERE stat_date BETWEEN #{startDate} AND #{endDate}
and pro_id = #{proId}