修改了institutionAndUser(String userName)接口,当userName有值事搜索出此用户以及它所在的机构,userName为null时搜索全部
添加getNext(String institutionId)接口,通过机构id返回此部门下的第一级部门和人员 添加getFirstInstitution()接口,返回机构第一级目录
This commit is contained in:
+34
-1
@@ -14,11 +14,44 @@
|
||||
<result column="institution_id" property="institutionId"/>
|
||||
</collection>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="TsInstitution" type="com.adc.da.slrs.sarInstitution.entity.TsInstitution">
|
||||
<result column="parent_id" property="parentId"/>
|
||||
<result column="level" property="level"/>
|
||||
<result column="name" property="name"/>
|
||||
<result column="has_child" property="hasChild"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="TsUser" type="com.adc.da.slrs.sarInstitution.entity.TsUserVO">
|
||||
<result column="usid" property="id"/>
|
||||
<result column="account" property="account"/>
|
||||
<result column="uname" property="name"/>
|
||||
<result column="institution_id" property="institutionId"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 只查询这个部门下的子一级部门-->
|
||||
<select id="selectNextInstitution" resultMap="TsInstitution">
|
||||
select * from ts_institution
|
||||
WHERE parent_id=#{institutionId}
|
||||
</select>
|
||||
|
||||
<!-- 只查询这个部门下的子一级人员-->
|
||||
<select id="selectNextUser" resultMap="TsUser">
|
||||
select * from ts_user
|
||||
WHERE institution_id=#{institutionId}
|
||||
</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
|
||||
on i.id=u.institution_id
|
||||
where i.parent_id not in (select id from ts_institution)
|
||||
<if test="userName == null">
|
||||
where i.parent_id not in (select id from ts_institution)
|
||||
</if>
|
||||
|
||||
<if test="userName != null">
|
||||
|
||||
where u.uname like concat('%','${userName}','%')
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectAndUserByParent" resultMap="InstitutionAndUser">
|
||||
|
||||
Reference in New Issue
Block a user