员工加角色完成

This commit is contained in:
xiao-fajia 2024-08-15 08:58:31 +08:00
parent 3addbe0b9b
commit f6bc245454

View File

@ -25,7 +25,7 @@
<result property="roleNames" column="role_names"/>
</resultMap>
<sql id="Base_SQL">
<select id="selectListPage" resultMap="BaseResultMap">
SELECT cs.id AS cs_id,
cs.corp_id AS cs_corp_id,
cs.user_id AS cs_user_id,
@ -57,13 +57,15 @@
system_role sr ON sur.role_id = sr.id
WHERE cs.deleted = '0'
AND sur.deleted = '0'
<if test="map.roleIds != null and map.roleIds.size > 0">
and sr.id in
<foreach collection="map.roleIds" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</if>
GROUP BY cs.user_id
) rn ON cs.user_id = rn.user_id
WHERE cs.deleted = '0'
</sql>
<select id="selectListPage" resultMap="BaseResultMap">
<include refid="Base_SQL"/>
<if test="map.name != null and map.name != ''">
and cs.name like concat('%', #{map.name}, '%')
</if>
@ -98,10 +100,7 @@
and cs.joined_date between #{map.joinedDateArray[0]} and #{map.joinedDateArray[1]}
</if>
<if test="map.roleIds != null and map.roleIds.size > 0">
and rn.id in
<foreach collection="map.roleIds" item="id" open="(" separator="," close=")">
#{id}
</foreach>
and rn.role_names is not null
</if>
order by cs.create_time desc
</select>