临时修改
This commit is contained in:
@ -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>
|
||||
|
||||
Reference in New Issue
Block a user