策略曲线图修改

This commit is contained in:
2025-07-22 22:27:12 +08:00
parent b4cbf0b34e
commit e3e3dc1d96
10 changed files with 217 additions and 67 deletions

View File

@ -18,10 +18,12 @@
<result property="remark" column="remark" />
<result property="siteId" column="site_id" />
<result property="templateId" column="template_id" />
<result property="month" column="month" />
<result property="isDelete" column="isDelete" />
</resultMap>
<sql id="selectEmsStrategyCurveVo">
select id, strategy_id, task_number, start_date, end_date, power_data, create_by, create_time, update_by, update_time, remark, site_id, template_id from ems_strategy_curve
select id, strategy_id, task_number, start_date, end_date, power_data, create_by, create_time, update_by, update_time, remark, site_id, template_id, month, isDelete from ems_strategy_curve
</sql>
<select id="selectEmsStrategyCurveList" parameterType="EmsStrategyCurve" resultMap="EmsStrategyCurveResult">
@ -34,6 +36,8 @@
<if test="powerData != null and powerData != ''"> and power_data = #{powerData}</if>
<if test="siteId != null and siteId != ''"> and site_id = #{siteId}</if>
<if test="templateId != null and templateId != ''"> and template_id = #{templateId}</if>
<if test="month != null "> and month = #{month}</if>
<if test="isDelete != null "> and isDelete = #{isDelete}</if>
</where>
</select>
@ -57,6 +61,8 @@
<if test="remark != null">remark,</if>
<if test="siteId != null">site_id,</if>
<if test="templateId != null">template_id,</if>
<if test="month != null">month,</if>
<if test="isDelete != null">isDelete,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="strategyId != null">#{strategyId},</if>
@ -71,6 +77,8 @@
<if test="remark != null">#{remark},</if>
<if test="siteId != null">#{siteId},</if>
<if test="templateId != null">#{templateId},</if>
<if test="month != null">#{month},</if>
<if test="isDelete != null">#{isDelete},</if>
</trim>
</insert>
@ -89,6 +97,8 @@
<if test="remark != null">remark = #{remark},</if>
<if test="siteId != null">site_id = #{siteId},</if>
<if test="templateId != null">template_id = #{templateId},</if>
<if test="month != null">month = #{month},</if>
<if test="isDelete != null">isDelete = #{isDelete},</if>
</trim>
where id = #{id}
</update>
@ -107,6 +117,18 @@
<select id="getTemplateCurve" parameterType="String" resultMap="EmsStrategyCurveResult">
<include refid="selectEmsStrategyCurveVo"/>
<where> template_id = #{templateId}
and isDelete = 1
</where>
</select>
<update id="physicalDeleteCurve">
update ems_strategy_curve set isDelete = 0
where site_id = #{siteId}
and strategy_id = #{strategyId}
</update>
<update id="physicalDeleteByTemplateId">
update ems_strategy_curve set isDelete = 0
where template_id = #{templateId}
</update>
</mapper>

View File

@ -16,10 +16,11 @@
<result property="remark" column="remark" />
<result property="siteId" column="site_id" />
<result property="templateId" column="template_id" />
<result property="isPost" column="isPost" />
</resultMap>
<sql id="selectEmsStrategyTimeConfigVo">
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
select id, strategy_id, month, charge_discharge_mode, create_by, create_time, update_by, update_time, remark, site_id, template_id, isPost from ems_strategy_time_config
</sql>
<select id="selectEmsStrategyTimeConfigList" parameterType="EmsStrategyTimeConfig" resultMap="EmsStrategyTimeConfigResult">
@ -30,6 +31,7 @@
<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>
<if test="isPost != null "> and isPost = #{isPost}</if>
</where>
</select>
@ -51,6 +53,7 @@
<if test="remark != null">remark,</if>
<if test="siteId != null">site_id,</if>
<if test="templateId != null">template_id,</if>
<if test="isPost != null">isPost,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="strategyId != null">#{strategyId},</if>
@ -63,6 +66,7 @@
<if test="remark != null">#{remark},</if>
<if test="siteId != null">#{siteId},</if>
<if test="templateId != null">#{templateId},</if>
<if test="isPost != null">#{isPost},</if>
</trim>
</insert>
@ -79,6 +83,7 @@
<if test="remark != null">remark = #{remark},</if>
<if test="siteId != null">site_id = #{siteId},</if>
<if test="templateId != null">template_id = #{templateId},</if>
<if test="isPost != null">isPost = #{isPost},</if>
</trim>
where id = #{id}
</update>
@ -99,7 +104,9 @@
t.month,
t.charge_discharge_mode as chargeDischargeMode,
t.template_id as templateId,
temp.template_name as templateName
temp.template_name as templateName,
t.site_id as siteId,
t.strategy_id as strategyId
from ems_strategy_time_config t
LEFT JOIN ems_strategy_temp temp on t.template_id = temp.template_id
where t.site_id = #{siteId}
@ -114,5 +121,6 @@
<select id="getAllTimeConfigByTempId" parameterType="String" resultMap="EmsStrategyTimeConfigResult">
<include refid="selectEmsStrategyTimeConfigVo"/>
where template_id = #{templateId}
and isPost = 1
</select>
</mapper>