PCS设备配置功能修改

This commit is contained in:
zq
2026-01-04 09:00:10 +08:00
parent 552d471fde
commit 041c41822e
4 changed files with 50 additions and 4 deletions

View File

@ -29,6 +29,10 @@ public class EmsPcsSetting extends BaseEntity
@Excel(name = "开关机地址")
private String pointAddress;
/** 功率地址 */
@Excel(name = "功率地址")
private String powerAddress;
/** 开机指令 */
@Excel(name = "开机指令")
private String startCommand;
@ -73,6 +77,14 @@ public class EmsPcsSetting extends BaseEntity
return deviceSettingId;
}
public String getPowerAddress() {
return powerAddress;
}
public void setPowerAddress(String powerAddress) {
this.powerAddress = powerAddress;
}
public void setPointAddress(String pointAddress)
{
this.pointAddress = pointAddress;

View File

@ -63,4 +63,6 @@ public interface EmsPcsSettingMapper
public int deleteEmsPcsSettingByIds(Long[] ids);
EmsPcsSetting selectEmsPcsSettingByDeviceId(@Param("deviceSettingId") Long deviceSettingId);
void updateByDeviceSettingId(EmsPcsSetting pcsSetting);
}

View File

@ -142,8 +142,13 @@ public class EmsDeviceSettingServiceImpl implements IEmsDeviceSettingService
devicesSetting.setUpdateTime(DateUtils.getNowDate());
EmsPcsSetting pcsSetting = devicesSetting.getPcsSetting();
if (pcsSetting != null) {
pcsSetting.setUpdateTime(DateUtils.getNowDate());
emsPcsSettingMapper.updateEmsPcsSetting(pcsSetting);
if (pcsSetting.getDeviceSettingId() == null) {
pcsSetting.setDeviceSettingId(devicesSetting.getId());
emsPcsSettingMapper.insertEmsPcsSetting(pcsSetting);
} else {
pcsSetting.setUpdateTime(DateUtils.getNowDate());
emsPcsSettingMapper.updateByDeviceSettingId(pcsSetting);
}
}
return emsDevicesMapper.updateEmsDevicesSetting(devicesSetting);
}

View File

@ -8,6 +8,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="id" column="id" />
<result property="deviceSettingId" column="device_setting_id" />
<result property="pointAddress" column="point_address" />
<result property="powerAddress" column="power_address" />
<result property="startCommand" column="start_command" />
<result property="stopCommand" column="stop_command" />
<result property="startPower" column="start_power" />
@ -22,7 +23,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectEmsPcsSettingVo">
select id, device_setting_id, point_address, start_command, stop_command, start_power, stop_power, cluster_num, cluster_point_address, create_by, create_time, update_by, update_time, remark from ems_pcs_setting
select id, device_setting_id, point_address, power_address, start_command, stop_command, start_power, stop_power, cluster_num, cluster_point_address, create_by, create_time, update_by, update_time, remark from ems_pcs_setting
</sql>
<select id="selectEmsPcsSettingList" parameterType="EmsPcsSetting" resultMap="EmsPcsSettingResult">
@ -30,6 +31,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<where>
<if test="deviceSettingId != null "> and device_setting_id = #{deviceSettingId}</if>
<if test="pointAddress != null and pointAddress != ''"> and point_address = #{pointAddress}</if>
<if test="powerAddress != null and powerAddress != ''"> and power_address = #{powerAddress}</if>
<if test="startCommand != null and startCommand != ''"> and start_command = #{startCommand}</if>
<if test="stopCommand != null and stopCommand != ''"> and stop_command = #{stopCommand}</if>
<if test="startPower != null "> and start_power = #{startPower}</if>
@ -54,6 +56,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="deviceSettingId != null">device_setting_id,</if>
<if test="pointAddress != null">point_address,</if>
<if test="powerAddress != null">power_address,</if>
<if test="startCommand != null">start_command,</if>
<if test="stopCommand != null">stop_command,</if>
<if test="startPower != null">start_power,</if>
@ -69,6 +72,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="deviceSettingId != null">#{deviceSettingId},</if>
<if test="pointAddress != null">#{pointAddress},</if>
<if test="powerAddress != null">#{powerAddress},</if>
<if test="startCommand != null">#{startCommand},</if>
<if test="stopCommand != null">#{stopCommand},</if>
<if test="startPower != null">#{startPower},</if>
@ -88,6 +92,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<trim prefix="SET" suffixOverrides=",">
<if test="deviceSettingId != null">device_setting_id = #{deviceSettingId},</if>
<if test="pointAddress != null">point_address = #{pointAddress},</if>
<if test="powerAddress != null">power_address = #{powerAddress},</if>
<if test="startCommand != null">start_command = #{startCommand},</if>
<if test="stopCommand != null">stop_command = #{stopCommand},</if>
<if test="startPower != null">start_power = #{startPower},</if>
@ -113,4 +118,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{id}
</foreach>
</delete>
<update id="updateByDeviceSettingId" parameterType="EmsPcsSetting">
update ems_pcs_setting
<trim prefix="SET" suffixOverrides=",">
<if test="deviceSettingId != null">device_setting_id = #{deviceSettingId},</if>
<if test="pointAddress != null">point_address = #{pointAddress},</if>
<if test="powerAddress != null">power_address = #{powerAddress},</if>
<if test="startCommand != null">start_command = #{startCommand},</if>
<if test="stopCommand != null">stop_command = #{stopCommand},</if>
<if test="startPower != null">start_power = #{startPower},</if>
<if test="stopPower != null">stop_power = #{stopPower},</if>
<if test="clusterNum != null">cluster_num = #{clusterNum},</if>
<if test="clusterPointAddress != null">cluster_point_address = #{clusterPointAddress},</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 device_setting_id = #{deviceSettingId}
</update>
</mapper>