临时修改

This commit is contained in:
2026-02-13 21:41:23 +08:00
parent 21673ecd1e
commit 6253fb6b2d
29 changed files with 2277 additions and 111 deletions

View File

@ -13,6 +13,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="stopCommand" column="stop_command" />
<result property="startPower" column="start_power" />
<result property="stopPower" column="stop_power" />
<result property="powerMultiplier" column="power_multiplier" />
<result property="clusterNum" column="cluster_num" />
<result property="clusterPointAddress" column="cluster_point_address" />
<result property="createBy" column="create_by" />
@ -23,7 +24,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectEmsPcsSettingVo">
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
select id, device_setting_id, point_address, power_address, start_command, stop_command, start_power, stop_power, power_multiplier, 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">
@ -36,6 +37,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="stopCommand != null and stopCommand != ''"> and stop_command = #{stopCommand}</if>
<if test="startPower != null "> and start_power = #{startPower}</if>
<if test="stopPower != null "> and stop_power = #{stopPower}</if>
<if test="powerMultiplier != null "> and power_multiplier = #{powerMultiplier}</if>
<if test="clusterNum != null "> and cluster_num = #{clusterNum}</if>
<if test="clusterPointAddress != null and clusterPointAddress != ''"> and cluster_point_address = #{clusterPointAddress}</if>
</where>
@ -61,6 +63,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="stopCommand != null">stop_command,</if>
<if test="startPower != null">start_power,</if>
<if test="stopPower != null">stop_power,</if>
<if test="powerMultiplier != null">power_multiplier,</if>
<if test="clusterNum != null">cluster_num,</if>
<if test="clusterPointAddress != null">cluster_point_address,</if>
<if test="createBy != null">create_by,</if>
@ -77,6 +80,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="stopCommand != null">#{stopCommand},</if>
<if test="startPower != null">#{startPower},</if>
<if test="stopPower != null">#{stopPower},</if>
<if test="powerMultiplier != null">#{powerMultiplier},</if>
<if test="clusterNum != null">#{clusterNum},</if>
<if test="clusterPointAddress != null">#{clusterPointAddress},</if>
<if test="createBy != null">#{createBy},</if>
@ -97,6 +101,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<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="powerMultiplier != null">power_multiplier = #{powerMultiplier},</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>
@ -129,6 +134,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<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="powerMultiplier != null">power_multiplier = #{powerMultiplier},</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>
@ -140,4 +146,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where device_setting_id = #{deviceSettingId}
</update>
</mapper>
</mapper>

View File

@ -0,0 +1,116 @@
<?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.EmsPointCalcConfigMapper">
<resultMap type="EmsPointCalcConfig" id="EmsPointCalcConfigResult">
<result property="id" column="id"/>
<result property="siteId" column="site_id"/>
<result property="deviceCategory" column="device_category"/>
<result property="pointName" column="point_name"/>
<result property="dataKey" column="data_key"/>
<result property="pointDesc" column="point_desc"/>
<result property="dataUnit" column="data_unit"/>
<result property="calcExpression" column="calc_expression"/>
<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="selectEmsPointCalcConfigVo">
select id, site_id, device_category, point_name, data_key, point_desc, data_unit, calc_expression,
create_by, create_time, update_by, update_time, remark
from ems_point_calc_config
</sql>
<select id="selectEmsPointCalcConfigById" parameterType="Long" resultMap="EmsPointCalcConfigResult">
<include refid="selectEmsPointCalcConfigVo"/>
where id = #{id}
</select>
<select id="selectEmsPointCalcConfigList" parameterType="EmsPointCalcConfig" resultMap="EmsPointCalcConfigResult">
<include refid="selectEmsPointCalcConfigVo"/>
<where>
<if test="siteId != null and siteId != ''">and site_id = #{siteId}</if>
<if test="deviceCategory != null and deviceCategory != ''">and device_category = #{deviceCategory}</if>
<if test="dataKey != null and dataKey != ''">and data_key like concat('%', #{dataKey}, '%')</if>
<if test="pointDesc != null and pointDesc != ''">and point_desc like concat('%', #{pointDesc}, '%')</if>
</where>
order by update_time desc, id desc
</select>
<insert id="insertEmsPointCalcConfig" parameterType="EmsPointCalcConfig" useGeneratedKeys="true" keyProperty="id">
insert into ems_point_calc_config
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="siteId != null">site_id,</if>
<if test="deviceCategory != null">device_category,</if>
<if test="pointName != null">point_name,</if>
<if test="dataKey != null">data_key,</if>
<if test="pointDesc != null">point_desc,</if>
<if test="dataUnit != null">data_unit,</if>
<if test="calcExpression != null">calc_expression,</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="siteId != null">#{siteId},</if>
<if test="deviceCategory != null">#{deviceCategory},</if>
<if test="pointName != null">#{pointName},</if>
<if test="dataKey != null">#{dataKey},</if>
<if test="pointDesc != null">#{pointDesc},</if>
<if test="dataUnit != null">#{dataUnit},</if>
<if test="calcExpression != null">#{calcExpression},</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="updateEmsPointCalcConfig" parameterType="EmsPointCalcConfig">
update ems_point_calc_config
<trim prefix="SET" suffixOverrides=",">
<if test="siteId != null">site_id = #{siteId},</if>
<if test="deviceCategory != null">device_category = #{deviceCategory},</if>
<if test="pointName != null">point_name = #{pointName},</if>
<if test="dataKey != null">data_key = #{dataKey},</if>
<if test="pointDesc != null">point_desc = #{pointDesc},</if>
<if test="dataUnit != null">data_unit = #{dataUnit},</if>
<if test="calcExpression != null">calc_expression = #{calcExpression},</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="deleteEmsPointCalcConfigById" parameterType="Long">
delete from ems_point_calc_config where id = #{id}
</delete>
<delete id="deleteEmsPointCalcConfigByIds" parameterType="String">
delete from ems_point_calc_config where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="countBySiteId" resultType="int">
select count(1)
from ems_point_calc_config
where site_id = #{siteId}
</select>
<delete id="deleteBySiteId">
delete from ems_point_calc_config
where site_id = #{siteId}
</delete>
</mapper>

View File

@ -6,6 +6,7 @@
<resultMap type="EmsPointConfig" id="EmsPointConfigResult">
<result property="id" column="id"/>
<result property="pointId" column="point_id"/>
<result property="siteId" column="site_id"/>
<result property="deviceCategory" column="device_category"/>
<result property="deviceId" column="device_id"/>
@ -29,7 +30,7 @@
</resultMap>
<sql id="selectEmsPointConfigVo">
select id, site_id, device_category, device_id, point_name, data_key, point_desc, register_address,
select id, point_id, site_id, device_category, device_id, point_name, data_key, point_desc, register_address,
data_unit, data_a, data_k, data_b, data_bit, is_alarm, point_type, calc_expression,
create_by, create_time, update_by, update_time, remark
from ems_point_config
@ -44,6 +45,7 @@
<include refid="selectEmsPointConfigVo"/>
<where>
<if test="siteId != null and siteId != ''">and site_id = #{siteId}</if>
<if test="pointId != null and pointId != ''">and point_id = #{pointId}</if>
<if test="deviceCategory != null and deviceCategory != ''">and device_category = #{deviceCategory}</if>
<if test="deviceId != null and deviceId != ''">and device_id = #{deviceId}</if>
<if test="dataKey != null and dataKey != ''">and data_key like concat('%', #{dataKey}, '%')</if>
@ -57,6 +59,7 @@
<insert id="insertEmsPointConfig" parameterType="EmsPointConfig" useGeneratedKeys="true" keyProperty="id">
insert into ems_point_config
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="pointId != null">point_id,</if>
<if test="siteId != null">site_id,</if>
<if test="deviceCategory != null">device_category,</if>
<if test="deviceId != null">device_id,</if>
@ -79,6 +82,7 @@
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="pointId != null">#{pointId},</if>
<if test="siteId != null">#{siteId},</if>
<if test="deviceCategory != null">#{deviceCategory},</if>
<if test="deviceId != null">#{deviceId},</if>
@ -102,9 +106,44 @@
</trim>
</insert>
<insert id="insertBatchEmsPointConfig">
insert into ems_point_config (
point_id, site_id, device_category, device_id, point_name, data_key, point_desc, register_address,
data_unit, data_a, data_k, data_b, data_bit, is_alarm, point_type, calc_expression,
create_by, create_time, update_by, update_time, remark
)
values
<foreach collection="list" item="item" separator=",">
(
#{item.pointId},
#{item.siteId},
#{item.deviceCategory},
#{item.deviceId},
#{item.pointName},
#{item.dataKey},
#{item.pointDesc},
#{item.registerAddress},
#{item.dataUnit},
#{item.dataA},
#{item.dataK},
#{item.dataB},
#{item.dataBit},
#{item.isAlarm},
#{item.pointType},
#{item.calcExpression},
#{item.createBy},
now(),
#{item.updateBy},
now(),
#{item.remark}
)
</foreach>
</insert>
<update id="updateEmsPointConfig" parameterType="EmsPointConfig">
update ems_point_config
<trim prefix="SET" suffixOverrides=",">
<if test="pointId != null">point_id = #{pointId},</if>
<if test="siteId != null">site_id = #{siteId},</if>
<if test="deviceCategory != null">device_category = #{deviceCategory},</if>
<if test="deviceId != null">device_id = #{deviceId},</if>
@ -151,12 +190,12 @@
<insert id="copyTemplateToSite">
insert into ems_point_config (
site_id, device_category, device_id, point_name, data_key, point_desc, register_address,
point_id, site_id, device_category, device_id, point_name, data_key, point_desc, register_address,
data_unit, data_a, data_k, data_b, data_bit, is_alarm, point_type, calc_expression,
create_by, create_time, update_by, update_time, remark
)
select
#{targetSiteId}, device_category, device_id, point_name, data_key, point_desc, register_address,
concat('PT_', replace(uuid(), '-', '')), #{targetSiteId}, device_category, device_id, point_name, data_key, point_desc, register_address,
data_unit, data_a, data_k, data_b, data_bit, is_alarm, point_type, calc_expression,
#{operName}, now(), #{operName}, now(), remark
from ems_point_config
@ -228,4 +267,13 @@
</if>
</select>
<select id="selectBySiteIdAndPointIds" resultMap="EmsPointConfigResult">
<include refid="selectEmsPointConfigVo"/>
where site_id = #{siteId}
and point_id in
<foreach collection="pointIds" item="pointId" open="(" separator="," close=")">
#{pointId}
</foreach>
</select>
</mapper>

View File

@ -9,6 +9,8 @@
<result property="siteId" column="site_id"/>
<result property="fieldCode" column="field_code"/>
<result property="dataPoint" column="data_point"/>
<result property="fixedDataPoint" column="fixed_data_point"/>
<result property="useFixedDisplay" column="use_fixed_display"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
@ -17,7 +19,7 @@
</resultMap>
<select id="selectBySiteId" resultMap="EmsSiteMonitorPointMatchResult">
select id, site_id, field_code, data_point, create_by, create_time, update_by, update_time, remark
select id, site_id, field_code, data_point, fixed_data_point, use_fixed_display, create_by, create_time, update_by, update_time, remark
from ems_site_monitor_point_match
where site_id = #{siteId}
order by id asc
@ -30,10 +32,10 @@
<insert id="insertBatch">
insert into ems_site_monitor_point_match
(site_id, field_code, data_point, create_by, create_time, update_by, update_time)
(site_id, field_code, data_point, fixed_data_point, use_fixed_display, create_by, create_time, update_by, update_time)
values
<foreach collection="list" item="item" separator=",">
(#{item.siteId}, #{item.fieldCode}, #{item.dataPoint}, #{item.createBy}, now(), #{item.updateBy}, now())
(#{item.siteId}, #{item.fieldCode}, #{item.dataPoint}, #{item.fixedDataPoint}, #{item.useFixedDisplay}, #{item.createBy}, now(), #{item.updateBy}, now())
</foreach>
</insert>

View File

@ -0,0 +1,98 @@
<?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.EmsStrategyRuntimeConfigMapper">
<resultMap type="EmsStrategyRuntimeConfig" id="EmsStrategyRuntimeConfigResult">
<result property="id" column="id"/>
<result property="siteId" column="site_id"/>
<result property="socDown" column="soc_down"/>
<result property="socUp" column="soc_up"/>
<result property="antiReverseThreshold" column="anti_reverse_threshold"/>
<result property="antiReverseRangePercent" column="anti_reverse_range_percent"/>
<result property="antiReverseUp" column="anti_reverse_up"/>
<result property="antiReversePowerDownPercent" column="anti_reverse_power_down_percent"/>
<result property="antiReverseHardStopThreshold" column="anti_reverse_hard_stop_threshold"/>
<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="selectVo">
select id,
site_id,
soc_down,
soc_up,
anti_reverse_threshold,
anti_reverse_range_percent,
anti_reverse_up,
anti_reverse_power_down_percent,
anti_reverse_hard_stop_threshold,
create_by,
create_time,
update_by,
update_time,
remark
from ems_strategy_runtime_config
</sql>
<select id="selectBySiteId" parameterType="String" resultMap="EmsStrategyRuntimeConfigResult">
<include refid="selectVo"/>
where site_id = #{siteId}
limit 1
</select>
<insert id="insert" parameterType="EmsStrategyRuntimeConfig" useGeneratedKeys="true" keyProperty="id">
insert into ems_strategy_runtime_config
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="siteId != null and siteId != ''">site_id,</if>
<if test="socDown != null">soc_down,</if>
<if test="socUp != null">soc_up,</if>
<if test="antiReverseThreshold != null">anti_reverse_threshold,</if>
<if test="antiReverseRangePercent != null">anti_reverse_range_percent,</if>
<if test="antiReverseUp != null">anti_reverse_up,</if>
<if test="antiReversePowerDownPercent != null">anti_reverse_power_down_percent,</if>
<if test="antiReverseHardStopThreshold != null">anti_reverse_hard_stop_threshold,</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="siteId != null and siteId != ''">#{siteId},</if>
<if test="socDown != null">#{socDown},</if>
<if test="socUp != null">#{socUp},</if>
<if test="antiReverseThreshold != null">#{antiReverseThreshold},</if>
<if test="antiReverseRangePercent != null">#{antiReverseRangePercent},</if>
<if test="antiReverseUp != null">#{antiReverseUp},</if>
<if test="antiReversePowerDownPercent != null">#{antiReversePowerDownPercent},</if>
<if test="antiReverseHardStopThreshold != null">#{antiReverseHardStopThreshold},</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="updateBySiteId" parameterType="EmsStrategyRuntimeConfig">
update ems_strategy_runtime_config
<trim prefix="SET" suffixOverrides=",">
<if test="socDown != null">soc_down = #{socDown},</if>
<if test="socUp != null">soc_up = #{socUp},</if>
<if test="antiReverseThreshold != null">anti_reverse_threshold = #{antiReverseThreshold},</if>
<if test="antiReverseRangePercent != null">anti_reverse_range_percent = #{antiReverseRangePercent},</if>
<if test="antiReverseUp != null">anti_reverse_up = #{antiReverseUp},</if>
<if test="antiReversePowerDownPercent != null">anti_reverse_power_down_percent = #{antiReversePowerDownPercent},</if>
<if test="antiReverseHardStopThreshold != null">anti_reverse_hard_stop_threshold = #{antiReverseHardStopThreshold},</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 site_id = #{siteId}
</update>
</mapper>