SmartSubstationPlatform/riis-system/src/main/resources/mapper/auxcontrol/DeviceSignalMapper.xml

114 lines
3.3 KiB
XML
Raw Normal View History

2025-04-23 17:56:18 +08:00
<?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.yfd.platform.modules.auxcontrol.mapper.DeviceSignalMapper">
<!-- 查询辅控设备信号表-->
2025-04-24 10:49:36 +08:00
<select id="selectDeviceSignalMap" resultType="java.util.Map">
2025-04-23 17:56:18 +08:00
SELECT
a.station_id,
a.systemcode,
a.device_name,
b.*
FROM
2025-04-24 10:07:53 +08:00
fk_meter_device a
2025-04-24 10:49:36 +08:00
JOIN fk_device_signal b ON ( a.device_id = b.meter_device_id )
2025-04-24 10:07:53 +08:00
JOIN fk_gateway_device c ON ( a.netdevice_ip = c.ip_addr )
2025-04-23 17:56:18 +08:00
WHERE
2025-04-24 10:49:36 +08:00
1 =1
<if test="slaveIp != null and slaveIp != ''">
and c.ip_addr = #{slaveIp}
</if>
2025-04-23 17:56:18 +08:00
<if test="type=='yx'">
and b.yx_addr = #{address}
</if>
<if test="type=='yc'">
and b.yc_addr = #{address}
</if>
2025-04-24 10:07:53 +08:00
limit 1
2025-04-23 17:56:18 +08:00
</select>
<!-- 查询辅控设备信号表-->
2025-04-24 10:49:36 +08:00
<select id="selectOneDeviceSignal" resultType="com.yfd.platform.modules.auxcontrol.domain.DeviceSignal">
2025-04-23 17:56:18 +08:00
SELECT
b.*
2025-04-24 10:49:36 +08:00
FROM
2025-04-24 10:07:53 +08:00
fk_meter_device a
2025-04-24 10:49:36 +08:00
JOIN fk_device_signal b ON ( a.device_id = b.meter_device_id )
JOIN fk_gateway_device c ON ( a.netdevice_ip = c.ip_addr )
WHERE
<if test="slaveIp != null and slaveIp != ''">
2025-04-27 10:51:38 +08:00
c.ip_addr = #{slaveIp}
2025-04-24 10:49:36 +08:00
</if>
2025-04-23 17:56:18 +08:00
<if test="type=='yx'">
and b.yx_addr = #{address}
</if>
<if test="type=='yc'">
and b.yc_addr = #{address}
</if>
2025-04-24 10:49:36 +08:00
limit 1
2025-04-23 17:56:18 +08:00
</select>
2025-04-27 10:51:38 +08:00
<select id="getDeviceSignalMaps" resultType="java.util.Map">
SELECT
fds.signal_id,
fds.signal_code,
fds.signal_name,
isc.main_device_id,
isc.main_device_name,
isc.component_id,
isc.component_name
FROM
fk_device_signal fds
INNER JOIN iis_substation_component isc ON isc.component_id = fds.main_compnent_id
WHERE 1=1
<if test="mainDeviceId != null and mainDeviceId != ''">
AND fds.main_device_id = #{mainDeviceId}
</if>
<if test="signalName != null and signalName != ''">
2025-04-27 18:15:00 +08:00
AND fds.signal_name LIKE CONCAT('%',#{signalName},'%')
2025-04-27 10:51:38 +08:00
</if>
</select>
2025-04-27 14:05:10 +08:00
<select id="selectDeviceSignalByIp" resultType="com.yfd.platform.modules.auxcontrol.domain.DeviceSignal">
SELECT
a.signal_id,
a.meter_device_id,
a.signal_name,
'' signal_unit,
a.yx_addr,
a.yc_addr,
CASE
WHEN b.STATUS = '01' THEN
'1' ELSE '0'
END yx_value
FROM
fk_device_signal a
JOIN fk_gateway_device b ON ( a.yx_addr = b.iec_addr )
WHERE
b.device_type = '30'
AND b.ip_addr = #{ip}
</select>
2025-04-27 18:15:00 +08:00
<select id="querySignalDataById" resultType="java.util.Map">
SELECT
fds.signal_id,
fds.signal_code,
fds.signal_type,
fds.signal_name,
fds.signal_unit,
fds.normal_range,
fds.ykyt_type,
fmd.device_model,
fgd.ip_addr,
fgd.Protocol,
fgd.frequency,
fgd.device_type
FROM
fk_device_signal fds
INNER JOIN fk_meter_device fmd ON fds.meter_device_id = fmd.device_id
INNER JOIN fk_gateway_device fgd ON fgd.ip_addr = fmd.netdevice_ip
WHERE signal_id =#{signalId}
LIMIT 1
</select>
2025-04-24 10:49:36 +08:00
2025-04-23 17:56:18 +08:00
</mapper>