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
e2833682
Commit
e2833682
authored
Sep 02, 2022
by
zhangsen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
改bug
parent
81d6fdb1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
90 additions
and
51 deletions
+90
-51
FireFightingSystemServiceImpl.java
...uipmanage/service/impl/FireFightingSystemServiceImpl.java
+2
-0
EquipmentSpecificAlarmMapper.xml
...rc/main/resources/mapper/EquipmentSpecificAlarmMapper.xml
+9
-0
FireFightingSystemMapper.xml
...ip/src/main/resources/mapper/FireFightingSystemMapper.xml
+79
-51
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/FireFightingSystemServiceImpl.java
View file @
e2833682
...
...
@@ -1304,6 +1304,8 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
@Override
public
Map
<
String
,
Object
>
equipAlarmTOP
(
HashMap
<
String
,
Object
>
hashMap
)
{
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
String
id
=
fireFightingSystemMapper
.
equipmentId
(
hashMap
);
hashMap
.
put
(
"systemId"
,
id
);
List
<
Map
<
String
,
Object
>>
list
=
fireFightingSystemMapper
.
equipAlarmTOP
(
hashMap
);
if
(!
CollectionUtils
.
isEmpty
(
list
))
{
LinkedHashSet
<
String
>
yAxis
=
new
LinkedHashSet
<>();
...
...
amos-boot-system-equip/src/main/resources/mapper/EquipmentSpecificAlarmMapper.xml
View file @
e2833682
...
...
@@ -398,6 +398,9 @@
<if
test=
"param.equipmentCode != null and param.equipmentCode != ''"
>
AND wlesal.equipment_code like concat(concat("%",#{param.equipmentCode}),"%")
</if>
<if
test=
"param.equipDetailCode != null and param.equipDetailCode != ''"
>
AND wlesal.equipment_code like concat(concat("%",#{param.equipDetailCode}),"%")
</if>
<if
test=
"param.indexTypeCode != null and param.indexTypeCode != ''"
>
AND wlesal.type = #{param.indexTypeCode}
</if>
...
...
@@ -1137,7 +1140,10 @@
FROM
`wl_equipment_specific` `wles`
LEFT JOIN f_fire_fighting_system fs ON FIND_IN_SET( fs.id, wles.system_id )
LEFT JOIN wl_equipment_detail wed ON wed.id = wles.equipment_detail_id
LEFT JOIN wl_equipment we ON we.id = wed.equipment_id
<where>
we.is_iot = 1
<if
test=
"systemCode != null and systemCode != ''"
>
AND fs.code = #{systemCode}
</if>
...
...
@@ -1152,8 +1158,11 @@
FROM
wl_equipment_specific_alarm wlesa
LEFT JOIN wl_equipment_specific wes on wes.id = wlesa.equipment_specific_id
LEFT JOIN wl_equipment_detail wed ON wed.id = wes.equipment_detail_id
LEFT JOIN wl_equipment we ON we.id = wed.equipment_id
<where>
wlesa.`status` = 1
and we.is_iot = 1
<if
test=
"systemCode != null and systemCode != ''"
>
AND FIND_IN_SET( #{systemCode}, wlesa.system_codes )>0
</if>
...
...
amos-boot-system-equip/src/main/resources/mapper/FireFightingSystemMapper.xml
View file @
e2833682
...
...
@@ -2128,7 +2128,8 @@
count(1)
FROM
`wl_equipment_specific` `wes`
LEFT JOIN wl_equipment e ON wes.`equipment_code` = e.`code`
LEFT JOIN wl_equipment_detail wed on wed.id = wes.equipment_detail_id
LEFT JOIN wl_equipment e ON wed.`equipment_id` = e.`id`
WHERE
e.is_iot = 1
and
...
...
@@ -2355,18 +2356,18 @@
(
CASE
WHEN max( CASE WHEN ei.
name_key = 'FHS_WirelessliquidDetector_WaterLevel' THEN ei.perf_value
END ) IS NULL THEN
WHEN max( CASE WHEN ei.
equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' THEN ei.`value`
END ) IS NULL THEN
'--'
WHEN max( CASE WHEN ei.
name_key = 'FHS_WirelessliquidDetector_WaterLevel' THEN ei.perf_value
END ) >= IFNULL( rp.min_water_level, 0 )
WHEN max( CASE WHEN ei.
equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' THEN ei.`value`
END ) >= IFNULL( rp.min_water_level, 0 )
AND rp.max_water_level IS NULL THEN
'100'
WHEN max( CASE WHEN ei.
name_key = 'FHS_WirelessliquidDetector_WaterLevel' THEN ei.perf_value
END )
<
IFNULL( rp.min_water_level, 0 )
WHEN max( CASE WHEN ei.
equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' THEN ei.`value`
END )
<
IFNULL( rp.min_water_level, 0 )
AND rp.max_water_level IS NULL THEN
'--' ELSE IFNULL((
TRUNCATE (
abs(
IFNULL(
max( CASE WHEN ei.
name_key = 'FHS_WirelessliquidDetector_WaterLevel' THEN ei.perf_value
END ),
max( CASE WHEN ei.
equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' THEN ei.`value`
END ),
IFNULL( rp.min_water_level, 0 )) /
IF
(
...
...
@@ -2380,15 +2381,15 @@
)
END
) AS levelAbs,
IFNULL(
max( CASE WHEN ei.name_key = 'FHS_WirelessliquidDetector_WaterLevel' THEN ei.perf_value END ), '--' )
AS nowLevel,
IFNULL(
max( CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' THEN ei.`value` END ),'--')
AS nowLevel,
(
CASE
WHEN max( CASE WHEN ei.
name_key = 'FHS_WirelessliquidDetector_WaterLevel' THEN ei.perf_value
END ) IS NULL
WHEN max( CASE WHEN ei.
equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' THEN ei.`value`
END ) IS NULL
OR rp.min_water_level IS NULL THEN
'--'
WHEN IFNULL(
max( CASE WHEN ei.
name_key = 'FHS_WirelessliquidDetector_WaterLevel' THEN ei.perf_value
END ),
max( CASE WHEN ei.
equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' THEN ei.`value`
END ),
IFNULL( rp.min_water_level, 0 ))
<
IFNULL( rp.min_water_level, 0 ) THEN
'缺水' ELSE '正常'
END
...
...
@@ -2396,17 +2397,19 @@
IFNULL( rp.volume, 0 ) AS volume,
ec.image,
r.resource_type,
r.sequence_nbr
r.sequence_nbr,
fs.`code` AS systemCode
FROM
cb_water_resource r
LEFT JOIN cb_org_usr ou ON ou.biz_org_code = r.biz_org_code
AND ou.is_delete = 0
LEFT JOIN cb_water_resource_pool rp ON rp.resource_id = r.sequence_nbr
LEFT JOIN wl_equipment_specific es ON es.id = rp.level_device_id
LEFT JOIN wl_equipment_detail ed ON ed.id = es.equipment_detail_id
LEFT JOIN wl_equipment_
index ei ON ei.equipment_id = ed.equipment
_id
LEFT JOIN wl_equipment e ON e.id = e
i
.equipment_id
LEFT JOIN wl_equipment_
specific_index ei ON ei.equipment_specific_id = rp.level_device
_id
LEFT JOIN wl_equipment e ON e.id = e
d
.equipment_id
LEFT JOIN wl_equipment_category ec ON ec.id = e.category_id
LEFT JOIN f_fire_fighting_system fs ON
FIND_IN_SET( fs.id, es.system_id )
LEFT JOIN f_fire_fighting_system fs ON
fs.id = r.belong_fighting_system_id
WHERE
r.resource_type IN ( 'pool', 'industryPool' )
AND r.is_delete = 1
...
...
@@ -2471,50 +2474,75 @@
</select>
<select
id=
"equipAlarmTOP"
resultType=
"java.util.Map"
>
<!-- 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` AS `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 ( `fs`.`code` = #{systemCode} )-->
<!-- AND ( `fs`.`biz_org_code` like concat(#{bizOrgCode}, '%') )-->
<!-- 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-->
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` AS `equipName`,
sum( `a`.`total` ) AS `total`
a.equipName,
count( DISTINCT wesa.equipment_specific_id ) 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`
eq.`name` AS equipName,
eq.id AS equipmentId,
eq.`code` AS `code`
FROM
(
`wl_equipment_alarm_report_day` `rd`
LEFT JOIN `f_fire_fighting_system` `fs` ON ((
0 != find_in_set( `fs`.`id`, `rd`.`system_ids` ))))
wl_equipment eq
LEFT JOIN wl_equipment_detail wed ON eq.id = wed.equipment_id
LEFT JOIN wl_equipment_specific wes ON wed.id = wes.equipment_detail_id
WHERE
(((
curdate() - INTERVAL 30 DAY
)
<
= cast( `rd`.`report_date` AS date ))
AND ( `fs`.`code` = #{systemCode} )
AND ( `fs`.`biz_org_code` like concat(#{bizOrgCode}, '%') )
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`
FIND_IN_SET( #{systemId}, wes.system_id ) > 0
) a
LEFT JOIN wl_equipment_specific_alarm wesa ON wesa.equipment_id = a.equipmentId
AND FIND_IN_SET( #{systemId}, wesa.system_ids ) > 0
AND `wesa`.`create_date` >= ( curdate() - INTERVAL 30 DAY )
GROUP BY
`a`.`equipId`
a.equipmentId
ORDER BY
`total`
DESC
total
DESC
LIMIT 5
</select>
...
...
@@ -2579,9 +2607,9 @@
eq.id AS equipmentId,
eq.`code` AS `code`
FROM
wl_equipment
_specific wes
LEFT JOIN wl_equipment_detail wed ON
wed.id = wes.equipment_detail
_id
LEFT JOIN wl_equipment
eq on eq.id = wed.equipment
_id
wl_equipment
eq
LEFT JOIN wl_equipment_detail wed ON
eq.id = wed.equipment
_id
LEFT JOIN wl_equipment
_specific wes on wed.id = wes.equipment_detail
_id
WHERE
FIND_IN_SET( #{id}, wes.system_id ) > 0
) a
...
...
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