|
|
|
@ -34,31 +34,37 @@
|
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
<select id="selectRecordPiontDataList" parameterType="RecordPiontData" resultMap="RecordPiontDataResult">
|
|
|
|
|
SELECT record_time,
|
|
|
|
|
MAX(CASE WHEN pointname = '一体机A转速' THEN data END) AS speed_a,
|
|
|
|
|
MAX(CASE WHEN pointname = '一体机A电流' THEN data END) AS current_a,
|
|
|
|
|
MAX(CASE WHEN pointname = '一体机A切刀转速' THEN data END) AS speed_cutter,
|
|
|
|
|
MAX(CASE WHEN pointname = '一体机A切刀电流' THEN data END) AS current_cutter,
|
|
|
|
|
MAX(CASE WHEN pointname = '一体机A机头温度' THEN data END) AS temp_head,
|
|
|
|
|
MAX(CASE WHEN pointname = '一体机A机头压力' THEN data END) AS pressure_head
|
|
|
|
|
select *
|
|
|
|
|
from (SELECT row_number() over (order by record_time asc) AS row_num,
|
|
|
|
|
record_time,
|
|
|
|
|
MAX(CASE WHEN pointname = #{device}+'转速' THEN data END) AS speed_a,
|
|
|
|
|
MAX(CASE WHEN pointname = #{device}+'电流' THEN data END) AS current_a,
|
|
|
|
|
MAX(CASE WHEN pointname = #{device}+'切刀转速' THEN data END) AS speed_cutter,
|
|
|
|
|
MAX(CASE WHEN pointname = #{device}+'切刀电流' THEN data END) AS current_cutter,
|
|
|
|
|
MAX(CASE WHEN pointname = #{device}+'机头温度' THEN data END) AS temp_head,
|
|
|
|
|
MAX(CASE WHEN pointname = #{device}+'机头压力' THEN data END) AS pressure_head
|
|
|
|
|
FROM (
|
|
|
|
|
SELECT ee.point_name + info.PointName AS pointname,
|
|
|
|
|
ed.Data AS data,
|
|
|
|
|
SELECT ee.point_name + info.PointName AS pointname,
|
|
|
|
|
ed.Data AS data,
|
|
|
|
|
CONVERT(VARCHAR, ed.CreateTime, 120) AS record_time
|
|
|
|
|
FROM EPointData ed
|
|
|
|
|
RIGHT JOIN EPointsInfo info ON ed.PID = info.ID
|
|
|
|
|
LEFT JOIN base_point_info ee ON ee.objid = info.EID
|
|
|
|
|
<where>
|
|
|
|
|
|
|
|
|
|
<where>device_name=#{deviceName}
|
|
|
|
|
<if test="params.beginRecordTime != null and params.beginRecordTime != '' and params.endRecordTime != null and params.endRecordTime != ''">
|
|
|
|
|
and ed.CreateTime between #{params.beginRecordTime} and #{params.endRecordTime}
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
|
|
</where> ) a
|
|
|
|
|
GROUP BY record_time
|
|
|
|
|
|
|
|
|
|
GROUP BY record_time) table_b
|
|
|
|
|
<where>
|
|
|
|
|
<if test="timeInterval != 1">
|
|
|
|
|
row_num % #{timeInterval} = 0
|
|
|
|
|
</if>
|
|
|
|
|
</where>
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<select id="selectRecordPiontDataById" parameterType="Long" resultMap="RecordPiontDataResult">
|
|
|
|
|
<include refid="selectRecordPiontDataVo"/>
|
|
|
|
|
where objid = #{objid}
|
|
|
|
|