Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gassafety
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
耿迪迪
gassafety
Commits
cd8bfa85
Commit
cd8bfa85
authored
Aug 12, 2021
by
王晓倩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
报警信息详情折线图数据
parent
45986835
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
2 deletions
+41
-2
DeviceAlarmVo.java
.../main/java/com/zehong/system/domain/vo/DeviceAlarmVo.java
+13
-2
TDeviceReportDataMapper.java
...ava/com/zehong/system/mapper/TDeviceReportDataMapper.java
+8
-0
TDeviceAlarmServiceImpl.java
...m/zehong/system/service/impl/TDeviceAlarmServiceImpl.java
+14
-0
TDeviceReportDataMapper.xml
.../main/resources/mapper/system/TDeviceReportDataMapper.xml
+6
-0
No files found.
gassafety-system/src/main/java/com/zehong/system/domain/vo/DeviceAlarmVo.java
View file @
cd8bfa85
...
...
@@ -2,10 +2,10 @@ package com.zehong.system.domain.vo;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.zehong.common.core.domain.BaseEntity
;
import
com.zehong.system.domain.TDeviceInfo
;
import
com.zehong.system.domain.TPipe
;
import
com.zehong.system.domain.TDeviceReportData
;
import
java.util.Date
;
import
java.util.List
;
/**
* 报警信息对象 t_device_alarm
...
...
@@ -35,6 +35,9 @@ public class DeviceAlarmVo extends BaseEntity
/** 物联网编号 */
private
String
iotNo
;
/** 设备监控数据列表(用于详情折线图) */
private
List
<
TDeviceReportData
>
deviceReportDataList
;
/** 工单id */
private
String
orderId
;
...
...
@@ -107,6 +110,14 @@ public class DeviceAlarmVo extends BaseEntity
this
.
iotNo
=
iotNo
;
}
public
List
<
TDeviceReportData
>
getDeviceReportDataList
()
{
return
deviceReportDataList
;
}
public
void
setDeviceReportDataList
(
List
<
TDeviceReportData
>
deviceReportDataList
)
{
this
.
deviceReportDataList
=
deviceReportDataList
;
}
public
void
setOrderId
(
String
orderId
)
{
this
.
orderId
=
orderId
;
...
...
gassafety-system/src/main/java/com/zehong/system/mapper/TDeviceReportDataMapper.java
View file @
cd8bfa85
...
...
@@ -29,6 +29,14 @@ public interface TDeviceReportDataMapper
*/
public
List
<
TDeviceReportData
>
getTDeviceReportDataList
(
String
deviceNum
);
/**
* 查询设备监控列表
*
* @param tDeviceReportData 设备监控
* @return 设备监控集合
*/
public
List
<
TDeviceReportData
>
getAlarmDeviceReportDataList
(
TDeviceReportData
tDeviceReportData
);
/**
* 查询设备监控列表
*
...
...
gassafety-system/src/main/java/com/zehong/system/service/impl/TDeviceAlarmServiceImpl.java
View file @
cd8bfa85
...
...
@@ -7,10 +7,12 @@ import com.zehong.common.core.domain.entity.SysDictData;
import
com.zehong.common.utils.DateUtils
;
import
com.zehong.common.utils.StringUtils
;
import
com.zehong.system.domain.TDeviceInfo
;
import
com.zehong.system.domain.TDeviceReportData
;
import
com.zehong.system.domain.TPipe
;
import
com.zehong.system.domain.form.DeviceAlarmForm
;
import
com.zehong.system.domain.vo.DeviceAlarmVo
;
import
com.zehong.system.mapper.TDeviceInfoMapper
;
import
com.zehong.system.mapper.TDeviceReportDataMapper
;
import
com.zehong.system.mapper.TPipeMapper
;
import
com.zehong.system.service.ISysDictTypeService
;
import
org.springframework.beans.BeanUtils
;
...
...
@@ -35,6 +37,8 @@ public class TDeviceAlarmServiceImpl implements ITDeviceAlarmService
private
TDeviceInfoMapper
tDeviceInfoMapper
;
@Autowired
private
TPipeMapper
tPipeMapper
;
@Autowired
private
TDeviceReportDataMapper
tDeviceReportDataMapper
;
@Autowired
private
ISysDictTypeService
iSysDictTypeService
;
...
...
@@ -70,6 +74,16 @@ public class TDeviceAlarmServiceImpl implements ITDeviceAlarmService
deviceAlarmVo
.
setDeviceCode
(
deviceInfo
.
getDeviceCode
());
deviceAlarmVo
.
setDeviceName
(
deviceInfo
.
getDeviceName
());
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
;
...
...
gassafety-system/src/main/resources/mapper/system/TDeviceReportDataMapper.xml
View file @
cd8bfa85
...
...
@@ -91,6 +91,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where device_num = #{deviceNum} and report_time
>
= DATE_SUB(NOW(),INTERVAL 2 HOUR)
</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
>
= DATE_SUB(#{reportTime},INTERVAL 1 HOUR)
</select>
<insert
id=
"insertTDeviceReportData"
parameterType=
"TDeviceReportData"
useGeneratedKeys=
"true"
keyProperty=
"deviceReportDataId"
>
insert into t_device_report_data
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment