节能减排
This commit is contained in:
parent
9499c91f60
commit
82a4cdcab9
|
|
@ -8,10 +8,9 @@
|
||||||
<select id="selectEnergyStatsByDateRange" resultType="com.securitycontrol.screen.domain.DeviceEnergyAnalysis">
|
<select id="selectEnergyStatsByDateRange" resultType="com.securitycontrol.screen.domain.DeviceEnergyAnalysis">
|
||||||
SELECT DATE(stat_date) AS statDate, -- 截断为日期(去掉小时)
|
SELECT DATE(stat_date) AS statDate, -- 截断为日期(去掉小时)
|
||||||
SUM(consumption_kwh) AS consumptionKwh,
|
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
|
FROM device_energy_analysis
|
||||||
WHERE stat_date >= #{startDate}
|
WHERE stat_date BETWEEN #{startDate} AND #{endDate}
|
||||||
AND stat_date < DATE_ADD(#{endDate}, INTERVAL 1 DAY)
|
|
||||||
and pro_id = #{proId}
|
and pro_id = #{proId}
|
||||||
GROUP BY DATE(stat_date)
|
GROUP BY DATE(stat_date)
|
||||||
ORDER BY statDate ASC
|
ORDER BY statDate ASC
|
||||||
|
|
@ -20,7 +19,7 @@
|
||||||
<select id="selectDeviceEnergyByDateRange" resultType="com.securitycontrol.screen.domain.DeviceEnergyAnalysis">
|
<select id="selectDeviceEnergyByDateRange" resultType="com.securitycontrol.screen.domain.DeviceEnergyAnalysis">
|
||||||
SELECT device_name AS deviceName,
|
SELECT device_name AS deviceName,
|
||||||
SUM(consumption_kwh) AS consumptionKwh,
|
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
|
FROM device_energy_analysis
|
||||||
WHERE stat_date BETWEEN #{startDate} AND #{endDate}
|
WHERE stat_date BETWEEN #{startDate} AND #{endDate}
|
||||||
and pro_id = #{proId}
|
and pro_id = #{proId}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue