运行策略防逆流逻辑修改

This commit is contained in:
zq
2026-01-12 13:25:34 +08:00
parent 2fe5d7b8a1
commit ebc06e2a2d
4 changed files with 181 additions and 49 deletions

View File

@ -66,6 +66,10 @@ public class EmsStrategyLog extends BaseEntity
@Excel(name = "防逆流, 1-是、0-否")
private Integer antiReverse;
/** PCS降功率类型 */
@Excel(name = "PCS降功率类型0-降低功率、1-增加功率")
private Integer powerDownType;
public void setId(Long id)
{
this.id = id;
@ -172,6 +176,14 @@ public class EmsStrategyLog extends BaseEntity
this.antiReverse = antiReverse;
}
public Integer getPowerDownType() {
return powerDownType;
}
public void setPowerDownType(Integer powerDownType) {
this.powerDownType = powerDownType;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
@ -187,6 +199,7 @@ public class EmsStrategyLog extends BaseEntity
.append("chargeStatus", getChargeStatus())
.append("executionDate", getExecutionDate())
.append("antiReverse", getAntiReverse())
.append("powerDownType", getPowerDownType())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())

View File

@ -59,4 +59,6 @@ public interface EmsStrategyLogMapper
* @return 结果
*/
public int deleteEmsStrategyLogByIds(Long[] ids);
EmsStrategyLog getLastStrategyLog(EmsStrategyLog query);
}

View File

@ -16,6 +16,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="chargeStatus" column="charge_status" />
<result property="executionDate" column="execution_date" />
<result property="antiReverse" column="anti_reverse" />
<result property="powerDownType" column="power_down_type" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
@ -24,7 +25,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectEmsStrategyLogVo">
select id, strategy_id, template_id, site_id, device_id, start_time, end_time, charge_discharge_power, charge_status, execution_date, anti_reverse, create_by, create_time, update_by, update_time, remark from ems_strategy_log
select id, strategy_id, template_id, site_id, device_id, start_time, end_time, charge_discharge_power, charge_status, execution_date, anti_reverse, power_down_type, create_by, create_time, update_by, update_time, remark from ems_strategy_log
</sql>
<select id="selectEmsStrategyLogList" parameterType="EmsStrategyLog" resultMap="EmsStrategyLogResult">
@ -40,6 +41,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="chargeStatus != null and chargeStatus != ''"> and charge_status = #{chargeStatus}</if>
<if test="executionDate != null "> and execution_date = #{executionDate}</if>
<if test="antiReverse != null "> and anti_reverse = #{antiReverse}</if>
<if test="powerDownType != null "> and power_down_type = #{powerDownType}</if>
</where>
order by create_time desc
</select>
@ -62,6 +64,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="chargeStatus != null">charge_status,</if>
<if test="executionDate != null">execution_date,</if>
<if test="antiReverse != null">anti_reverse,</if>
<if test="powerDownType != null">power_down_type,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
@ -79,6 +82,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="chargeStatus != null">#{chargeStatus},</if>
<if test="executionDate != null">#{executionDate},</if>
<if test="antiReverse != null">#{antiReverse},</if>
<if test="powerDownType != null">#{powerDownType},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
@ -100,6 +104,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="chargeStatus != null">charge_status = #{chargeStatus},</if>
<if test="executionDate != null">execution_date = #{executionDate},</if>
<if test="antiReverse != null">anti_reverse = #{antiReverse},</if>
<if test="powerDownType != null">power_down_type = #{powerDownType},</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,4 +124,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{id}
</foreach>
</delete>
<select id="getLastStrategyLog" parameterType="EmsStrategyLog" resultMap="EmsStrategyLogResult">
<include refid="selectEmsStrategyLogVo"/>
<where>
<if test="strategyId != null "> and strategy_id = #{strategyId}</if>
<if test="templateId != null and templateId != ''"> and template_id = #{templateId}</if>
<if test="siteId != null and siteId != ''"> and site_id = #{siteId}</if>
<if test="deviceId != null and deviceId != ''"> and device_id = #{deviceId}</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="executionDate != null "> and execution_date = #{executionDate}</if>
<if test="antiReverse != null "> and anti_reverse = #{antiReverse}</if>
<if test="powerDownType != null "> and power_down_type = #{powerDownType}</if>
</where>
order by create_time desc
limit 1
</select>
</mapper>