task63-点位清单增加单位列

This commit is contained in:
2025-10-14 16:50:53 +08:00
parent 609803605d
commit 3020f9f915
4 changed files with 82 additions and 8 deletions

View File

@ -14,6 +14,9 @@
<result property="dataPoint" column="data_point" />
<result property="dataPointName" column="data_point_name" />
<result property="dataDevice" column="data_device" />
<result property="dataUnit" column="data_unit" />
<result property="dataType" column="data_type" />
<result property="needDiffDeviceId" column="need_diff_device_id" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
@ -22,7 +25,7 @@
</resultMap>
<sql id="selectEmsPointMatchVo">
select id, point_name, match_table, match_field, site_id, device_category, data_point, data_point_name, data_device, create_by, create_time, update_by, update_time, remark from ems_point_match
select id, point_name, match_table, match_field, site_id, device_category, data_point, data_point_name, data_device, data_unit, data_type, need_diff_device_id, create_by, create_time, update_by, update_time, remark from ems_point_match
</sql>
<select id="selectEmsPointMatchList" parameterType="EmsPointMatch" resultMap="EmsPointMatchResult">
@ -36,6 +39,9 @@
<if test="dataPoint != null and dataPoint != ''"> and data_point = #{dataPoint}</if>
<if test="dataPointName != null and dataPointName != ''"> and data_point_name like concat('%', #{dataPointName}, '%')</if>
<if test="dataDevice != null and dataDevice != ''"> and data_device = #{dataDevice}</if>
<if test="dataUnit != null and dataUnit != ''"> and data_unit = #{dataUnit}</if>
<if test="dataType != null "> and data_type = #{dataType}</if>
<if test="needDiffDeviceId != null "> and need_diff_device_id = #{needDiffDeviceId}</if>
</where>
</select>
@ -55,6 +61,9 @@
<if test="dataPoint != null">data_point,</if>
<if test="dataPointName != null">data_point_name,</if>
<if test="dataDevice != null">data_device,</if>
<if test="dataUnit != null">data_unit,</if>
<if test="dataType != null">data_type,</if>
<if test="needDiffDeviceId != null">need_diff_device_id,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
@ -70,6 +79,9 @@
<if test="dataPoint != null">#{dataPoint},</if>
<if test="dataPointName != null">#{dataPointName},</if>
<if test="dataDevice != null">#{dataDevice},</if>
<if test="dataUnit != null">#{dataUnit},</if>
<if test="dataType != null">#{dataType},</if>
<if test="needDiffDeviceId != null">#{needDiffDeviceId},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
@ -89,6 +101,9 @@
<if test="dataPoint != null">data_point = #{dataPoint},</if>
<if test="dataPointName != null">data_point_name = #{dataPointName},</if>
<if test="dataDevice != null">data_device = #{dataDevice},</if>
<if test="dataUnit != null">data_unit = #{dataUnit},</if>
<if test="dataType != null">data_type = #{dataType},</if>
<if test="needDiffDeviceId != null">need_diff_device_id = #{needDiffDeviceId},</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>
@ -323,7 +338,8 @@
t.data_point as dataPoint,
t.data_point_name as dataPointName,
t.data_device as dataDevice,
t.need_diff_device_id as isNeedDeviceId
t.need_diff_device_id as isNeedDeviceId,
t.data_unit as dataUnit
from ems_point_match t
where 1=1
<if test="siteId != null and siteId != ''">
@ -344,14 +360,16 @@
SELECT tmp.pointName,
tmp.dataPoint,
tmp.dataDevice,
tmp.dataPointName
tmp.dataPointName,
tmp.dataUnit
FROM ( select t.point_name as pointName,
case
when t.need_diff_device_id = 1 and t.data_device = 'PCS' then concat(#{deviceId}, t.data_point)
when t.need_diff_device_id = 1 and t.data_device = 'BMSD' then concat(#{parentDeviceId}, t.data_point)
else t.data_point end as dataPoint,
t.data_point_name as dataPointName,
t.data_device as dataDevice
t.data_device as dataDevice,
t.data_unit as dataUnit
from ems_point_match t
where 1=1
<if test="siteId != null and siteId != ''">