Commit 84745a85 by 朱淼

更新

parent 4c1dc5e8
......@@ -21,4 +21,8 @@ public interface PlatRoomMapper extends BaseMapper<PlatRoom> {
List<WorkStationInstitutionRoomVO> workStationList(@Param("dto") WorkStationQueryDTO dto);
Page<WorkStationInstitutionRoomVO> workStationPage(Page<WorkStationQueryDTO> page, @Param("dto") WorkStationQueryDTO dto);
List<PlatSpaceAndRoomVO> spaceList(@Param("orgIds")List<String> orgIds);
List<PlatSpaceAndRoomVO> roomList(@Param("orgIds")List<String> orgIds);
}
......@@ -66,4 +66,8 @@ public interface PlatRoomService extends IService<PlatRoom> {
List<WorkStationInstitutionRoomVO> workStationList(WorkStationQueryDTO dto);
Page<WorkStationInstitutionRoomVO> workStationPage(Page<WorkStationQueryDTO> objectPage, WorkStationQueryDTO data);
List<PlatSpaceAndRoomVO> spaceList(List<String> orgIds);
List<PlatSpaceAndRoomVO> roomList(List<String> orgIds);
}
......@@ -165,8 +165,13 @@ public class PlatRoomDynamicServiceImpl implements PlatRoomDynamicService {
return new ArrayList<>();
}
List<String> orgIds = orgs.stream().map(PlatOrg::getId).collect(Collectors.toList());
//获取空间及房间
List<PlatSpaceAndRoomVO> list = platRoomService.spaceAndRoomList(orgIds);
//获取空间
List<PlatSpaceAndRoomVO> spaceList = platRoomService.spaceList(orgIds);
List<PlatSpaceAndRoomVO> roomList = platRoomService.roomList(orgIds);
List<PlatSpaceAndRoomVO> list = new ArrayList<>();
list.addAll(spaceList);
list.addAll(roomList);
//父级
List<PlatSpaceAndRoomVO> listParent = list.stream().filter(item-> StringUtil.isEmpty(item.getParentId())).collect(Collectors.toList());
......
......@@ -179,5 +179,14 @@ public class PlatRoomServiceImpl extends ServiceImpl<PlatRoomMapper, PlatRoom> i
return baseMapper.workStationPage(page,params);
}
@Override
public List<PlatSpaceAndRoomVO> spaceList(List<String> orgIds) {
return baseMapper.spaceList(orgIds);
}
@Override
public List<PlatSpaceAndRoomVO> roomList(List<String> orgIds) {
return baseMapper.roomList(orgIds); }
}
......@@ -4,7 +4,7 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.makeit.mapper.platform.space.PlatRoomMapper">
<select id="spaceAndRoomList" resultType="com.makeit.vo.platform.space.PlatSpaceAndRoomVO">
select a.id,a.name,a.parentId,a.type from (
SELECT ps.id,ps.`name`,ps.parent_id as parentId,'1' as type FROM plat_space ps
<where>
ps.del_flag = 0
......@@ -27,7 +27,6 @@
</foreach>
</if>
</where>
)a
</select>
......@@ -84,5 +83,35 @@
</where>
</select>
<select id="spaceList" resultType="com.makeit.vo.platform.space.PlatSpaceAndRoomVO">
SELECT ps.id,ps.`name`,ps.parent_id as parentId,'1' as type FROM plat_space ps
<where>
ps.del_flag = 0
<if test="orgIds != null and orgIds.size()>0 ">
AND ps.org_id IN
<foreach collection="orgIds" item="item" separator="," open="(" close=")" index="">
#{item}
</foreach>
</if>
</where>
</select>
<select id="roomList" resultType="com.makeit.vo.platform.space.PlatSpaceAndRoomVO">
SELECT pr.id,pr.`name`,pr.space_id as parentId,'2' as type FROM plat_room pr
LEFT JOIN plat_space p ON p.id = pr.space_id
<where>
pr.del_flag = 0
<if test="orgIds != null and orgIds.size()>0 ">
AND p.org_id IN
<foreach collection="orgIds" item="item" separator="," open="(" close=")" index="">
#{item}
</foreach>
</if>
</where>
</select>
</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