SmartSubstationPlatform/riis-system/src/main/resources/mapper/auxcontrol/DeviceSignalMapper.xml
2025-04-24 10:49:36 +08:00

52 lines
1.6 KiB
XML

<?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">
<!-- 查询辅控设备信号表-->
<select id="selectDeviceSignalMap" resultType="java.util.Map">
SELECT
a.station_id,
a.systemcode,
a.device_name,
b.*
FROM
fk_meter_device a
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
1 =1
<if test="slaveIp != null and slaveIp != ''">
and c.ip_addr = #{slaveIp}
</if>
<if test="type=='yx'">
and b.yx_addr = #{address}
</if>
<if test="type=='yc'">
and b.yc_addr = #{address}
</if>
limit 1
</select>
<!-- 查询辅控设备信号表-->
<select id="selectOneDeviceSignal" resultType="com.yfd.platform.modules.auxcontrol.domain.DeviceSignal">
SELECT
b.*
FROM
fk_meter_device a
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 != ''">
c.ip_addr = #{slaveIp}
</if>
<if test="type=='yx'">
and b.yx_addr = #{address}
</if>
<if test="type=='yc'">
and b.yc_addr = #{address}
</if>
limit 1
</select>
</mapper>