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

73 lines
2.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 != ''">
fds.signal_name LIKE CONCAT('',#{signalName},'')
</if>
</select>
2025-04-24 10:49:36 +08:00
2025-04-23 17:56:18 +08:00
</mapper>