修改 实验报告 时间间隔

master
wangh 6 months ago
parent 39d7f681d8
commit ecafd631ca

@ -48,7 +48,9 @@ public class RecordPiontDataController extends BaseController
@ResponseBody
public TableDataInfo list(RecordPiontData recordPiontData)
{
System.out.println(recordPiontData.getDeviceName());
String deviceName = recordPiontData.getDeviceName();
int length = deviceName.length();
recordPiontData.setDevice(deviceName.substring(length -4,length));
System.out.println(recordPiontData.getTimeInterval());
startPage();
List<RecordPiontData> list = recordPiontDataService.selectRecordPiontDataList(recordPiontData);

@ -63,8 +63,17 @@ public class RecordPiontData extends BaseEntity {
@Excel(name = "机头压力")
private Double pressureHead;
private String deviceName;
private String device;
private int timeInterval;
public String getDevice() {
return device;
}
public void setDevice(String device) {
this.device = device;
}
public String getDeviceName() {
return deviceName;
}

@ -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}

@ -11,35 +11,35 @@
<div class="select-list">
<ul>
<li>
<label class="col-sm-3 control-label">设备名称:</label>
<div class="col-sm-9">
<select class="form-control" name="deviceName">
<label>设备名称:</label>
<select name="deviceName" style="width: 100px">
<option th:text="60型一体机A" value="60型一体机A"></option>
<option th:text="60型一体机B" value="60型一体机B"></option>
</select>
</div>
</li>
<li>
<label class="col-sm-3 control-label">时间间隔:</label>
<div class="col-sm-9">
<select class="form-control" name="timeInterval">
<label >时间间隔:</label>
<select name="timeInterval" style="width: 70px">
<option value="1">不使用</option>
<option value="2">10秒</option>
<option value="3">15秒</option>
<option value="12">60秒</option>
</select>
</div>
</li>
<li class="select-time">
<label>采集时间:</label>
<input type="text" class="select-time" id="startTime" placeholder="开始时间"
name="params[beginRecordTime]" style="width: 150px"/>
name="params[beginRecordTime]" style="width: 140px"/>
<span>-</span>
<input type="text" class="select-time" id="endTime" placeholder="结束时间"
name="params[endRecordTime]" style="width: 150px"/>
name="params[endRecordTime]" style="width: 140px"/>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="queryData()"><i

@ -19,7 +19,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectOnlineVo">
select sessionId, login_name, dept_name, ipaddr, login_location, browser, os, status, start_timestamp, last_access_time, expire_time
select top 1 sessionId, login_name, dept_name, ipaddr, login_location, browser, os, status, start_timestamp, last_access_time, expire_time
from sys_user_online
</sql>

Loading…
Cancel
Save