Commit cd8bfa85 authored by 王晓倩's avatar 王晓倩

报警信息详情折线图数据

parent 45986835
...@@ -2,10 +2,10 @@ package com.zehong.system.domain.vo; ...@@ -2,10 +2,10 @@ package com.zehong.system.domain.vo;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.zehong.common.core.domain.BaseEntity; import com.zehong.common.core.domain.BaseEntity;
import com.zehong.system.domain.TDeviceInfo; import com.zehong.system.domain.TDeviceReportData;
import com.zehong.system.domain.TPipe;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
* 报警信息对象 t_device_alarm * 报警信息对象 t_device_alarm
...@@ -35,6 +35,9 @@ public class DeviceAlarmVo extends BaseEntity ...@@ -35,6 +35,9 @@ public class DeviceAlarmVo extends BaseEntity
/** 物联网编号 */ /** 物联网编号 */
private String iotNo; private String iotNo;
/** 设备监控数据列表(用于详情折线图) */
private List<TDeviceReportData> deviceReportDataList;
/** 工单id */ /** 工单id */
private String orderId; private String orderId;
...@@ -107,6 +110,14 @@ public class DeviceAlarmVo extends BaseEntity ...@@ -107,6 +110,14 @@ public class DeviceAlarmVo extends BaseEntity
this.iotNo = iotNo; this.iotNo = iotNo;
} }
public List<TDeviceReportData> getDeviceReportDataList() {
return deviceReportDataList;
}
public void setDeviceReportDataList(List<TDeviceReportData> deviceReportDataList) {
this.deviceReportDataList = deviceReportDataList;
}
public void setOrderId(String orderId) public void setOrderId(String orderId)
{ {
this.orderId = orderId; this.orderId = orderId;
......
...@@ -29,6 +29,14 @@ public interface TDeviceReportDataMapper ...@@ -29,6 +29,14 @@ public interface TDeviceReportDataMapper
*/ */
public List<TDeviceReportData> getTDeviceReportDataList(String deviceNum); public List<TDeviceReportData> getTDeviceReportDataList(String deviceNum);
/**
* 查询设备监控列表
*
* @param tDeviceReportData 设备监控
* @return 设备监控集合
*/
public List<TDeviceReportData> getAlarmDeviceReportDataList(TDeviceReportData tDeviceReportData);
/** /**
* 查询设备监控列表 * 查询设备监控列表
* *
......
...@@ -7,10 +7,12 @@ import com.zehong.common.core.domain.entity.SysDictData; ...@@ -7,10 +7,12 @@ import com.zehong.common.core.domain.entity.SysDictData;
import com.zehong.common.utils.DateUtils; import com.zehong.common.utils.DateUtils;
import com.zehong.common.utils.StringUtils; import com.zehong.common.utils.StringUtils;
import com.zehong.system.domain.TDeviceInfo; import com.zehong.system.domain.TDeviceInfo;
import com.zehong.system.domain.TDeviceReportData;
import com.zehong.system.domain.TPipe; import com.zehong.system.domain.TPipe;
import com.zehong.system.domain.form.DeviceAlarmForm; import com.zehong.system.domain.form.DeviceAlarmForm;
import com.zehong.system.domain.vo.DeviceAlarmVo; import com.zehong.system.domain.vo.DeviceAlarmVo;
import com.zehong.system.mapper.TDeviceInfoMapper; import com.zehong.system.mapper.TDeviceInfoMapper;
import com.zehong.system.mapper.TDeviceReportDataMapper;
import com.zehong.system.mapper.TPipeMapper; import com.zehong.system.mapper.TPipeMapper;
import com.zehong.system.service.ISysDictTypeService; import com.zehong.system.service.ISysDictTypeService;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
...@@ -35,6 +37,8 @@ public class TDeviceAlarmServiceImpl implements ITDeviceAlarmService ...@@ -35,6 +37,8 @@ public class TDeviceAlarmServiceImpl implements ITDeviceAlarmService
private TDeviceInfoMapper tDeviceInfoMapper; private TDeviceInfoMapper tDeviceInfoMapper;
@Autowired @Autowired
private TPipeMapper tPipeMapper; private TPipeMapper tPipeMapper;
@Autowired
private TDeviceReportDataMapper tDeviceReportDataMapper;
@Autowired @Autowired
private ISysDictTypeService iSysDictTypeService; private ISysDictTypeService iSysDictTypeService;
...@@ -70,6 +74,16 @@ public class TDeviceAlarmServiceImpl implements ITDeviceAlarmService ...@@ -70,6 +74,16 @@ public class TDeviceAlarmServiceImpl implements ITDeviceAlarmService
deviceAlarmVo.setDeviceCode(deviceInfo.getDeviceCode()); deviceAlarmVo.setDeviceCode(deviceInfo.getDeviceCode());
deviceAlarmVo.setDeviceName(deviceInfo.getDeviceName()); deviceAlarmVo.setDeviceName(deviceInfo.getDeviceName());
deviceAlarmVo.setIotNo(deviceInfo.getIotNo()); deviceAlarmVo.setIotNo(deviceInfo.getIotNo());
// 查询当前设备开始报警时间前后一小时的数据
TDeviceReportData tDeviceReportData = new TDeviceReportData();
tDeviceReportData.setDeviceNum(deviceInfo.getIotNo());
tDeviceReportData.setReportTime(tDeviceAlarm.getStartTime());
List<TDeviceReportData> deviceReportDataList = tDeviceReportDataMapper.getAlarmDeviceReportDataList(tDeviceReportData);
if(deviceReportDataList.size() != 0) {
deviceAlarmVo.setDeviceReportDataList(deviceReportDataList);
}
} }
return deviceAlarmVo; return deviceAlarmVo;
......
...@@ -91,6 +91,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -91,6 +91,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where device_num = #{deviceNum} and report_time &gt;= DATE_SUB(NOW(),INTERVAL 2 HOUR) where device_num = #{deviceNum} and report_time &gt;= DATE_SUB(NOW(),INTERVAL 2 HOUR)
</select> </select>
<select id="getAlarmDeviceReportDataList" parameterType="TDeviceReportData" resultMap="TDeviceReportDataResult">
select report_time, device_report_data_id, device_num, standard_condition_accumulation, working_condition_accumulation, residual_quantity, standard_condition_flow, working_condition_flow, temperature, pressure, communication_status, device_status, create_time, update_time
from t_device_report_data
where device_num = #{deviceNum} and report_time &gt;= DATE_SUB(#{reportTime},INTERVAL 1 HOUR)
</select>
<insert id="insertTDeviceReportData" parameterType="TDeviceReportData" useGeneratedKeys="true" keyProperty="deviceReportDataId"> <insert id="insertTDeviceReportData" parameterType="TDeviceReportData" useGeneratedKeys="true" keyProperty="deviceReportDataId">
insert into t_device_report_data insert into t_device_report_data
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment