|
@@ -1,59 +1,71 @@
|
|
|
<?xml version="1.0" encoding="UTF-8" ?>
|
|
|
<!DOCTYPE mapper
|
|
|
-PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
-"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
+ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
+ "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="com.ruoyi.ems.mapper.PvSupplyHMapper">
|
|
|
<resultMap type="com.ruoyi.ems.domain.PvSupplyH" id="PvSupplyHResult">
|
|
|
- <result property="id" column="id" />
|
|
|
- <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="facsName" column="facs_name" />
|
|
|
- <result property="date" column="date" jdbcType="DATE" />
|
|
|
- <result property="time" column="time" />
|
|
|
- <result property="timeIndex" column="time_index" />
|
|
|
- <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" />
|
|
|
+ <result property="id" column="id"/>
|
|
|
+ <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="facsName" column="facs_name"/>
|
|
|
+ <result property="date" column="date" jdbcType="DATE"/>
|
|
|
+ <result property="time" column="time"/>
|
|
|
+ <result property="timeIndex" column="time_index"/>
|
|
|
+ <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>
|
|
|
|
|
|
<sql id="selectPvSupplyHVo">
|
|
|
- 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
|
|
|
+ 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`
|
|
|
+ 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>
|
|
|
|
|
|
<select id="selectPvSupplyHList" parameterType="com.ruoyi.ems.domain.PvSupplyH" resultMap="PvSupplyHResult">
|
|
|
<include refid="selectPvSupplyHVo"/>
|
|
|
<where>
|
|
|
- <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>
|
|
|
+ <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>
|
|
|
</select>
|
|
|
|
|
|
<select id="selectAreaSupplyH" parameterType="com.ruoyi.ems.domain.PvSupplyH" resultMap="PvSupplyHResult">
|
|
|
- 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
|
|
|
- adm_ems_pv_supply_h
|
|
|
- WHERE
|
|
|
- area_code = #{areaCode}
|
|
|
+ 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 adm_ems_pv_supply_h
|
|
|
+ WHERE area_code = #{areaCode}
|
|
|
AND DATE = #{date,jdbcType=DATE}
|
|
|
GROUP BY
|
|
|
area_code,
|
|
@@ -62,12 +74,43 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
time_index ASC
|
|
|
</select>
|
|
|
|
|
|
+ <select id="selectAreaSupplyByDate" resultType="Map">
|
|
|
+ SELECT area_code,
|
|
|
+ DATE_FORMAT(date, '%Y-%m-%d') AS dateIndex,
|
|
|
+ SUM(gen_elec_quantity) as genElecQuantity,
|
|
|
+ SUM(use_elec_quantity) as useElecQuantity,
|
|
|
+ SUM(up_elec_quantity) as upElecQuantity,
|
|
|
+ SUM(up_elec_earn) as upElecEarn
|
|
|
+ FROM adm_ems_pv_supply_h
|
|
|
+ WHERE area_code = #{areaCode}
|
|
|
+ AND DATE >= #{date}
|
|
|
+ GROUP BY
|
|
|
+ area_code,
|
|
|
+ dateIndex
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectAreaSupplyByThisYear" resultType="Map">
|
|
|
+ SELECT area_code,
|
|
|
+ DATE_FORMAT(date, '%Y') AS dateIndex,
|
|
|
+ SUM(gen_elec_quantity) as genElecQuantity,
|
|
|
+ SUM(use_elec_quantity) as useElecQuantity,
|
|
|
+ SUM(up_elec_quantity) as upElecQuantity,
|
|
|
+ SUM(up_elec_earn) as upElecEarn
|
|
|
+ FROM adm_ems_pv_supply_h
|
|
|
+ WHERE area_code = #{areaCode}
|
|
|
+ AND DATE >= #{date}
|
|
|
+ GROUP BY
|
|
|
+ area_code,
|
|
|
+ dateIndex
|
|
|
+ </select>
|
|
|
+
|
|
|
<select id="selectPvSupplyHById" parameterType="Long" resultMap="PvSupplyHResult">
|
|
|
<include refid="selectPvSupplyHVo"/>
|
|
|
where id = #{id}
|
|
|
</select>
|
|
|
|
|
|
- <insert id="insertPvSupplyH" parameterType="com.ruoyi.ems.domain.PvSupplyH" useGeneratedKeys="true" keyProperty="id">
|
|
|
+ <insert id="insertPvSupplyH" parameterType="com.ruoyi.ems.domain.PvSupplyH" useGeneratedKeys="true"
|
|
|
+ keyProperty="id">
|
|
|
insert into adm_ems_pv_supply_h
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
<if test="areaCode != null and areaCode != ''">area_code,</if>
|
|
@@ -80,7 +123,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<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=",">
|
|
|
<if test="areaCode != null and areaCode != ''">#{areaCode},</if>
|
|
|
<if test="facsCode != null and facsCode != ''">#{facsCode},</if>
|
|
@@ -92,7 +135,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="useElecQuantity != null">#{useElecQuantity},</if>
|
|
|
<if test="upElecQuantity != null">#{upElecQuantity},</if>
|
|
|
<if test="upElecEarn != null">#{upElecEarn},</if>
|
|
|
- </trim>
|
|
|
+ </trim>
|
|
|
</insert>
|
|
|
|
|
|
<update id="updatePvSupplyH" parameterType="com.ruoyi.ems.domain.PvSupplyH">
|
|
@@ -113,7 +156,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</update>
|
|
|
|
|
|
<delete id="deletePvSupplyHById" parameterType="Long">
|
|
|
- delete from adm_ems_pv_supply_h where id = #{id}
|
|
|
+ delete
|
|
|
+ from adm_ems_pv_supply_h
|
|
|
+ where id = #{id}
|
|
|
</delete>
|
|
|
|
|
|
<delete id="deletePvSupplyHByIds" parameterType="String">
|