Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
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
项目统一框架
amos-boot-biz
Commits
f4a9ecae
Commit
f4a9ecae
authored
Jul 29, 2022
by
KeYong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改bug
parent
2c86bdef
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
79 additions
and
87 deletions
+79
-87
view_all.sql
...stem-equip/src/main/resources/changelog/init/view_all.sql
+79
-87
EquipmentSpecificAlarmMapper.xml
...rc/main/resources/mapper/EquipmentSpecificAlarmMapper.xml
+0
-0
No files found.
amos-boot-system-equip/src/main/resources/changelog/init/view_all.sql
View file @
f4a9ecae
...
...
@@ -7450,100 +7450,93 @@ WHERE
DROP
VIEW
IF
EXISTS
`v_fire_equip_alarm_fss_top5_3small`
;
CREATE
ALGORITHM
=
UNDEFINED
DEFINER
=
`root`
@
`%`
SQL
SECURITY
DEFINER
VIEW
`v_fire_equip_alarm_fss_top5_3small`
AS
SELECT
ifnull
(
`a`
.
`fightSysName`
,
NULL
)
AS
`fightSysName`
,
ifnull
(
`a`
.
`fightSysCode`
,
NULL
)
AS
`fightSysCode`
,
ifnull
(
`a`
.
`fightSysId`
,
NULL
)
AS
`fightSysId`
,
ifnull
(
`a`
.
`report_date`
,
NULL
)
AS
`reportDate`
,
a
.
equipName
,
sum
(
`a`
.
`total`
)
AS
`total`
FROM
(
SELECT
`rd`
.
`index_type`
AS
`indxKey`
,
`rd`
.
`index_name`
AS
`index_name`
,
`rd`
.
`equipment_specific_name`
AS
`equipName`
,
count
(
DISTINCT
`rd`
.
`equipment_specific_id`
)
AS
`total`
,
`rd`
.
`report_date`
AS
`report_date`
,
`fs`
.
`name`
AS
`fightSysName`
,
`fs`
.
`code`
AS
`fightSysCode`
,
`fs`
.
`id`
AS
`fightSysId`
,
rd
.
equipment_specific_id
AS
equipId
FROM
(
`wl_equipment_alarm_report_day`
`rd`
LEFT
JOIN
`f_fire_fighting_system`
`fs`
ON
(
(
0
<>
find_in_set
(
`fs`
.
`id`
,
`rd`
.
`system_ids`
)
)
)
)
WHERE
(
(
(
curdate
()
-
INTERVAL
30
DAY
)
<=
cast
(
`rd`
.
`report_date`
AS
date
)
)
AND
(
-- 此处需要更改为换流变的系统code
`fs`
.
`code`
=
'011023306003010000000129'
)
AND
(
(
`rd`
.
`index_type`
LIKE
'%Fault'
)
OR
(
`rd`
.
`index_type`
LIKE
'%FireAlarm'
)
OR
(
`rd`
.
`index_type`
LIKE
'%Shield'
)
)
AND
(
`rd`
.
`value`
=
'true'
)
)
GROUP
BY
`rd`
.
`equipment_specific_id`
,
`rd`
.
`report_date`
)
`a`
GROUP
BY
a
.
equipId
ORDER
BY
total
DESC
LIMIT
5
;
ifnull
(
`a`
.
`fightSysName`
,
NULL
)
AS
`fightSysName`
,
ifnull
(
`a`
.
`fightSysCode`
,
NULL
)
AS
`fightSysCode`
,
ifnull
(
`a`
.
`fightSysId`
,
NULL
)
AS
`fightSysId`
,
ifnull
(
`a`
.
`report_date`
,
NULL
)
AS
`reportDate`
,
`a`
.
`equipName`
AS
`equipName`
,
sum
(
`a`
.
`total`
)
AS
`total`
FROM
(
SELECT
`rd`
.
`index_type`
AS
`indxKey`
,
`rd`
.
`index_name`
AS
`index_name`
,
`we`
.
`name`
AS
`equipName`
,
count
(
DISTINCT
`rd`
.
`equipment_specific_id`
)
AS
`total`
,
`rd`
.
`report_date`
AS
`report_date`
,
`fs`
.
`name`
AS
`fightSysName`
,
`fs`
.
`code`
AS
`fightSysCode`
,
`fs`
.
`id`
AS
`fightSysId`
,
`rd`
.
`equipment_id`
AS
`equipId`
FROM
((
`wl_equipment_alarm_report_day`
`rd`
LEFT
JOIN
`f_fire_fighting_system`
`fs`
ON
((
0
<>
find_in_set
(
`fs`
.
`id`
,
`rd`
.
`system_ids`
))))
LEFT
JOIN
`wl_equipment`
`we`
ON
((
`we`
.
`id`
=
`rd`
.
`equipment_id`
)))
WHERE
(((
curdate
()
-
INTERVAL
30
DAY
)
<=
cast
(
`rd`
.
`report_date`
AS
date
))
AND
(
`fs`
.
`code`
=
'011023306003010000000129'
)
AND
((
`rd`
.
`index_type`
LIKE
'%Fault'
)
OR
(
`rd`
.
`index_type`
LIKE
'%FireAlarm'
)
OR
(
`rd`
.
`index_type`
LIKE
'%Shield'
)))
GROUP
BY
`rd`
.
`equipment_specific_id`
,
`rd`
.
`report_date`
)
`a`
GROUP
BY
`a`
.
`equipId`
ORDER
BY
`total`
DESC
LIMIT
5
;
-- 换流变水喷雾系统3小设备状态统计视图
DROP
VIEW
IF
EXISTS
`v_fire_equip_alarm_fss_3small`
;
CREATE
ALGORITHM
=
UNDEFINED
DEFINER
=
`root`
@
`%`
SQL
SECURITY
DEFINER
VIEW
`v_fire_equip_alarm_fss_3small`
AS
SELECT
b
.
id
AS
`id`
,
b
.
equipName
,
(
CASE
WHEN
b
.
totalNum
>
0
THEN
'异常'
ELSE
'正常'
END
)
`status`
,
b
.
totalNum
AS
totalNum
FROM
(
SELECT
wesl
.
id
AS
`id`
,
a
.
equipName
,
count
(
wesl
.
id
)
AS
totalNum
`b`
.
`speId`
AS
`id`
,
`b`
.
`equipName`
AS
`equipName`
,(
CASE
WHEN
(
`b`
.
`totalNum`
>
0
)
THEN
'异常'
ELSE
'正常'
END
)
AS
`status`
,
`b`
.
`totalNum`
AS
`totalNum`
FROM
(
SELECT
wes
.
`name`
AS
equipName
,
wed
.
equipment_id
AS
equipmentId
`a`
.
`speId`
AS
`speId`
,
`a`
.
`equipName`
AS
`equipName`
,
count
(
wesl
.
equipment_specific_id
)
as
totalNum
FROM
wl_equipment_specific
wes
LEFT
JOIN
wl_equipment_detail
wed
ON
wed
.
id
=
wes
.
equipment_detail_id
WHERE
--此处需要更改为水喷雾系统id
FIND_IN_SET
(
'1619086103649'
,
wes
.
system_id
)
>
0
GROUP
BY
wed
.
equipment_id
)
a
LEFT
JOIN
wl_equipment_specific_alarm_log
wesl
ON
wesl
.
equipment_id
=
a
.
equipmentId
GROUP
BY
a
.
equipmentId
)
b
;
(
SELECT
`wes`
.
`id`
AS
`speId`
,
`wed`
.
`equipment_name`
AS
`equipName`
,
`wed`
.
`equipment_id`
AS
`equipmentId`
FROM
(
`wl_equipment_specific`
`wes`
LEFT
JOIN
`wl_equipment_detail`
`wed`
ON
((
`wed`
.
`id`
=
`wes`
.
`equipment_detail_id`
)))
WHERE
(
find_in_set
(
'1657264678908'
,
`wes`
.
`system_id`
)
>
0
)
GROUP
BY
`wed`
.
`equipment_id`
)
`a`
LEFT
JOIN
`wl_equipment_specific_alarm_log`
`wesl`
ON
`wesl`
.
`equipment_specific_id`
=
`a`
.
`speId`
GROUP
BY
`a`
.
`equipmentId`
)
b
ORDER
BY
`b`
.
`totalNum`
DESC
;
-- 换流变水喷雾系统4小设备状态统计视图
DROP
VIEW
IF
EXISTS
`v_fire_equip_status_fss`
;
...
...
@@ -7674,8 +7667,7 @@ FROM
`rd`
.
`index_type`
LIKE
'%Fault'
)
OR
(
`rd`
.
`index_type`
LIKE
'%FireAlarm'
)
OR
(
`rd`
.
`index_type`
LIKE
'%Shield'
))
AND
(
`rd`
.
`value`
=
'true'
))
OR
(
`rd`
.
`index_type`
LIKE
'%Shield'
)))
GROUP
BY
`rd`
.
`equipment_specific_id`
,
`rd`
.
`report_date`
,
...
...
amos-boot-system-equip/src/main/resources/mapper/EquipmentSpecificAlarmMapper.xml
View file @
f4a9ecae
This diff is collapsed.
Click to expand it.
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