机构树形排序
This commit is contained in:
@@ -54,7 +54,7 @@ public interface TsInstitutionDao extends BaseMapper<TsInstitution> {
|
|||||||
* 查询根机构
|
* 查询根机构
|
||||||
* @return List<TsInstitution>
|
* @return List<TsInstitution>
|
||||||
*/
|
*/
|
||||||
@Select("select * from ts_institution where parent_id not in (select id from ts_institution)")
|
@Select("select * from ts_institution where parent_id not in (select id from ts_institution) order by name")
|
||||||
List<TsInstitution> selectRoot();
|
List<TsInstitution> selectRoot();
|
||||||
|
|
||||||
@Select("select * from ts_institution order by rand() limit 1")
|
@Select("select * from ts_institution order by rand() limit 1")
|
||||||
|
|||||||
+1
-1
@@ -45,7 +45,7 @@
|
|||||||
left join ts_user u
|
left join ts_user u
|
||||||
on i.id=u.institution_id
|
on i.id=u.institution_id
|
||||||
<if test="userName == null">
|
<if test="userName == null">
|
||||||
where i.parent_id not in (select id from ts_institution)
|
where i.parent_id not in (select id from ts_institution) order by i.name
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
<if test="userName != null">
|
<if test="userName != null">
|
||||||
|
|||||||
Reference in New Issue
Block a user