Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
黄嘉阳
/
iot-platform-server
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
ce6914ff
authored
Oct 10, 2023
by
李小龙
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fix: 设备列表增加空间查询和字段 增加房间床位名
parent
80864119
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
5 deletions
server-service/src/main/java/com/makeit/service/platform/device/impl/PlatDeviceServiceImpl.java
server-service/src/main/java/com/makeit/vo/platform/device/PlatDeviceListVO.java
server-service/src/main/resources/mappers/PlatDeviceMapper.xml
server-service/src/main/java/com/makeit/service/platform/device/impl/PlatDeviceServiceImpl.java
View file @
ce6914ff
...
@@ -126,7 +126,12 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
...
@@ -126,7 +126,12 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
String
spaceParentPath
=
record
.
getSpaceParentPath
();
String
spaceParentPath
=
record
.
getSpaceParentPath
();
if
(
StringUtils
.
isNotBlank
(
spaceParentPath
)){
if
(
StringUtils
.
isNotBlank
(
spaceParentPath
)){
String
spaceNameJoin
=
Stream
.
of
(
spaceParentPath
.
split
(
","
)).
map
(
vo
->
spaceIdNameMap
.
get
(
vo
)).
collect
(
Collectors
.
joining
(
"-"
));
String
spaceNameJoin
=
Stream
.
of
(
spaceParentPath
.
split
(
","
)).
map
(
vo
->
spaceIdNameMap
.
get
(
vo
)).
collect
(
Collectors
.
joining
(
"-"
));
record
.
setSpaceName
(
spaceNameJoin
+
"-"
+
record
.
getSpaceName
());
String
spaceName
=
spaceNameJoin
+
"-"
+
record
.
getSpaceName
()
+
"-"
+
record
.
getRoomName
();
if
(
StringUtils
.
isNotBlank
(
record
.
getBedName
())){
spaceName
=
spaceName
+
"-"
+
record
.
getBedName
();
}
record
.
setSpaceName
(
spaceName
);
}
}
}
}
...
...
server-service/src/main/java/com/makeit/vo/platform/device/PlatDeviceListVO.java
View file @
ce6914ff
...
@@ -89,5 +89,9 @@ public class PlatDeviceListVO extends BaseTenantDTO {
...
@@ -89,5 +89,9 @@ public class PlatDeviceListVO extends BaseTenantDTO {
private
String
spaceName
;
private
String
spaceName
;
private
String
roomName
;
private
String
bedName
;
}
}
server-service/src/main/resources/mappers/PlatDeviceMapper.xml
View file @
ce6914ff
...
@@ -6,18 +6,21 @@
...
@@ -6,18 +6,21 @@
<select
id=
"getDeviceIdsBySpaceId"
resultType=
"com.makeit.vo.platform.device.PlatDeviceListVO"
>
<select
id=
"getDeviceIdsBySpaceId"
resultType=
"com.makeit.vo.platform.device.PlatDeviceListVO"
>
select
select
distinct
pd.*,
pd.*,
ps.parent_path as spaceParentPath,
ps.parent_path as spaceParentPath,
ps.name as spaceName
ps.name as spaceName,
pr.name as roomName,
pb.name as bedName
from plat_device pd
from plat_device pd
left join plat_room_bed_device prbd on (pd.id = prbd.device_id and prbd.del_flag = 0)
left join plat_room_bed_device prbd on (pd.id = prbd.device_id and prbd.del_flag = 0)
left join plat_room pr on (pr.id = prbd.room_id and pr.del_flag = 0 )
left join plat_room pr on (pr.id = prbd.room_id and pr.del_flag = 0 )
left join plat_bed pb on ( pb.id = prbd.bed_id and pb.del_flag = 0)
left join plat_bed pb on ( pb.id = prbd.bed_id and pb.del_flag = 0)
left join plat_space ps on (ps.id = p
b.space_id or ps.id = pr.space_id
)
left join plat_space ps on (ps.id = p
r.space_id and ps.del_flag = 0
)
<where>
<where>
pd.del_flag = 0
pd.del_flag = 0
<if
test=
"param.spaceId != null and param.spaceId != ''"
>
<if
test=
"param.spaceId != null and param.spaceId != ''"
>
and ( FIND_IN_SET(#{param.spaceId},ps.parent_path) or ps.id = #{param.spaceId}
)
and ( FIND_IN_SET(#{param.spaceId},ps.parent_path) or ps.id = #{param.spaceId})
</if>
</if>
<if
test=
"param.oriDeviceId != null and param.oriDeviceId != ''"
>
<if
test=
"param.oriDeviceId != null and param.oriDeviceId != ''"
>
and pd.ori_device_id like concat('%',#{param.oriDeviceId},'%')
and pd.ori_device_id like concat('%',#{param.oriDeviceId},'%')
...
@@ -38,6 +41,6 @@
...
@@ -38,6 +41,6 @@
and pd.org_id = #{param.orgId}
and pd.org_id = #{param.orgId}
</if>
</if>
</where>
</where>
order by pd.update_date desc
order by pd.update_date desc
,prbd.update_date desc
</select>
</select>
</mapper>
</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