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
81d95af4
Commit
81d95af4
authored
Nov 23, 2022
by
tianyiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
直流中心水池接口优化
parent
7b56693d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
100 additions
and
0 deletions
+100
-0
DCenterController.java
...com/yeejoin/equipmanage/controller/DCenterController.java
+20
-0
FireFightingSystemMapper.java
.../yeejoin/equipmanage/mapper/FireFightingSystemMapper.java
+2
-0
FireFightingSystemMapper.xml
...ip/src/main/resources/mapper/FireFightingSystemMapper.xml
+78
-0
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/DCenterController.java
View file @
81d95af4
...
...
@@ -3,6 +3,8 @@ package com.yeejoin.equipmanage.controller;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.equipmanage.common.utils.*
;
import
com.yeejoin.equipmanage.config.PersonIdentify
;
import
com.yeejoin.equipmanage.mapper.FireFightingSystemMapper
;
import
com.yeejoin.equipmanage.service.IEquipmentSpecificAlarmService
;
import
com.yeejoin.equipmanage.service.IEquipmentSpecificSerivce
;
import
com.yeejoin.equipmanage.service.IFireFightingSystemService
;
...
...
@@ -38,6 +40,9 @@ public class DCenterController extends AbstractBaseController {
private
IEquipmentSpecificAlarmService
equipmentSpecificAlarmService
;
@Autowired
private
FireFightingSystemMapper
fireFightingSystemMapper
;
@Autowired
IFireFightingSystemService
fireFightingSystemService
;
@Autowired
...
...
@@ -110,5 +115,20 @@ public class DCenterController extends AbstractBaseController {
public
ResponseModel
getEquipmentStatisticsInfo
(
@RequestParam
(
value
=
"bizOrgCode"
,
required
=
false
)
String
bizOrgCode
)
throws
Exception
{
return
CommonResponseUtil
.
success
(
specificService
.
getEquipmentStatisticsInfo
(
bizOrgCode
));
}
@PersonIdentify
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"消防水池液位"
)
@GetMapping
(
"/equip/water/info"
)
public
ResponseModel
getWaterInfo
(
CommonPageable
commonPageable
,
@RequestParam
(
required
=
false
)
String
bizOrgCode
)
{
if
(
commonPageable
.
getPageNumber
()
==
0
)
{
commonPageable
.
setPageNumber
(
1
);
}
if
(
StringUtils
.
isEmpty
(
bizOrgCode
))
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
bizOrgCode
=
!
ValidationUtil
.
isEmpty
(
reginParams
.
getPersonIdentity
())
&&
StringUtil
.
isNotEmpty
(
reginParams
.
getPersonIdentity
().
getBizOrgCode
())
?
reginParams
.
getPersonIdentity
().
getBizOrgCode
()
:
null
;
}
Page
page
=
new
Page
<>(
commonPageable
.
getPageNumber
(),
commonPageable
.
getPageSize
());
return
CommonResponseUtil
.
success
(
fireFightingSystemMapper
.
getCenterWaterInfo
(
page
,
bizOrgCode
));
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/mapper/FireFightingSystemMapper.java
View file @
81d95af4
...
...
@@ -623,4 +623,6 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
Map
<
String
,
Object
>
getSystemRunningInfoList
();
List
<
Map
<
String
,
Object
>>
getFireCarInfoByYJYA
(
@Param
(
"bizOrgCode"
)
String
bizOrgCode
);
Page
<
Map
<
String
,
Object
>>
getCenterWaterInfo
(
Page
page
,
String
bizOrgCode
);
}
amos-boot-system-equip/src/main/resources/mapper/FireFightingSystemMapper.xml
View file @
81d95af4
...
...
@@ -5287,4 +5287,82 @@
GROUP BY
`wc`.`id`
</select>
<select
id=
"getCenterWaterInfo"
resultType=
"java.util.Map"
>
SELECT
a.`name`,
(
CASE
WHEN a.nowLevel IS NULL THEN
'--'
WHEN a.nowLevel >= IFNULL( a.minLevel, 0 )
AND a.maxLevel IS NULL THEN
'100'
WHEN IFNULL( a.minLevel, 0 ) > a.nowLevel
AND a.maxLevel IS NULL THEN
'--' ELSE IFNULL((
FORMAT(
abs(
IFNULL(
a.nowLevel,
IFNULL( a.minLevel, 0 )) /
IF
(
IFNULL( a.maxLevel, 0 ) = 0,
1,
IFNULL( a.maxLevel, 0 ))) * 100,
2
)
),
0
)
END
) AS levelAbs,
IFNULL( a.nowLevel, '--' ) nowLevel,
(
CASE
WHEN a.nowLevel IS NULL
OR a.minLevel IS NULL THEN
'--'
WHEN IFNULL( a.minLevel, 0 ) > IFNULL(
a.nowLevel,
IFNULL( a.minLevel, 0 )) THEN
'缺水' ELSE '正常'
END
) AS levelStatus
FROM
(
SELECT
r.`name`,
IFNULL( rp.min_water_level, 0 ) AS minLevel,
IFNULL( rp.max_water_level, 0 ) AS maxLevel,
(
SELECT
FORMAT( avg( IFNULL( ei.`value`, 0 )), 2 )
FROM
wl_equipment_specific_index ei
WHERE
( ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' OR ei.equipment_index_key = 'FHS_WirelessliquidDetector_WaterLevel' )
AND FIND_IN_SET( ei.equipment_specific_id, rp.level_device_id ) > 0
) AS nowLevel,
rp.level_device_id
FROM
cb_water_resource r
LEFT JOIN cb_water_resource_pool rp ON rp.resource_id = r.sequence_nbr
WHERE
r.resource_type IN ( 'pool', 'industryPool' )
AND r.is_delete = 1
AND r.`biz_org_code` IS NOT NULL
<if
test=
"bizOrgCode!=null and bizOrgCode!=''"
>
AND r.biz_org_code like concat(#{bizOrgCode}, '%')
</if>
GROUP BY
r.sequence_nbr
) a ORDER BY
levelStatus DESC
</select>
</mapper>
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