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

59 lines
1.8 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.DeviceWorkDataMapper">
2025-04-27 18:15:00 +08:00
<select id="getDeviceWorkDataPage" resultType="com.yfd.platform.modules.auxcontrol.domain.DeviceWorkData">
SELECT
station_id,
device_id,
2025-05-12 14:35:37 +08:00
systemcode,
2025-04-27 18:15:00 +08:00
device_name,
signal_id,
signal_name,
`value`,
unit,
start_time
FROM
fk_device_work_data
WHERE 1=1
2025-05-12 14:35:37 +08:00
<if test="signalId != null and signalId != ''">
AND signal_id=#{signalId}
</if>
2025-04-27 18:15:00 +08:00
<if test="startDate != null and startDate != ''">
AND start_time &gt;= #{startDate}
</if>
<if test="endDate != null and endDate != ''">
AND start_time &lt;= #{endDate}
</if>
ORDER BY start_time DESC
</select>
2025-04-28 11:56:16 +08:00
<select id="getHistoricalCurve" resultType="com.yfd.platform.modules.auxcontrol.domain.DeviceWorkData">
SELECT
start_time,
`value`,
unit
FROM
fk_device_work_data
WHERE
2025-04-28 15:43:54 +08:00
signal_id=#{signalId}
2025-04-28 11:56:16 +08:00
AND start_time >= NOW() - INTERVAL 1 HOUR
ORDER BY
start_time DESC
</select>
2025-05-09 17:27:09 +08:00
<select id="getDeviceWorkData" resultType="java.util.Map">
SELECT
2025-05-13 10:49:06 +08:00
ds.signal_id,
ds.signal_code itemcode,
ds.signal_name dictname,
COALESCE ( ds.yc_value, '无' ) AS value,
ds.signal_unit unit
2025-05-09 17:27:09 +08:00
FROM
2025-05-13 10:49:06 +08:00
fk_device_signal ds
INNER JOIN iis_substation_component sc ON ds.main_component_id = sc.component_id
2025-05-09 17:27:09 +08:00
WHERE
2025-05-13 10:49:06 +08:00
sc.component_name = '微气象设备部件'
2025-05-09 17:27:09 +08:00
</select>
2025-04-23 17:56:18 +08:00
</mapper>