|
|
|
@ -7,7 +7,7 @@
|
|
|
|
|
|
|
|
|
|
<select id="queryPram" resultType="com.haiwei.manage.domain.ParamVo">
|
|
|
|
|
SELECT order_by,
|
|
|
|
|
ee.point_name as name,
|
|
|
|
|
ee.point_name as name,
|
|
|
|
|
location_x,
|
|
|
|
|
location_y,
|
|
|
|
|
info.PointName as pointname,
|
|
|
|
@ -20,7 +20,8 @@
|
|
|
|
|
) ld on ld.PID = ed.PID and ld.LatestTime = CreateTime
|
|
|
|
|
right join EPointsInfo info on ed.PID = info.ID
|
|
|
|
|
left join base_point_info ee on ee.objid = info.EID
|
|
|
|
|
where ee.device_name = #{deviceName} order by order_by
|
|
|
|
|
where ee.device_name = #{deviceName}
|
|
|
|
|
order by order_by
|
|
|
|
|
</select>
|
|
|
|
|
<select id="queryDeviceState" resultType="com.haiwei.manage.domain.DeviceState">
|
|
|
|
|
select case
|
|
|
|
@ -32,7 +33,7 @@
|
|
|
|
|
else '停机'
|
|
|
|
|
end
|
|
|
|
|
end as state,
|
|
|
|
|
'一体机' as name
|
|
|
|
|
'一体机' as name
|
|
|
|
|
from EEquipmentState
|
|
|
|
|
where ID = #{param2}
|
|
|
|
|
union
|
|
|
|
@ -45,79 +46,88 @@
|
|
|
|
|
else '停机'
|
|
|
|
|
end
|
|
|
|
|
end as state,
|
|
|
|
|
'切刀' as name
|
|
|
|
|
'切刀' as name
|
|
|
|
|
from EEquipmentState
|
|
|
|
|
where ID = #{param4}
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="queryPramList" resultType="com.haiwei.manage.domain.RecordRaramData">
|
|
|
|
|
select *
|
|
|
|
|
from (SELECT ee.point_name + info.PointName as pointname, ed.Data as data, CONVERT(varchar, ed.CreateTime, 120) time
|
|
|
|
|
from (SELECT ee.point_name + info.PointName as pointname, ed.Data as data, CONVERT(varchar, ed.CreateTime, 120)
|
|
|
|
|
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 info.Status = 1) a PIVOT (max(data) FOR pointname IN ( 一体机A转速, 一体机A电流, 一体机A切刀转速, 一体机A切刀电流, 一体机A机头温度, 一体机A机头压力 )) t
|
|
|
|
|
|
|
|
|
|
<where>
|
|
|
|
|
<if test="beginTime !=null and endTime !=null">
|
|
|
|
|
time between #{beginTime} and #{endTime}
|
|
|
|
|
ed.CreateTime between #{beginTime} and #{endTime}
|
|
|
|
|
</if>
|
|
|
|
|
</where>
|
|
|
|
|
) a PIVOT (max(data) FOR pointname IN ( 一体机A转速, 一体机A电流, 一体机A切刀转速, 一体机A切刀电流, 一体机A机头温度, 一体机A机头压力 )) t
|
|
|
|
|
|
|
|
|
|
</select>
|
|
|
|
|
<select id="queryPramList_B" resultType="com.haiwei.manage.domain.RecordRaramDataB">
|
|
|
|
|
select *
|
|
|
|
|
from (SELECT ee.point_name + info.PointName as pointname, ed.Data as data, CONVERT(varchar, ed.CreateTime, 120) time
|
|
|
|
|
from (SELECT ee.point_name + info.PointName as pointname, ed.Data as data, CONVERT(varchar, ed.CreateTime, 120)
|
|
|
|
|
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 info.Status = 1) a PIVOT (max(data) FOR pointname IN ( 一体机B转速, 一体机B电流, 一体机B切刀转速, 一体机B切刀电流, 一体机B机头温度, 一体机B机头压力 )) t
|
|
|
|
|
<where>
|
|
|
|
|
<if test="beginTime !=null and endTime !=null">
|
|
|
|
|
time between #{beginTime} and #{endTime}
|
|
|
|
|
ed.CreateTime between #{beginTime} and #{endTime}
|
|
|
|
|
</if>
|
|
|
|
|
</where>
|
|
|
|
|
</select>
|
|
|
|
|
) a PIVOT (max(data) FOR pointname IN ( 一体机B转速, 一体机B电流, 一体机B切刀转速, 一体机B切刀电流, 一体机B机头温度, 一体机B机头压力 )) t
|
|
|
|
|
|
|
|
|
|
<select id="queryParamData" resultType="com.haiwei.manage.domain.RecordRaramData">
|
|
|
|
|
WITH CTE AS (
|
|
|
|
|
SELECT ROW_NUMBER() OVER (ORDER BY time) AS row_num,*
|
|
|
|
|
from (SELECT ee.point_name + info.PointName as pointname, ed.Data as data, CONVERT(varchar, ed.CreateTime, 120) 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 info.Status = 1) a PIVOT (max(data) FOR pointname IN ( 一体机A转速, 一体机A电流, 一体机A切刀转速, 一体机A切刀电流, 一体机A机头温度, 一体机A机头压力 )) t
|
|
|
|
|
<where>
|
|
|
|
|
<if test="beginTime !=null and endTime !=null">
|
|
|
|
|
time between #{beginTime} and #{endTime}
|
|
|
|
|
</if>
|
|
|
|
|
</where>
|
|
|
|
|
)
|
|
|
|
|
SELECT *
|
|
|
|
|
FROM CTE
|
|
|
|
|
WHERE row_num % #{timeInterval} = 0
|
|
|
|
|
ORDER BY row_num;
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="queryParamData_B" resultType="com.haiwei.manage.domain.RecordRaramDataB">
|
|
|
|
|
WITH CTE AS (
|
|
|
|
|
SELECT ROW_NUMBER() OVER (ORDER BY time) AS row_num,*
|
|
|
|
|
from (SELECT ee.point_name + info.PointName as pointname, ed.Data as data, CONVERT(varchar, ed.CreateTime, 120) 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 info.Status = 1) a PIVOT (max(data) FOR pointname IN ( 一体机B转速, 一体机B电流, 一体机B切刀转速, 一体机B切刀电流, 一体机B机头温度, 一体机B机头压力 )) t
|
|
|
|
|
<where>
|
|
|
|
|
<if test="beginTime !=null and endTime !=null">
|
|
|
|
|
time between #{beginTime} and #{endTime}
|
|
|
|
|
</if>
|
|
|
|
|
</where>
|
|
|
|
|
)
|
|
|
|
|
SELECT *
|
|
|
|
|
FROM CTE
|
|
|
|
|
WHERE row_num % #{timeInterval} = 0
|
|
|
|
|
ORDER BY row_num;
|
|
|
|
|
<select id="queryParamData" resultType="com.haiwei.manage.domain.RecordRaramData">
|
|
|
|
|
WITH CTE AS (
|
|
|
|
|
SELECT ROW_NUMBER() OVER (ORDER BY time) AS row_num,*
|
|
|
|
|
from (SELECT ee.point_name + info.PointName as pointname, ed.Data as data, CONVERT(varchar, ed.CreateTime, 120)
|
|
|
|
|
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>
|
|
|
|
|
<if test="beginTime !=null and endTime !=null">
|
|
|
|
|
ed.CreateTime between #{beginTime} and #{endTime}
|
|
|
|
|
</if>
|
|
|
|
|
</where>
|
|
|
|
|
) a PIVOT (max(data) FOR pointname IN ( 一体机A转速, 一体机A电流, 一体机A切刀转速, 一体机A切刀电流, 一体机A机头温度, 一体机A机头压力 )) t
|
|
|
|
|
|
|
|
|
|
)
|
|
|
|
|
SELECT *
|
|
|
|
|
FROM CTE
|
|
|
|
|
WHERE row_num % #{timeInterval} = 0
|
|
|
|
|
ORDER BY row_num;
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="queryParamData_B" resultType="com.haiwei.manage.domain.RecordRaramDataB">
|
|
|
|
|
WITH CTE AS (
|
|
|
|
|
SELECT ROW_NUMBER() OVER (ORDER BY time) AS row_num,*
|
|
|
|
|
from (SELECT ee.point_name + info.PointName as pointname, ed.Data as data, CONVERT(varchar, ed.CreateTime, 120)
|
|
|
|
|
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>
|
|
|
|
|
<if test="beginTime !=null and endTime !=null">
|
|
|
|
|
ed.CreateTime between #{beginTime} and #{endTime}
|
|
|
|
|
</if>
|
|
|
|
|
</where>
|
|
|
|
|
|
|
|
|
|
) a PIVOT (max(data) FOR pointname IN ( 一体机B转速, 一体机B电流, 一体机B切刀转速, 一体机B切刀电流, 一体机B机头温度, 一体机B机头压力 )) t
|
|
|
|
|
|
|
|
|
|
)
|
|
|
|
|
SELECT *
|
|
|
|
|
FROM CTE
|
|
|
|
|
WHERE row_num % #{timeInterval} = 0
|
|
|
|
|
ORDER BY row_num;
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</mapper>
|
|
|
|
|