|
@@ -6,38 +6,50 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
<resultMap type="com.ruoyi.ems.domain.PvSupplyH" id="PvSupplyHResult">
|
|
<resultMap type="com.ruoyi.ems.domain.PvSupplyH" id="PvSupplyHResult">
|
|
<result property="id" column="id" />
|
|
<result property="id" column="id" />
|
|
<result property="areaCode" column="area_code" />
|
|
<result property="areaCode" column="area_code" />
|
|
|
|
+ <result property="areaName" column="area_name" />
|
|
|
|
+ <result property="areaShortName" column="area_short_name" />
|
|
<result property="facsCode" column="facs_code" />
|
|
<result property="facsCode" column="facs_code" />
|
|
|
|
+ <result property="facsName" column="facs_name" />
|
|
<result property="date" column="date" jdbcType="DATE" />
|
|
<result property="date" column="date" jdbcType="DATE" />
|
|
<result property="time" column="time" />
|
|
<result property="time" column="time" />
|
|
<result property="timeIndex" column="time_index" />
|
|
<result property="timeIndex" column="time_index" />
|
|
- <result property="meterType" column="meter_type" />
|
|
|
|
- <result property="meterUnitPrice" column="meter_unit_price" />
|
|
|
|
- <result property="elecReading" column="elec_reading" />
|
|
|
|
- <result property="elecQuantity" column="elec_quantity" />
|
|
|
|
- <result property="elecEarn" column="elec_earn" />
|
|
|
|
|
|
+ <result property="upUnitPrice" column="up_unit_price" />
|
|
|
|
+ <result property="genElecQuantity" column="gen_elec_quantity" />
|
|
|
|
+ <result property="useElecQuantity" column="use_elec_quantity" />
|
|
|
|
+ <result property="upElecQuantity" column="up_elec_quantity" />
|
|
|
|
+ <result property="upElecEarn" column="up_elec_earn" />
|
|
</resultMap>
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectPvSupplyHVo">
|
|
<sql id="selectPvSupplyHVo">
|
|
- select id, area_code, facs_code, date, time, time_index, meter_type, meter_unit_price, elec_reading, elec_quantity, elec_earn from adm_ems_pv_supply_h
|
|
|
|
|
|
+ select
|
|
|
|
+ pv.id, pv.area_code, a.area_name, a.short_name as area_short_name, pv.facs_code, f.facs_name, pv.`date`, pv.`time`, pv.time_index, pv.up_unit_price, pv.gen_elec_quantity, pv.use_elec_quantity, pv.up_elec_quantity, pv.up_elec_earn
|
|
|
|
+ from adm_ems_pv_supply_h pv
|
|
|
|
+ LEFT JOIN adm_service_area a ON pv.`area_code` = a.`area_code`
|
|
|
|
+ LEFT JOIN adm_ems_facs f ON pv.`facs_code` = f.`facs_code`
|
|
</sql>
|
|
</sql>
|
|
|
|
|
|
<select id="selectPvSupplyHList" parameterType="com.ruoyi.ems.domain.PvSupplyH" resultMap="PvSupplyHResult">
|
|
<select id="selectPvSupplyHList" parameterType="com.ruoyi.ems.domain.PvSupplyH" resultMap="PvSupplyHResult">
|
|
<include refid="selectPvSupplyHVo"/>
|
|
<include refid="selectPvSupplyHVo"/>
|
|
<where>
|
|
<where>
|
|
- <if test="areaCode != null and areaCode != ''"> and area_code = #{areaCode}</if>
|
|
|
|
- <if test="facsCode != null and facsCode != ''"> and facs_code = #{facsCode}</if>
|
|
|
|
- <if test="date != null "> and date = #{date}</if>
|
|
|
|
- <if test="time != null "> and time = #{time}</if>
|
|
|
|
- <if test="timeIndex != null "> and time_index = #{timeIndex}</if>
|
|
|
|
- <if test="meterType != null "> and meter_type = #{meterType}</if>
|
|
|
|
- <if test="meterUnitPrice != null "> and meter_unit_price = #{meterUnitPrice}</if>
|
|
|
|
- <if test="elecReading != null "> and elec_reading = #{elecReading}</if>
|
|
|
|
- <if test="elecQuantity != null "> and elec_quantity = #{elecQuantity}</if>
|
|
|
|
- <if test="elecEarn != null "> and elec_earn = #{elecEarn}</if>
|
|
|
|
|
|
+ <if test="areaCode != null and areaCode != ''"> and pv.area_code = #{areaCode}</if>
|
|
|
|
+ <if test="facsCode != null and facsCode != ''"> and pv.facs_code = #{facsCode}</if>
|
|
|
|
+ <if test="date != null "> and pv.`date` = #{date}</if>
|
|
|
|
+ <if test="time != null "> and pv.`time` = #{time}</if>
|
|
|
|
+ <if test="timeIndex != null "> and pv.time_index = #{timeIndex}</if>
|
|
|
|
+ <if test="upUnitPrice != null "> and pv.up_unit_price = #{upUnitPrice}</if>
|
|
|
|
+ <if test="genElecQuantity != null "> and pv.gen_elec_quantity = #{genElecQuantity}</if>
|
|
|
|
+ <if test="useElecQuantity != null "> and pv.use_elec_quantity = #{useElecQuantity}</if>
|
|
|
|
+ <if test="upElecQuantity != null "> and pv.up_elec_quantity = #{upElecQuantity}</if>
|
|
|
|
+ <if test="upElecEarn != null "> and pv.up_elec_earn = #{upElecEarn}</if>
|
|
</where>
|
|
</where>
|
|
</select>
|
|
</select>
|
|
|
|
+
|
|
<select id="selectAreaSupplyH" parameterType="com.ruoyi.ems.domain.PvSupplyH" resultMap="PvSupplyHResult">
|
|
<select id="selectAreaSupplyH" parameterType="com.ruoyi.ems.domain.PvSupplyH" resultMap="PvSupplyHResult">
|
|
- SELECT area_code, DATE, time_index, SUM( elec_quantity ) elec_quantity
|
|
|
|
|
|
+ SELECT area_code, `date`, time_index,
|
|
|
|
+ SUM( gen_elec_quantity ) as gen_elec_quantity,
|
|
|
|
+ SUM( use_elec_quantity ) as use_elec_quantity,
|
|
|
|
+ SUM( up_elec_quantity ) as up_elec_quantity,
|
|
|
|
+ SUM( up_elec_earn ) as up_elec_earn
|
|
FROM
|
|
FROM
|
|
adm_ems_pv_supply_h
|
|
adm_ems_pv_supply_h
|
|
WHERE
|
|
WHERE
|
|
@@ -60,14 +72,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="areaCode != null and areaCode != ''">area_code,</if>
|
|
<if test="areaCode != null and areaCode != ''">area_code,</if>
|
|
<if test="facsCode != null and facsCode != ''">facs_code,</if>
|
|
<if test="facsCode != null and facsCode != ''">facs_code,</if>
|
|
- <if test="date != null">date,</if>
|
|
|
|
- <if test="time != null">time,</if>
|
|
|
|
|
|
+ <if test="date != null">`date`,</if>
|
|
|
|
+ <if test="time != null">`time`,</if>
|
|
<if test="timeIndex != null">time_index,</if>
|
|
<if test="timeIndex != null">time_index,</if>
|
|
- <if test="meterType != null">meter_type,</if>
|
|
|
|
- <if test="meterUnitPrice != null">meter_unit_price,</if>
|
|
|
|
- <if test="elecReading != null">elec_reading,</if>
|
|
|
|
- <if test="elecQuantity != null">elec_quantity,</if>
|
|
|
|
- <if test="elecEarn != null">elec_earn,</if>
|
|
|
|
|
|
+ <if test="upUnitPrice != null">up_unit_price,</if>
|
|
|
|
+ <if test="genElecQuantity != null">gen_elec_quantity,</if>
|
|
|
|
+ <if test="useElecQuantity != null">use_elec_quantity,</if>
|
|
|
|
+ <if test="upElecQuantity != null">up_elec_quantity,</if>
|
|
|
|
+ <if test="upElecEarn != null">up_elec_earn,</if>
|
|
</trim>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="areaCode != null and areaCode != ''">#{areaCode},</if>
|
|
<if test="areaCode != null and areaCode != ''">#{areaCode},</if>
|
|
@@ -75,11 +87,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
<if test="date != null">#{date},</if>
|
|
<if test="date != null">#{date},</if>
|
|
<if test="time != null">#{time},</if>
|
|
<if test="time != null">#{time},</if>
|
|
<if test="timeIndex != null">#{timeIndex},</if>
|
|
<if test="timeIndex != null">#{timeIndex},</if>
|
|
- <if test="meterType != null">#{meterType},</if>
|
|
|
|
- <if test="meterUnitPrice != null">#{meterUnitPrice},</if>
|
|
|
|
- <if test="elecReading != null">#{elecReading},</if>
|
|
|
|
- <if test="elecQuantity != null">#{elecQuantity},</if>
|
|
|
|
- <if test="elecEarn != null">#{elecEarn},</if>
|
|
|
|
|
|
+ <if test="upUnitPrice != null">#{upUnitPrice},</if>
|
|
|
|
+ <if test="genElecQuantity != null">#{genElecQuantity},</if>
|
|
|
|
+ <if test="useElecQuantity != null">#{useElecQuantity},</if>
|
|
|
|
+ <if test="upElecQuantity != null">#{upElecQuantity},</if>
|
|
|
|
+ <if test="upElecEarn != null">#{upElecEarn},</if>
|
|
</trim>
|
|
</trim>
|
|
</insert>
|
|
</insert>
|
|
|
|
|
|
@@ -91,11 +103,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
<if test="date != null">date = #{date},</if>
|
|
<if test="date != null">date = #{date},</if>
|
|
<if test="time != null">time = #{time},</if>
|
|
<if test="time != null">time = #{time},</if>
|
|
<if test="timeIndex != null">time_index = #{timeIndex},</if>
|
|
<if test="timeIndex != null">time_index = #{timeIndex},</if>
|
|
- <if test="meterType != null">meter_type = #{meterType},</if>
|
|
|
|
- <if test="meterUnitPrice != null">meter_unit_price = #{meterUnitPrice},</if>
|
|
|
|
- <if test="elecReading != null">elec_reading = #{elecReading},</if>
|
|
|
|
- <if test="elecQuantity != null">elec_quantity = #{elecQuantity},</if>
|
|
|
|
- <if test="elecEarn != null">elec_earn = #{elecEarn},</if>
|
|
|
|
|
|
+ <if test="upUnitPrice != null">up_unit_price = #{upUnitPrice},</if>
|
|
|
|
+ <if test="genElecQuantity != null">gen_elec_quantity = #{genElecQuantity},</if>
|
|
|
|
+ <if test="useElecQuantity != null">use_elec_quantity = #{useElecQuantity},</if>
|
|
|
|
+ <if test="upElecQuantity != null">up_elec_quantity = #{upElecQuantity},</if>
|
|
|
|
+ <if test="upElecEarn != null">up_elec_earn = #{upElecEarn},</if>
|
|
</trim>
|
|
</trim>
|
|
where id = #{id}
|
|
where id = #{id}
|
|
</update>
|
|
</update>
|