节能减排
This commit is contained in:
parent
9499c91f60
commit
82a4cdcab9
|
|
@ -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 < 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}
|
||||
|
|
|
|||
Loading…
Reference in New Issue