电价配置
This commit is contained in:
@ -0,0 +1,151 @@
|
||||
<?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.xzzn.ems.mapper.EmsEnergyPriceConfigMapper">
|
||||
|
||||
<resultMap type="EmsEnergyPriceConfig" id="EmsEnergyPriceConfigResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="year" column="year" />
|
||||
<result property="month" column="month" />
|
||||
<result property="peak" column="peak" />
|
||||
<result property="high" column="high" />
|
||||
<result property="flat" column="flat" />
|
||||
<result property="valley" column="valley" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="remark" column="remark" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectEmsEnergyPriceConfigVo">
|
||||
select id, year, month, peak, high, flat, valley, create_by, create_time, update_by, update_time, remark from ems_energy_price_config
|
||||
</sql>
|
||||
|
||||
<select id="selectEmsEnergyPriceConfigList" parameterType="EmsEnergyPriceConfig" resultMap="EmsEnergyPriceConfigResult">
|
||||
<include refid="selectEmsEnergyPriceConfigVo"/>
|
||||
<where>
|
||||
<if test="year != null and year != ''"> and year = #{year}</if>
|
||||
<if test="month != null and month != ''"> and month = #{month}</if>
|
||||
<if test="peak != null "> and peak = #{peak}</if>
|
||||
<if test="high != null "> and high = #{high}</if>
|
||||
<if test="flat != null "> and flat = #{flat}</if>
|
||||
<if test="valley != null "> and valley = #{valley}</if>
|
||||
<if test="siteId != null and siteId != ''"> and site_id = #{siteId}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectEmsEnergyPriceConfigById" parameterType="Long" resultMap="EmsEnergyPriceConfigResult">
|
||||
<include refid="selectEmsEnergyPriceConfigVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertEmsEnergyPriceConfig" parameterType="EmsEnergyPriceConfig" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into ems_energy_price_config
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="year != null and year != ''">year,</if>
|
||||
<if test="month != null and month != ''">month,</if>
|
||||
<if test="peak != null">peak,</if>
|
||||
<if test="high != null">high,</if>
|
||||
<if test="flat != null">flat,</if>
|
||||
<if test="valley != null">valley,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="year != null and year != ''">#{year},</if>
|
||||
<if test="month != null and month != ''">#{month},</if>
|
||||
<if test="peak != null">#{peak},</if>
|
||||
<if test="high != null">#{high},</if>
|
||||
<if test="flat != null">#{flat},</if>
|
||||
<if test="valley != null">#{valley},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateEmsEnergyPriceConfig" parameterType="EmsEnergyPriceConfig">
|
||||
update ems_energy_price_config
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="year != null and year != ''">year = #{year},</if>
|
||||
<if test="month != null and month != ''">month = #{month},</if>
|
||||
<if test="peak != null">peak = #{peak},</if>
|
||||
<if test="high != null">high = #{high},</if>
|
||||
<if test="flat != null">flat = #{flat},</if>
|
||||
<if test="valley != null">valley = #{valley},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteEmsEnergyPriceConfigById" parameterType="Long">
|
||||
delete from ems_energy_price_config where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteEmsEnergyPriceConfigByIds" parameterType="String">
|
||||
delete from ems_energy_price_config where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="getCurrentYearConfigList" resultMap="EmsEnergyPriceConfigResult">
|
||||
<include refid="selectEmsEnergyPriceConfigVo"/>
|
||||
<where>
|
||||
year = #{currentYear}
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<insert id="insertOrUpdateEmsEnergyPriceConfig" parameterType="com.xzzn.ems.domain.EmsEnergyPriceConfig"
|
||||
useGeneratedKeys="true" keyProperty="id">
|
||||
INSERT INTO ems_energy_price_config (
|
||||
id,
|
||||
year,
|
||||
month,
|
||||
peak,
|
||||
high,
|
||||
flat,
|
||||
valley,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time,
|
||||
remark
|
||||
) VALUES (
|
||||
#{id},
|
||||
#{year},
|
||||
#{month},
|
||||
#{peak},
|
||||
#{high},
|
||||
#{flat},
|
||||
#{valley},
|
||||
'system',
|
||||
NOW(),
|
||||
'system',
|
||||
NOW(),
|
||||
#{remark}
|
||||
) ON DUPLICATE KEY UPDATE
|
||||
peak = #{peak},
|
||||
high = #{high},
|
||||
flat = #{flat},
|
||||
valley = #{valley},
|
||||
update_time = NOW();
|
||||
</insert>
|
||||
|
||||
<select id="getConfigListByYearAndMonth" resultMap="EmsEnergyPriceConfigResult">
|
||||
<include refid="selectEmsEnergyPriceConfigVo"/>
|
||||
where year = #{currentYear}
|
||||
and month = #{month}
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user