59 lines
1.8 KiB
XML
59 lines
1.8 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.DeviceWorkDataMapper">
|
|
|
|
<select id="getDeviceWorkDataPage" resultType="com.yfd.platform.modules.auxcontrol.domain.DeviceWorkData">
|
|
SELECT
|
|
station_id,
|
|
device_id,
|
|
systemcode,
|
|
device_name,
|
|
signal_id,
|
|
signal_name,
|
|
`value`,
|
|
unit,
|
|
start_time
|
|
FROM
|
|
fk_device_work_data
|
|
WHERE 1=1
|
|
<if test="signalId != null and signalId != ''">
|
|
AND signal_id=#{signalId}
|
|
</if>
|
|
|
|
<if test="startDate != null and startDate != ''">
|
|
AND start_time >= #{startDate}
|
|
</if>
|
|
<if test="endDate != null and endDate != ''">
|
|
AND start_time <= #{endDate}
|
|
</if>
|
|
ORDER BY start_time DESC
|
|
|
|
</select>
|
|
<select id="getHistoricalCurve" resultType="com.yfd.platform.modules.auxcontrol.domain.DeviceWorkData">
|
|
SELECT
|
|
start_time,
|
|
`value`,
|
|
unit
|
|
FROM
|
|
fk_device_work_data
|
|
WHERE
|
|
signal_id=#{signalId}
|
|
AND start_time >= NOW() - INTERVAL 1 HOUR
|
|
ORDER BY
|
|
start_time DESC
|
|
</select>
|
|
<select id="getDeviceWorkData" resultType="java.util.Map">
|
|
SELECT
|
|
ds.signal_id,
|
|
ds.signal_code itemcode,
|
|
ds.signal_name dictname,
|
|
COALESCE ( ds.yc_value, '无' ) AS value,
|
|
ds.signal_unit unit
|
|
FROM
|
|
fk_device_signal ds
|
|
INNER JOIN iis_substation_component sc ON ds.main_component_id = sc.component_id
|
|
WHERE
|
|
sc.component_name = '微气象设备部件'
|
|
</select>
|
|
</mapper>
|