Commit ce6914ff by 李小龙

fix: 设备列表增加空间查询和字段 增加房间床位名

parent 80864119
...@@ -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);
} }
} }
......
...@@ -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;
} }
...@@ -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 = pb.space_id or ps.id = pr.space_id) left join plat_space ps on (ps.id = pr.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>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment