Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
YeeAmosFireAutoSysRoot
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
station
YeeAmosFireAutoSysRoot
Commits
868da7b6
Commit
868da7b6
authored
Dec 11, 2020
by
zhengjiawei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sql修改,实时监控
parent
83940d09
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
51 deletions
+24
-51
dbTemplate_fire_equip.xml
...rt/src/main/resources/db/mapper/dbTemplate_fire_equip.xml
+24
-51
No files found.
YeeAmosFireAutoSysStart/src/main/resources/db/mapper/dbTemplate_fire_equip.xml
View file @
868da7b6
...
@@ -115,27 +115,13 @@
...
@@ -115,27 +115,13 @@
<select
id=
"queryForFireEquipmentHistoryCount"
resultType=
"long"
>
<select
id=
"queryForFireEquipmentHistoryCount"
resultType=
"long"
>
SELECT
count(1)
FROM
(
SELECT
(
SELECT
SELECT
fe.`name`
count(1)
FROM
FROM
f_fire_equipment fe
WHERE
fe.id = ed.fire_equipment_id
) fireEquipmentName,
(
(
SELECT
SELECT
fe.`code`
det.`name` as fireEquipmentName,
FROM
spe.`code` as fireEquipmentCode,
f_fire_equipment fe
WHERE
fe.id = ed.fire_equipment_id
) fireEquipmentCode,
(
(
SELECT
SELECT
group_concat(DISTINCT f.`name`)
group_concat(DISTINCT f.`name`)
...
@@ -143,11 +129,13 @@
...
@@ -143,11 +129,13 @@
f_equipment_fire_equipment efe
f_equipment_fire_equipment efe
JOIN f_equipment f ON efe.equipment_id = f.id
JOIN f_equipment f ON efe.equipment_id = f.id
WHERE
WHERE
efe.fire_equipment_id =
ed.fire_equipment
_id
efe.fire_equipment_id =
ind.equipment_specific
_id
) equipmentName,
) equipmentName,
ed.cre
ate_date
ind.upd
ate_date
FROM
FROM
f_fire_equipment_data ed
wl_equipment_specific_index ind
left join wl_equipment_specific as spe on spe.id = ind.equipment_specific_id
left join wl_equipment_detail as det on spe.equipment_detail_id = det.id
) d
) d
WHERE
WHERE
1 = 1
1 = 1
...
@@ -158,7 +146,7 @@
...
@@ -158,7 +146,7 @@
AND d.equipmentName LIKE '%${equipmentName}%'
AND d.equipmentName LIKE '%${equipmentName}%'
</if>
</if>
<if
test=
"startTime!=null"
>
<if
test=
"startTime!=null"
>
AND d.
cre
ate_date BETWEEN '${startTime}' AND '${endTime}'
AND d.
upd
ate_date BETWEEN '${startTime}' AND '${endTime}'
</if>
</if>
</select>
</select>
...
@@ -169,31 +157,13 @@
...
@@ -169,31 +157,13 @@
FROM
FROM
(
(
SELECT
SELECT
(
det.`name` as fireEquipmentName,
SELECT
spe.`code` as fireEquipmentCode,
fe.`name`
ein.name,
FROM
CASE ind.value WHEN 'true' THEN '是'
f_fire_equipment fe
WHEN 'false' THEN '否'
WHERE
ELSE ind.value END 'e_value',
fe.id = ed.fire_equipment_id
ein.unit,
) fireEquipmentName,
(
SELECT
fe.`code`
FROM
f_fire_equipment fe
WHERE
fe.id = ed.fire_equipment_id
) fireEquipmentCode,
ed.eq_point_name,
CASE ed.e_value WHEN 'true' THEN '合'
WHEN 'false' THEN '分'
ELSE ed.e_value END 'e_value',
ed.eq_point_unit,
case
when ed.soe = '1' then '报警'
when ed.soe = '0' then '监测'
end soe,
(
(
SELECT
SELECT
group_concat(DISTINCT f.`name`)
group_concat(DISTINCT f.`name`)
...
@@ -201,11 +171,14 @@
...
@@ -201,11 +171,14 @@
f_equipment_fire_equipment efe
f_equipment_fire_equipment efe
JOIN f_equipment f ON efe.equipment_id = f.id
JOIN f_equipment f ON efe.equipment_id = f.id
WHERE
WHERE
efe.fire_equipment_id =
ed.fire_equipment
_id
efe.fire_equipment_id =
ind.equipment_specific
_id
) equipmentName,
) equipmentName,
ed.cre
ate_date
ind.upd
ate_date
FROM
FROM
f_fire_equipment_data ed
wl_equipment_specific_index as ind
left join wl_equipment_specific as spe on spe.id = ind.equipment_specific_id
left join wl_equipment_detail as det on spe.equipment_detail_id = det.id
left join wl_equipment_index as ein on ind.equipment_index_id = ein.id
) d
) d
WHERE
WHERE
1 = 1
1 = 1
...
@@ -216,9 +189,9 @@
...
@@ -216,9 +189,9 @@
AND d.equipmentName LIKE '%${equipmentName}%'
AND d.equipmentName LIKE '%${equipmentName}%'
</if>
</if>
<if
test=
"startTime!=null"
>
<if
test=
"startTime!=null"
>
AND d.
cre
ate_date BETWEEN '${startTime}' AND '${endTime}'
AND d.
upd
ate_date BETWEEN '${startTime}' AND '${endTime}'
</if>
</if>
ORDER BY d.
cre
ate_date desc
ORDER BY d.
upd
ate_date desc
LIMIT ${start},${length}
LIMIT ${start},${length}
</select>
</select>
...
...
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