|
@@ -189,6 +189,30 @@
|
|
|
</where>
|
|
|
</select>
|
|
|
|
|
|
+ <select id="calMonthPvByDateRange" parameterType="com.ruoyi.ems.model.QueryMeter" resultType="ElecPvSupplyH">
|
|
|
+ SELECT
|
|
|
+ sum(
|
|
|
+ COALESCE(CAST(gen_elec_quantity AS DECIMAL(10, 2)), 0)) gen_elec_quantity,
|
|
|
+ sum(
|
|
|
+ COALESCE(CAST(use_elec_quantity AS DECIMAL(10, 2)), 0)) use_elec_quantity,
|
|
|
+ sum(
|
|
|
+ COALESCE(CAST(up_elec_quantity AS DECIMAL(10, 2)), 0)) up_elec_quantity,
|
|
|
+ sum(
|
|
|
+ COALESCE(CAST(up_elec_earn AS DECIMAL(10, 2)), 0)) up_elec_earn,
|
|
|
+ sum(
|
|
|
+ COALESCE(CAST(use_elec_quantity AS DECIMAL(10, 2)), 0)) use_elec_quantity,
|
|
|
+ DATE_FORMAT(date, '%Y-%m') AS startRecTime
|
|
|
+ FROM adm_ems_pv_supply_h pv
|
|
|
+ <where>
|
|
|
+ <if test="startRecTime != null and startRecTime != ''">and DATE >=#{startRecTime}</if>
|
|
|
+ <if test="endRecTime != null and endRecTime != ''">and DATE <![CDATA[ <= ]]>#{endRecTime}</if>
|
|
|
+ <if test="areaCode != null and areaCode != '' and areaCode != '-1'">
|
|
|
+ and pv.area_code = #{areaCode}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ group by startRecTime
|
|
|
+ </select>
|
|
|
+
|
|
|
<select id="calHourPvRange" parameterType="com.ruoyi.ems.model.QueryMeter" resultMap="PvSupplyHResult">
|
|
|
SELECT
|
|
|
sum(
|