增加 按多个角色查询用户接口 user.roleCodes

This commit is contained in:
thinkgem
2025-04-25 18:47:42 +08:00
parent bd059ab63e
commit 9fedbcaa64

View File

@@ -13,7 +13,7 @@
<select id="findList" resultType="EmpUser">
SELECT ${sqlMap.column.toSql()}
FROM ${sqlMap.table.toSql()}
<if test="roleCode != null and roleCode != ''">
<if test="(roleCode != null and roleCode != '') or (roleCodes != null and roleCodes.length gt 0)">
JOIN ${_prefix}sys_user_role ur2 ON ur2.user_code = a.user_code
</if>
<if test="employee.postCode != null and employee.postCode != ''">
@@ -24,6 +24,12 @@
<if test="roleCode != null and roleCode != ''">
AND ur2.role_code = #{roleCode}
</if>
<if test="roleCodes != null and roleCodes.length gt 0">
AND ur2.role_code IN
<foreach collection="roleCodes" item="roleCode" open="(" separator="," close=")">
#{roleCode}
</foreach>
</if>
<if test="employee.postCode != null and employee.postCode != ''">
AND (
ep.post_code = #{employee.postCode}