策略配置-模板修改&模板时间配置
This commit is contained in:
@ -108,6 +108,6 @@
|
||||
where site_id = #{siteId}
|
||||
and main_strategy_id = #{mainStrategyId}
|
||||
and auxiliary_strategy_id = #{auxiliaryStrategyId}
|
||||
and `status` != 4
|
||||
and `status` = 1
|
||||
</select>
|
||||
</mapper>
|
||||
@ -11,10 +11,6 @@
|
||||
<result property="sdcLimit" column="sdc_limit" />
|
||||
<result property="sdcDown" column="sdc_down" />
|
||||
<result property="sdcUp" column="sdc_up" />
|
||||
<result property="startTime" column="start_time" />
|
||||
<result property="endTime" column="end_time" />
|
||||
<result property="chargeDischargePower" column="charge_discharge_power" />
|
||||
<result property="chargeStatus" column="charge_status" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
@ -24,7 +20,7 @@
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectEmsStrategyTempVo">
|
||||
select id, strategy_id, template_name, sdc_limit, sdc_down, sdc_up, start_time, end_time, charge_discharge_power, charge_status, create_by, create_time, update_by, update_time, remark, site_id from ems_strategy_temp
|
||||
select id, strategy_id, template_name, sdc_limit, sdc_down, sdc_up, create_by, create_time, update_by, update_time, remark, site_id from ems_strategy_temp
|
||||
</sql>
|
||||
|
||||
<select id="selectEmsStrategyTempList" parameterType="EmsStrategyTemp" resultMap="EmsStrategyTempResult">
|
||||
@ -35,10 +31,6 @@
|
||||
<if test="sdcLimit != null "> and sdc_limit = #{sdcLimit}</if>
|
||||
<if test="sdcDown != null "> and sdc_down = #{sdcDown}</if>
|
||||
<if test="sdcUp != null "> and sdc_up = #{sdcUp}</if>
|
||||
<if test="startTime != null "> and start_time = #{startTime}</if>
|
||||
<if test="endTime != null "> and end_time = #{endTime}</if>
|
||||
<if test="chargeDischargePower != null "> and charge_discharge_power = #{chargeDischargePower}</if>
|
||||
<if test="chargeStatus != null and chargeStatus != ''"> and charge_status = #{chargeStatus}</if>
|
||||
<if test="siteId != null and siteId != ''"> and site_id = #{siteId}</if>
|
||||
</where>
|
||||
</select>
|
||||
@ -56,10 +48,6 @@
|
||||
<if test="sdcLimit != null">sdc_limit,</if>
|
||||
<if test="sdcDown != null">sdc_down,</if>
|
||||
<if test="sdcUp != null">sdc_up,</if>
|
||||
<if test="startTime != null">start_time,</if>
|
||||
<if test="endTime != null">end_time,</if>
|
||||
<if test="chargeDischargePower != null">charge_discharge_power,</if>
|
||||
<if test="chargeStatus != null">charge_status,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
@ -73,10 +61,6 @@
|
||||
<if test="sdcLimit != null">#{sdcLimit},</if>
|
||||
<if test="sdcDown != null">#{sdcDown},</if>
|
||||
<if test="sdcUp != null">#{sdcUp},</if>
|
||||
<if test="startTime != null">#{startTime},</if>
|
||||
<if test="endTime != null">#{endTime},</if>
|
||||
<if test="chargeDischargePower != null">#{chargeDischargePower},</if>
|
||||
<if test="chargeStatus != null">#{chargeStatus},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
@ -94,10 +78,6 @@
|
||||
<if test="sdcLimit != null">sdc_limit = #{sdcLimit},</if>
|
||||
<if test="sdcDown != null">sdc_down = #{sdcDown},</if>
|
||||
<if test="sdcUp != null">sdc_up = #{sdcUp},</if>
|
||||
<if test="startTime != null">start_time = #{startTime},</if>
|
||||
<if test="endTime != null">end_time = #{endTime},</if>
|
||||
<if test="chargeDischargePower != null">charge_discharge_power = #{chargeDischargePower},</if>
|
||||
<if test="chargeStatus != null">charge_status = #{chargeStatus},</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>
|
||||
@ -119,10 +99,14 @@
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="getTempNameList" resultType="String">
|
||||
select DISTINCT template_name as templateName
|
||||
<select id="getTempNameList" resultType="Map">
|
||||
select DISTINCT id as templateId,template_name as templateName
|
||||
from ems_strategy_temp
|
||||
where site_id = #{siteId}
|
||||
and strategy_id = #{strategyId}
|
||||
</select>
|
||||
|
||||
<select id="getStrategyTempByTempId" parameterType="String" resultType="int">
|
||||
select count(1) from ems_strategy_temp where template_id = #{templateId}
|
||||
</select>
|
||||
</mapper>
|
||||
@ -0,0 +1,105 @@
|
||||
<?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.EmsStrategyTempTimeConfigMapper">
|
||||
|
||||
<resultMap type="EmsStrategyTempTimeConfig" id="EmsStrategyTempTimeConfigResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="startTime" column="start_time" />
|
||||
<result property="endTime" column="end_time" />
|
||||
<result property="chargeDischargePower" column="charge_discharge_power" />
|
||||
<result property="chargeStatus" column="charge_status" />
|
||||
<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" />
|
||||
<result property="templateId" column="template_id" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectEmsStrategyTempTimeConfigVo">
|
||||
select id, start_time, end_time, charge_discharge_power, charge_status, create_by, create_time, update_by, update_time, remark, template_id from ems_strategy_temp_time_config
|
||||
</sql>
|
||||
|
||||
<select id="selectEmsStrategyTempTimeConfigList" parameterType="EmsStrategyTempTimeConfig" resultMap="EmsStrategyTempTimeConfigResult">
|
||||
<include refid="selectEmsStrategyTempTimeConfigVo"/>
|
||||
<where>
|
||||
<if test="startTime != null "> and start_time = #{startTime}</if>
|
||||
<if test="endTime != null "> and end_time = #{endTime}</if>
|
||||
<if test="chargeDischargePower != null "> and charge_discharge_power = #{chargeDischargePower}</if>
|
||||
<if test="chargeStatus != null and chargeStatus != ''"> and charge_status = #{chargeStatus}</if>
|
||||
<if test="templateId != null "> and template_id = #{templateId}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectEmsStrategyTempTimeConfigById" parameterType="Long" resultMap="EmsStrategyTempTimeConfigResult">
|
||||
<include refid="selectEmsStrategyTempTimeConfigVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertEmsStrategyTempTimeConfig" parameterType="EmsStrategyTempTimeConfig" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into ems_strategy_temp_time_config
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="startTime != null">start_time,</if>
|
||||
<if test="endTime != null">end_time,</if>
|
||||
<if test="chargeDischargePower != null">charge_discharge_power,</if>
|
||||
<if test="chargeStatus != null">charge_status,</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>
|
||||
<if test="templateId != null">template_id,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="startTime != null">#{startTime},</if>
|
||||
<if test="endTime != null">#{endTime},</if>
|
||||
<if test="chargeDischargePower != null">#{chargeDischargePower},</if>
|
||||
<if test="chargeStatus != null">#{chargeStatus},</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>
|
||||
<if test="templateId != null">#{templateId},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateEmsStrategyTempTimeConfig" parameterType="EmsStrategyTempTimeConfig">
|
||||
update ems_strategy_temp_time_config
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="startTime != null">start_time = #{startTime},</if>
|
||||
<if test="endTime != null">end_time = #{endTime},</if>
|
||||
<if test="chargeDischargePower != null">charge_discharge_power = #{chargeDischargePower},</if>
|
||||
<if test="chargeStatus != null">charge_status = #{chargeStatus},</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>
|
||||
<if test="templateId != null">template_id = #{templateId},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteEmsStrategyTempTimeConfigById" parameterType="Long">
|
||||
delete from ems_strategy_temp_time_config where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteEmsStrategyTempTimeConfigByIds" parameterType="String">
|
||||
delete from ems_strategy_temp_time_config where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="getTimeListByTempId" parameterType="Long" resultMap="EmsStrategyTempTimeConfigResult">
|
||||
<include refid="selectEmsStrategyTempTimeConfigVo"/>
|
||||
where template_id = #{templateId}
|
||||
</select>
|
||||
|
||||
<delete id="deleteTimeConfigByTempId" parameterType="Long">
|
||||
delete from ems_strategy_temp_time_config where template_id = #{templateId}
|
||||
</delete>
|
||||
</mapper>
|
||||
@ -15,10 +15,11 @@
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="siteId" column="site_id" />
|
||||
<result property="templateId" column="template_id" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectEmsStrategyTimeConfigVo">
|
||||
select id, strategy_id, month, charge_discharge_mode, create_by, create_time, update_by, update_time, remark, site_id from ems_strategy_time_config
|
||||
select id, strategy_id, month, charge_discharge_mode, create_by, create_time, update_by, update_time, remark, site_id, template_id from ems_strategy_time_config
|
||||
</sql>
|
||||
|
||||
<select id="selectEmsStrategyTimeConfigList" parameterType="EmsStrategyTimeConfig" resultMap="EmsStrategyTimeConfigResult">
|
||||
@ -28,8 +29,8 @@
|
||||
<if test="month != null "> and month = #{month}</if>
|
||||
<if test="chargeDischargeMode != null and chargeDischargeMode != ''"> and charge_discharge_mode = #{chargeDischargeMode}</if>
|
||||
<if test="siteId != null and siteId != ''"> and site_id = #{siteId}</if>
|
||||
<if test="templateId != null and templateId != ''"> and template_id = #{templateId}</if>
|
||||
</where>
|
||||
order by month
|
||||
</select>
|
||||
|
||||
<select id="selectEmsStrategyTimeConfigById" parameterType="Long" resultMap="EmsStrategyTimeConfigResult">
|
||||
@ -49,6 +50,7 @@
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="siteId != null">site_id,</if>
|
||||
<if test="templateId != null">template_id,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="strategyId != null">#{strategyId},</if>
|
||||
@ -60,6 +62,7 @@
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="siteId != null">#{siteId},</if>
|
||||
<if test="templateId != null">#{templateId},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
@ -75,6 +78,7 @@
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="siteId != null">site_id = #{siteId},</if>
|
||||
<if test="templateId != null">template_id = #{templateId},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
Reference in New Issue
Block a user