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
...
@@ -7450,100 +7450,93 @@ WHERE
DROP
VIEW
IF
EXISTS
`v_fire_equip_alarm_fss_top5_3small`
;
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
CREATE
ALGORITHM
=
UNDEFINED
DEFINER
=
`root`
@
`%`
SQL
SECURITY
DEFINER
VIEW
`v_fire_equip_alarm_fss_top5_3small`
AS
SELECT
SELECT
ifnull
(
`a`
.
`fightSysName`
,
NULL
)
AS
`fightSysName`
,
ifnull
(
`a`
.
`fightSysName`
,
NULL
)
AS
`fightSysName`
,
ifnull
(
`a`
.
`fightSysCode`
,
NULL
)
AS
`fightSysCode`
,
ifnull
(
`a`
.
`fightSysCode`
,
NULL
)
AS
`fightSysCode`
,
ifnull
(
`a`
.
`fightSysId`
,
NULL
)
AS
`fightSysId`
,
ifnull
(
`a`
.
`fightSysId`
,
NULL
)
AS
`fightSysId`
,
ifnull
(
`a`
.
`report_date`
,
NULL
)
AS
`reportDate`
,
ifnull
(
`a`
.
`report_date`
,
NULL
)
AS
`reportDate`
,
a
.
equipName
,
`a`
.
`equipName`
AS
`equipName`
,
sum
(
`a`
.
`total`
)
AS
`total`
sum
(
`a`
.
`total`
)
AS
`total`
FROM
FROM
(
(
SELECT
SELECT
`rd`
.
`index_type`
AS
`indxKey`
,
`rd`
.
`index_type`
AS
`indxKey`
,
`rd`
.
`index_name`
AS
`index_name`
,
`rd`
.
`index_name`
AS
`index_name`
,
`rd`
.
`equipment_specific_name`
AS
`equipName`
,
`we`
.
`name`
AS
`equipName`
,
count
(
count
(
DISTINCT
`rd`
.
`equipment_specific_id`
)
AS
`total`
,
DISTINCT
`rd`
.
`equipment_specific_id`
`rd`
.
`report_date`
AS
`report_date`
,
)
AS
`total`
,
`fs`
.
`name`
AS
`fightSysName`
,
`rd`
.
`report_date`
AS
`report_date`
,
`fs`
.
`code`
AS
`fightSysCode`
,
`fs`
.
`name`
AS
`fightSysName`
,
`fs`
.
`id`
AS
`fightSysId`
,
`fs`
.
`code`
AS
`fightSysCode`
,
`rd`
.
`equipment_id`
AS
`equipId`
`fs`
.
`id`
AS
`fightSysId`
,
FROM
rd
.
equipment_specific_id
AS
equipId
((
FROM
`wl_equipment_alarm_report_day`
`rd`
(
LEFT
JOIN
`f_fire_fighting_system`
`fs`
ON
((
`wl_equipment_alarm_report_day`
`rd`
0
<>
find_in_set
(
`fs`
.
`id`
,
`rd`
.
`system_ids`
))))
LEFT
JOIN
`f_fire_fighting_system`
`fs`
ON
(
LEFT
JOIN
`wl_equipment`
`we`
ON
((
(
`we`
.
`id`
=
`rd`
.
`equipment_id`
0
<>
find_in_set
(
)))
`fs`
.
`id`
,
WHERE
`rd`
.
`system_ids`
(((
)
curdate
()
-
INTERVAL
30
DAY
)
)
<=
cast
(
`rd`
.
`report_date`
AS
date
))
)
AND
(
`fs`
.
`code`
=
'011023306003010000000129'
)
)
AND
((
WHERE
`rd`
.
`index_type`
LIKE
'%Fault'
(
)
(
OR
(
`rd`
.
`index_type`
LIKE
'%FireAlarm'
)
(
curdate
()
-
INTERVAL
30
DAY
)
<=
cast
(
`rd`
.
`report_date`
AS
date
)
OR
(
`rd`
.
`index_type`
LIKE
'%Shield'
)))
)
GROUP
BY
AND
(
`rd`
.
`equipment_specific_id`
,
-- 此处需要更改为换流变的系统code
`rd`
.
`report_date`
`fs`
.
`code`
=
'011023306003010000000129'
)
`a`
)
GROUP
BY
AND
(
`a`
.
`equipId`
(
ORDER
BY
`rd`
.
`index_type`
LIKE
'%Fault'
`total`
DESC
)
LIMIT
5
;
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
;
-- 换流变水喷雾系统3小设备状态统计视图
-- 换流变水喷雾系统3小设备状态统计视图
DROP
VIEW
IF
EXISTS
`v_fire_equip_alarm_fss_3small`
;
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
CREATE
ALGORITHM
=
UNDEFINED
DEFINER
=
`root`
@
`%`
SQL
SECURITY
DEFINER
VIEW
`v_fire_equip_alarm_fss_3small`
AS
SELECT
SELECT
b
.
id
AS
`id`
,
`b`
.
`speId`
AS
`id`
,
b
.
equipName
,
`b`
.
`equipName`
AS
`equipName`
,(
(
CASE
WHEN
b
.
totalNum
>
0
THEN
'异常'
ELSE
'正常'
END
)
`status`
,
CASE
b
.
totalNum
AS
totalNum
WHEN
(
`b`
.
`totalNum`
>
0
)
THEN
FROM
'异常'
ELSE
'正常'
(
END
SELECT
)
AS
`status`
,
wesl
.
id
AS
`id`
,
`b`
.
`totalNum`
AS
`totalNum`
a
.
equipName
,
count
(
wesl
.
id
)
AS
totalNum
FROM
FROM
(
(
SELECT
SELECT
wes
.
`name`
AS
equipName
,
`a`
.
`speId`
AS
`speId`
,
wed
.
equipment_id
AS
equipmentId
`a`
.
`equipName`
AS
`equipName`
,
count
(
wesl
.
equipment_specific_id
)
as
totalNum
FROM
FROM
wl_equipment_specific
wes
(
LEFT
JOIN
wl_equipment_detail
wed
ON
wed
.
id
=
wes
.
equipment_detail_id
SELECT
WHERE
`wes`
.
`id`
AS
`speId`
,
--此处需要更改为水喷雾系统id
`wed`
.
`equipment_name`
AS
`equipName`
,
FIND_IN_SET
(
'1619086103649'
,
wes
.
system_id
)
>
0
`wed`
.
`equipment_id`
AS
`equipmentId`
GROUP
BY
FROM
wed
.
equipment_id
(
)
a
`wl_equipment_specific`
`wes`
LEFT
JOIN
wl_equipment_specific_alarm_log
wesl
ON
wesl
.
equipment_id
=
a
.
equipmentId
LEFT
JOIN
`wl_equipment_detail`
`wed`
ON
((
GROUP
BY
`wed`
.
`id`
=
`wes`
.
`equipment_detail_id`
a
.
equipmentId
)))
)
b
;
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小设备状态统计视图
-- 换流变水喷雾系统4小设备状态统计视图
DROP
VIEW
IF
EXISTS
`v_fire_equip_status_fss`
;
DROP
VIEW
IF
EXISTS
`v_fire_equip_status_fss`
;
...
@@ -7674,8 +7667,7 @@ FROM
...
@@ -7674,8 +7667,7 @@ FROM
`rd`
.
`index_type`
LIKE
'%Fault'
`rd`
.
`index_type`
LIKE
'%Fault'
)
)
OR
(
`rd`
.
`index_type`
LIKE
'%FireAlarm'
)
OR
(
`rd`
.
`index_type`
LIKE
'%FireAlarm'
)
OR
(
`rd`
.
`index_type`
LIKE
'%Shield'
))
OR
(
`rd`
.
`index_type`
LIKE
'%Shield'
)))
AND
(
`rd`
.
`value`
=
'true'
))
GROUP
BY
GROUP
BY
`rd`
.
`equipment_specific_id`
,
`rd`
.
`equipment_specific_id`
,
`rd`
.
`report_date`
,
`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