|
@@ -0,0 +1,101 @@
|
|
|
+<?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">
|
|
|
+<mapper namespace="com.jjt.elec.mapper.ElecPeriodMapper">
|
|
|
+
|
|
|
+ <resultMap type="ElecPeriod" id="ElecPeriodResult">
|
|
|
+ <result property="periodId" column="PERIOD_ID" />
|
|
|
+ <result property="saMonths" column="SA_MONTHS" />
|
|
|
+ <result property="swMonths" column="SW_MONTHS" />
|
|
|
+ <result property="saPeak" column="SA_PEAK" />
|
|
|
+ <result property="saValley" column="SA_VALLEY" />
|
|
|
+ <result property="saFlat" column="SA_FLAT" />
|
|
|
+ <result property="saSuperPeak" column="SA_SUPER_PEAK" />
|
|
|
+ <result property="swPeak" column="SW_PEAK" />
|
|
|
+ <result property="swValley" column="SW_VALLEY" />
|
|
|
+ <result property="swFlat" column="SW_FLAT" />
|
|
|
+ <result property="swSuperPeak" column="SW_SUPER_PEAK" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectElecPeriodVo">
|
|
|
+ select PERIOD_ID, SA_MONTHS, SW_MONTHS, SA_PEAK, SA_VALLEY, SA_FLAT, SA_SUPER_PEAK, SW_PEAK, SW_VALLEY, SW_FLAT, SW_SUPER_PEAK from ELEC_PERIOD
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectElecPeriodList" parameterType="ElecPeriod" resultMap="ElecPeriodResult">
|
|
|
+ <include refid="selectElecPeriodVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="saMonths != null and saMonths != ''"> and SA_MONTHS = #{saMonths}</if>
|
|
|
+ <if test="swMonths != null and swMonths != ''"> and SW_MONTHS = #{swMonths}</if>
|
|
|
+ <if test="saPeak != null and saPeak != ''"> and SA_PEAK = #{saPeak}</if>
|
|
|
+ <if test="saValley != null and saValley != ''"> and SA_VALLEY = #{saValley}</if>
|
|
|
+ <if test="saFlat != null and saFlat != ''"> and SA_FLAT = #{saFlat}</if>
|
|
|
+ <if test="saSuperPeak != null and saSuperPeak != ''"> and SA_SUPER_PEAK = #{saSuperPeak}</if>
|
|
|
+ <if test="swPeak != null and swPeak != ''"> and SW_PEAK = #{swPeak}</if>
|
|
|
+ <if test="swValley != null and swValley != ''"> and SW_VALLEY = #{swValley}</if>
|
|
|
+ <if test="swFlat != null and swFlat != ''"> and SW_FLAT = #{swFlat}</if>
|
|
|
+ <if test="swSuperPeak != null and swSuperPeak != ''"> and SW_SUPER_PEAK = #{swSuperPeak}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectElecPeriodByPeriodId" parameterType="Long" resultMap="ElecPeriodResult">
|
|
|
+ <include refid="selectElecPeriodVo"/>
|
|
|
+ where PERIOD_ID = #{periodId}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertElecPeriod" parameterType="ElecPeriod" useGeneratedKeys="true" keyProperty="periodId">
|
|
|
+ insert into ELEC_PERIOD
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="saMonths != null">SA_MONTHS,</if>
|
|
|
+ <if test="swMonths != null">SW_MONTHS,</if>
|
|
|
+ <if test="saPeak != null">SA_PEAK,</if>
|
|
|
+ <if test="saValley != null">SA_VALLEY,</if>
|
|
|
+ <if test="saFlat != null">SA_FLAT,</if>
|
|
|
+ <if test="saSuperPeak != null">SA_SUPER_PEAK,</if>
|
|
|
+ <if test="swPeak != null">SW_PEAK,</if>
|
|
|
+ <if test="swValley != null">SW_VALLEY,</if>
|
|
|
+ <if test="swFlat != null">SW_FLAT,</if>
|
|
|
+ <if test="swSuperPeak != null">SW_SUPER_PEAK,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="saMonths != null">#{saMonths},</if>
|
|
|
+ <if test="swMonths != null">#{swMonths},</if>
|
|
|
+ <if test="saPeak != null">#{saPeak},</if>
|
|
|
+ <if test="saValley != null">#{saValley},</if>
|
|
|
+ <if test="saFlat != null">#{saFlat},</if>
|
|
|
+ <if test="saSuperPeak != null">#{saSuperPeak},</if>
|
|
|
+ <if test="swPeak != null">#{swPeak},</if>
|
|
|
+ <if test="swValley != null">#{swValley},</if>
|
|
|
+ <if test="swFlat != null">#{swFlat},</if>
|
|
|
+ <if test="swSuperPeak != null">#{swSuperPeak},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateElecPeriod" parameterType="ElecPeriod">
|
|
|
+ update ELEC_PERIOD
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="saMonths != null">SA_MONTHS = #{saMonths},</if>
|
|
|
+ <if test="swMonths != null">SW_MONTHS = #{swMonths},</if>
|
|
|
+ <if test="saPeak != null">SA_PEAK = #{saPeak},</if>
|
|
|
+ <if test="saValley != null">SA_VALLEY = #{saValley},</if>
|
|
|
+ <if test="saFlat != null">SA_FLAT = #{saFlat},</if>
|
|
|
+ <if test="saSuperPeak != null">SA_SUPER_PEAK = #{saSuperPeak},</if>
|
|
|
+ <if test="swPeak != null">SW_PEAK = #{swPeak},</if>
|
|
|
+ <if test="swValley != null">SW_VALLEY = #{swValley},</if>
|
|
|
+ <if test="swFlat != null">SW_FLAT = #{swFlat},</if>
|
|
|
+ <if test="swSuperPeak != null">SW_SUPER_PEAK = #{swSuperPeak},</if>
|
|
|
+ </trim>
|
|
|
+ where PERIOD_ID = #{periodId}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteElecPeriodByPeriodId" parameterType="Long">
|
|
|
+ delete from ELEC_PERIOD where PERIOD_ID = #{periodId}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteElecPeriodByPeriodIds" parameterType="String">
|
|
|
+ delete from ELEC_PERIOD where PERIOD_ID in
|
|
|
+ <foreach item="periodId" collection="array" open="(" separator="," close=")">
|
|
|
+ #{periodId}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+</mapper>
|