1
0
mirror of https://github.com/FatttSnake/Pinnacle-OA.git synced 2026-04-05 23:11:24 +08:00

Added search in UserManagement.

This commit is contained in:
2023-06-03 06:10:43 +08:00
parent c3b76cb01e
commit 0d8e337ac1
14 changed files with 230 additions and 64 deletions

View File

@@ -2,6 +2,34 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.cfive.pinnacle.mapper.permission.UserMapper">
<select id="filterUserByRoleIdAndGroupId" resultType="long">
select distinct t_user.id as user_id
from (select * from t_user where deleted = 0) as t_user
left join (select * from t_staff where deleted = 0) as ts on ts.user_id = t_user.id
left join (select * from t_user_role where deleted = 0) as tur on t_user.id = tur.user_id
left join (select * from t_role where deleted = 0) as tr on tr.id = tur.role_id
left join (select * from t_user_group where deleted = 0) as tug on t_user.id = tug.user_id
left join (select * from t_group where deleted = 0) as tg on tg.id = tug.group_id
<where>
<if test="roleId != null">
tr.id = #{roleId}
</if>
<if test="groupId != null">
and tg.id = #{groupId}
</if>
<foreach collection="userList" item="item" index="index" open="and t_user.id in (" separator="," close=")"
nullable="true">
#{item}
</foreach>
<if test="searchName != null and searchName != ''">
and instr(t_user.username, #{searchName}) > 0
</if>
<if test="searchEnable != null and searchEnable != -1">
and t_user.enable = #{searchEnable}
</if>
</where>
</select>
<select id="getAllWithRoleAndGroup" resultMap="userMap">
select distinct t_user.id as user_id,
t_user.username as user_username,