统计报表-收益报表:统一逻辑,电表尖、峰、平、谷差值直接乘以对应类型电价
This commit is contained in:
@ -232,4 +232,40 @@
|
||||
where t.site_id = #{siteId}
|
||||
order by t.data_date desc limit 1
|
||||
</select>
|
||||
|
||||
<select id="getRevenueDataBySiteId" resultType="com.xzzn.ems.domain.vo.AmmeterRevenueStatisListVo">
|
||||
select
|
||||
t.data_date as dataTime,
|
||||
t.peak_charge_diff * pc.peak as activePeakPrice,
|
||||
t.peak_discharge_diff * pc.peak as reActivePeakPrice,
|
||||
t.high_charge_diff * pc.high as activeHighPrice,
|
||||
t.high_discharge_diff * pc.high as reActiveHighPrice,
|
||||
t.flat_charge_diff * pc.flat as activeFlatPrice,
|
||||
t.flat_discharge_diff * pc.flat as reActiveFlatPrice,
|
||||
t.valley_charge_diff * pc.valley as activeValleyPrice,
|
||||
t.valley_discharge_diff * pc.valley as reActiveValleyPrice
|
||||
from ems_daily_energy_data t
|
||||
left join (
|
||||
select
|
||||
id, site_id, peak, high, flat, valley,
|
||||
CONCAT(year, '-', LPAD(month, 2, '0')) as yearMonth
|
||||
from ems_energy_price_config
|
||||
where 1=1
|
||||
<if test="siteId != null">
|
||||
and site_id = #{siteId}
|
||||
</if>
|
||||
order by year, month
|
||||
) pc on pc.yearMonth = DATE_FORMAT(t.data_date, '%Y-%m')
|
||||
where 1=1
|
||||
<if test="siteId != null">
|
||||
and t.site_id = #{siteId}
|
||||
</if>
|
||||
<if test="startTime != null">
|
||||
and t.data_date >= #{startTime}
|
||||
</if>
|
||||
<if test="endTime != null">
|
||||
and t.data_date <= #{endTime}
|
||||
</if>
|
||||
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user