机构树形结构 不采用用递归查询数据库
This commit is contained in:
@@ -40,6 +40,24 @@
|
||||
select * from ts_user
|
||||
WHERE institution_id=#{institutionId}
|
||||
</select>
|
||||
|
||||
<select id="selectTreeByIds" resultMap="TsInstitution">
|
||||
<foreach collection="rootIds" item="id">
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
ts_institution
|
||||
WHERE
|
||||
FIND_IN_SET(
|
||||
id,
|
||||
GET_PARENT_NODE (#{id})
|
||||
);
|
||||
</foreach>
|
||||
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectRootAndUser" resultMap="InstitutionAndUser">
|
||||
select i.*,u.usid,u.account,u.uname,u.institution_id from ts_institution i
|
||||
left join ts_user u
|
||||
|
||||
Reference in New Issue
Block a user