节能减排
This commit is contained in:
parent
cdd004e235
commit
d6e4f79177
|
|
@ -19,7 +19,8 @@
|
|||
|
||||
<select id="selectDeviceEnergyByDateRange" resultType="com.securitycontrol.screen.domain.DeviceEnergyAnalysis">
|
||||
SELECT device_name AS deviceName,
|
||||
SUM(consumption_kwh) AS consumptionKwh
|
||||
SUM(consumption_kwh) AS consumptionKwh,
|
||||
SUM(renewable_used_kwh * 0.997) AS renewableUsedKwh
|
||||
FROM device_energy_analysis
|
||||
WHERE stat_date BETWEEN #{startDate} AND #{endDate}
|
||||
and pro_id = #{proId}
|
||||
|
|
@ -53,26 +54,4 @@
|
|||
|
||||
</select>
|
||||
|
||||
<select id="selectLatestAll" resultType="com.securitycontrol.screen.domain.EnergySavingMeasure">
|
||||
SELECT esm.id AS id,
|
||||
esm.measure_name AS measureName,
|
||||
esm.coverage_rate AS coverageRate,
|
||||
esm.stat_date AS statDate
|
||||
FROM energy_saving_measures esm
|
||||
INNER JOIN (SELECT measure_name,
|
||||
MAX(stat_date) AS max_date,
|
||||
pro_id
|
||||
FROM energy_saving_measures
|
||||
WHERE pro_id = #{proId}
|
||||
GROUP BY measure_name, pro_id) t ON esm.measure_name = t.measure_name
|
||||
AND esm.stat_date = t.max_date
|
||||
AND esm.pro_id = t.pro_id
|
||||
WHERE esm.pro_id = #{proId}
|
||||
ORDER BY esm.coverage_rate DESC
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
|
||||
</mapper>
|
||||
|
|
|
|||
Loading…
Reference in New Issue