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
a4c08983
Commit
a4c08983
authored
Aug 17, 2021
by
耿迪迪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
实时数据设备状态修改 gengdidi
parent
b8e9aa0a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
5 deletions
+47
-5
TDeviceReportDataMapper.xml
.../main/resources/mapper/system/TDeviceReportDataMapper.xml
+47
-5
No files found.
gassafety-system/src/main/resources/mapper/system/TDeviceReportDataMapper.xml
View file @
a4c08983
...
...
@@ -49,8 +49,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</sql>
<select
id=
"selectTDeviceReportDataList"
parameterType=
"DeviceReportDataForm"
resultMap=
"TDeviceReportDataResultVo"
>
select t.report_time, t.device_report_data_id, t.device_num, t.standard_condition_accumulation, t.working_condition_accumulation, t.residual_quantity, t.standard_condition_flow, t.working_condition_flow, t.temperature, t.pressure, t.communication_status, t.device_status, t.create_time, t.update_time,
d.device_id, d.device_name, d.device_code, d.device_type, d.device_model
select
t.report_time,
t.device_report_data_id,
t.device_num,
t.standard_condition_accumulation,
t.working_condition_accumulation,
t.residual_quantity,
t.standard_condition_flow,
t.working_condition_flow,
t.temperature,
t.pressure,
t.communication_status,
t.create_time,
t.update_time,
d.device_id,
d.device_name,
d.device_code,
d.device_type,
d.device_model,
CASE (SELECT COUNT(DISTINCT alarm.device_id) FROM t_device_alarm alarm WHERE alarm.device_id = d.device_id AND alarm.end_time IS NULL)
WHEN 0 THEN '正常'
ELSE '报警'
END as device_status
from t_device_report_data t
left join t_device_info d on t.device_num = d.iot_no
<where>
...
...
@@ -64,10 +85,31 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select
id=
"selectRealtimeDataList"
parameterType=
"DeviceReportDataForm"
resultMap=
"TDeviceReportDataResultVo"
>
select max(t.report_time) report_time, t.device_report_data_id, t.device_num, t.standard_condition_accumulation, t.working_condition_accumulation, t.residual_quantity, t.standard_condition_flow, t.working_condition_flow, t.temperature, t.pressure, t.communication_status, t.device_status, t.create_time, t.update_time,
d.device_id, d.device_name, d.device_code, d.device_type, d.device_model
select
max(t.report_time) report_time,
t.device_report_data_id,
t.device_num,
t.standard_condition_accumulation,
t.working_condition_accumulation,
t.residual_quantity,
t.standard_condition_flow,
t.working_condition_flow,
t.temperature,
t.pressure,
t.communication_status,
t.create_time,
t.update_time,
d.device_id,
d.device_name,
d.device_code,
d.device_type,
d.device_model,
CASE (SELECT COUNT(DISTINCT alarm.device_id) FROM t_device_alarm alarm WHERE alarm.device_id = d.device_id AND alarm.end_time IS NULL)
WHEN 0 THEN '正常'
ELSE '报警'
END as device_status
from t_device_report_data t
right join
t_device_info d on t.device_num = d.iot_no
LEFT JOIN
t_device_info d on t.device_num = d.iot_no
<where>
<if
test=
"deviceCode != null "
>
and d.device_code like concat('%',#{deviceCode},'%')
</if>
<if
test=
"deviceType != null "
>
and d.device_type = #{deviceType}
</if>
...
...
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