节能减排
This commit is contained in:
parent
837774b1b5
commit
9f56f77857
|
|
@ -6,14 +6,15 @@
|
|||
<mapper namespace="com.securitycontrol.screen.mapper.DeviceEnergyAnalysisMapper">
|
||||
|
||||
<select id="selectEnergyStatsByDateRange" resultType="com.securitycontrol.screen.domain.DeviceEnergyAnalysis">
|
||||
SELECT stat_date AS statDate,
|
||||
SUM(consumption_kwh) AS consumptionKwh,
|
||||
SUM(renewable_used_kwh) AS renewableUsedKwh
|
||||
SELECT DATE(stat_date) AS statDate, -- 截断为日期(去掉小时)
|
||||
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}
|
||||
GROUP BY stat_date
|
||||
ORDER BY stat_date ASC
|
||||
WHERE stat_date >= #{startDate}
|
||||
AND stat_date < DATE_ADD(#{endDate}, INTERVAL 1 DAY)
|
||||
and pro_id = #{proId}
|
||||
GROUP BY DATE(stat_date)
|
||||
ORDER BY statDate ASC
|
||||
</select>
|
||||
|
||||
<select id="selectDeviceEnergyByDateRange" resultType="com.securitycontrol.screen.domain.DeviceEnergyAnalysis">
|
||||
|
|
@ -63,12 +64,11 @@
|
|||
pro_id
|
||||
FROM energy_saving_measures
|
||||
WHERE pro_id = #{proId}
|
||||
AND stat_date BETWEEN #{startDate} AND #{endDate}
|
||||
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}
|
||||
AND esm.stat_date BETWEEN #{startDate} AND #{endDate};
|
||||
ORDER BY esm.coverage_rate DESC
|
||||
|
||||
</select>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue