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
b60297c8
Commit
b60297c8
authored
Nov 24, 2022
by
高建强
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
item:直流中心bug修改
parent
6b8da80d
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
18 deletions
+13
-18
FireFightingSystemDto.java
...yeejoin/equipmanage/common/dto/FireFightingSystemDto.java
+1
-0
FireFightingSystemServiceImpl.java
...uipmanage/service/impl/FireFightingSystemServiceImpl.java
+6
-5
EquipmentSpecificMapper.xml
...uip/src/main/resources/mapper/EquipmentSpecificMapper.xml
+6
-13
No files found.
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/dto/FireFightingSystemDto.java
View file @
b60297c8
...
...
@@ -12,4 +12,5 @@ public class FireFightingSystemDto {
private
Integer
alarmEquipTotal
=
0
;
private
Integer
status
=
0
;
private
String
image
;
private
Long
sort
;
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/FireFightingSystemServiceImpl.java
View file @
b60297c8
...
...
@@ -2114,16 +2114,17 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
if
(!
CollectionUtils
.
isEmpty
(
records
))
{
List
<
Long
>
idList
=
records
.
stream
().
map
(
FireFightingSystemDto:
:
getId
).
collect
(
Collectors
.
toList
());
List
<
FireFightingSystemDto
>
list
=
equipmentSpecificSerivce
.
fireSysIotEquipAlarmCount
(
new
Date
(),
bizOrgCode
);
if
(!
CollectionUtils
.
isEmpty
(
list
))
{
//使用stream流把list1和list2根据属性userId合并一个list集合
List
<
FireFightingSystemDto
>
collect
=
records
.
stream
().
map
(
m
->
{
list
.
stream
().
filter
(
m2
->
Objects
.
equals
(
m
.
getId
(),
m2
.
getId
())).
forEach
(
m2
->
{
List
<
FireFightingSystemDto
>
collect
=
records
.
stream
().
peek
(
m
->
list
.
stream
().
filter
(
m2
->
Objects
.
equals
(
m
.
getId
(),
m2
.
getId
())).
forEach
(
m2
->
{
m
.
setAlarmEquipTotal
(
m2
.
getAlarmEquipTotal
());
m
.
setStatus
(
m2
.
getStatus
());
})
;
return
m
;
}).
collect
(
Collectors
.
toList
());
})
).
sorted
(
Comparator
.
comparing
(
FireFightingSystemDto:
:
getStatus
,
Comparator
.
reverseOrder
())
.
thenComparing
(
FireFightingSystemDto:
:
getSort
)).
collect
(
Collectors
.
toList
())
;
// 根据状态倒序排序
pages
.
setRecords
(
collect
);
}
}
return
pages
;
}
}
amos-boot-system-equip/src/main/resources/mapper/EquipmentSpecificMapper.xml
View file @
b60297c8
...
...
@@ -2016,7 +2016,8 @@
fs.id,
fs.`code`,
fs.`name`,
count( 1 ) AS equipTotal,
fs.`sort`,
SUM(IF(e.is_iot = 1,1,0)) AS equipTotal,
ec.image
FROM
f_fire_fighting_system fs
...
...
@@ -2024,11 +2025,11 @@
LEFT JOIN wl_equipment_detail wed ON wed.id = wes.equipment_detail_id
LEFT JOIN wl_equipment e ON wed.`equipment_id` = e.`id`
LEFT JOIN wl_equipment_category ec ON ec.id = fs.system_type
WHERE
e.is_iot = 1
<where>
<if
test=
"bizOrgCode!=null and bizOrgCode!=''"
>
and
fs.biz_org_code like concat(#{bizOrgCode}, '%')
fs.biz_org_code like concat(#{bizOrgCode}, '%')
</if>
</where>
GROUP BY
fs.id
ORDER BY
...
...
@@ -2039,22 +2040,14 @@
s.id,
s.`name`,
IFNULL(s.alarmEquipTotal, 0) AS alarmEquipTotal,
<choose>
<when
test=
"date != null"
>
IF(s.total > 0,1,0) AS `status`
</when>
<otherwise>
IF(s.alarmEquipTotal > 0,1,0) AS `status`
</otherwise>
</choose>
FROM
(SELECT
fs.id,
fs.`name`,
count( 1 ) AS total,
<choose>
<when
test=
"date != null"
>
SUM(IF(TO_DAYS(esi.
cre
ate_date) = TO_DAYS(#{date}),1,0)) AS alarmEquipTotal
SUM(IF(TO_DAYS(esi.
upd
ate_date) = TO_DAYS(#{date}),1,0)) AS alarmEquipTotal
</when>
<otherwise>
COUNT( 1 ) AS alarmEquipTotal
...
...
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