点位清单-导入导出

This commit is contained in:
2025-11-05 14:58:05 +08:00
parent 3598cb2d66
commit c2682f38a8
9 changed files with 329 additions and 24 deletions

View File

@ -15,6 +15,8 @@
<result property="dataPointName" column="data_point_name" />
<result property="dataDevice" column="data_device" />
<result property="dataUnit" column="data_unit" />
<result property="ipAddress" column="ip_address" />
<result property="ipPort" column="ip_port" />
<result property="dataType" column="data_type" />
<result property="needDiffDeviceId" column="need_diff_device_id" />
<result property="createBy" column="create_by" />
@ -25,7 +27,7 @@
</resultMap>
<sql id="selectEmsPointMatchVo">
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
select id, point_name, match_table, match_field, site_id, device_category, data_point, data_point_name, data_device, data_unit, ip_address, ip_port, 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">
@ -40,6 +42,8 @@
<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="ipAddress != null and ipAddress != ''"> and ip_address = #{ipAddress}</if>
<if test="ipPort != null "> and ip_port = #{ipPort}</if>
<if test="dataType != null "> and data_type = #{dataType}</if>
<if test="needDiffDeviceId != null "> and need_diff_device_id = #{needDiffDeviceId}</if>
</where>
@ -62,6 +66,8 @@
<if test="dataPointName != null">data_point_name,</if>
<if test="dataDevice != null">data_device,</if>
<if test="dataUnit != null">data_unit,</if>
<if test="ipAddress != null">ip_address,</if>
<if test="ipPort != null">ip_port,</if>
<if test="dataType != null">data_type,</if>
<if test="needDiffDeviceId != null">need_diff_device_id,</if>
<if test="createBy != null">create_by,</if>
@ -80,6 +86,8 @@
<if test="dataPointName != null">#{dataPointName},</if>
<if test="dataDevice != null">#{dataDevice},</if>
<if test="dataUnit != null">#{dataUnit},</if>
<if test="ipAddress != null">#{ipAddress},</if>
<if test="ipPort != null">#{ipPort},</if>
<if test="dataType != null">#{dataType},</if>
<if test="needDiffDeviceId != null">#{needDiffDeviceId},</if>
<if test="createBy != null">#{createBy},</if>
@ -102,6 +110,8 @@
<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="ipAddress != null">ip_address = #{ipAddress},</if>
<if test="ipPort != null">ip_port = #{ipPort},</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>
@ -343,7 +353,9 @@
t.data_point_name as dataPointName,
t.data_device as dataDevice,
t.need_diff_device_id as isNeedDeviceId,
t.data_unit as dataUnit
t.data_unit as dataUnit,
t.ip_address as ipAddress,
t.ip_port as ipPort
from ems_point_match t
where 1=1
<if test="siteId != null and siteId != ''">
@ -358,6 +370,12 @@
<if test="dataPoint != null and dataPoint != ''">
and t.data_point like CONCAT('%', #{dataPoint}, '%')
</if>
<if test="ipAddress != null and ipAddress != ''">
and t.ip_address = #{ipAddress}
</if>
<if test="ipPort != null">
and t.ip_port = #{ipPort}
</if>
</select>
<select id="getClusterDevicePoints" resultType="com.xzzn.ems.domain.vo.PointQueryResponse">
@ -365,7 +383,9 @@
tmp.dataPoint,
tmp.dataDevice,
tmp.dataPointName,
tmp.dataUnit
tmp.dataUnit,
tmp.ipAddress,
tmp.ipPort
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)
@ -373,7 +393,9 @@
else t.data_point end as dataPoint,
t.data_point_name as dataPointName,
t.data_device as dataDevice,
t.data_unit as dataUnit
t.data_unit as dataUnit,
t.ip_address as ipAddress,
t.ip_port as ipPort
from ems_point_match t
where 1=1
<if test="siteId != null and siteId != ''">
@ -385,10 +407,16 @@
) as tmp
where 1=1
<if test="pointName != null and pointName != ''">
and tmp.point_name like CONCAT('%', #{pointName}, '%')
and tmp.dataPointName like CONCAT('%', #{pointName}, '%')
</if>
<if test="dataPoint != null and dataPoint != ''">
and tmp.dataPoint like CONCAT('%', #{dataPoint}, '%')
</if>
<if test="ipAddress != null and ipAddress != ''">
and tmp.ipAddress = #{ipAddress}
</if>
<if test="ipPort != null">
and tmp.ipPort = #{ipPort}
</if>
</select>
</mapper>