修复部门删除时sql解析异常

This commit is contained in:
Zheng Jie 2023-06-27 17:33:40 +08:00
parent 927589fd3f
commit f30f3b24ea
2 changed files with 11 additions and 3 deletions

View File

@ -44,9 +44,7 @@ public interface RoleMapper extends BaseMapper<Role> {
List<Role> findAll(@Param("criteria") RoleQueryCriteria criteria);
@Select("select count(*) from sys_role r, sys_roles_depts d where " +
"r.role_id = d.role_id and d.dept_id in ?1")
int countByDepts(Set<Long> deptIds);
int countByDepts(@Param("deptIds") Set<Long> deptIds);
@Select("SELECT role.role_id as id FROM sys_role role, sys_roles_menus rm " +
"WHERE role.role_id = rm.role_id AND rm.menu_id = #{menuId}")

View File

@ -112,4 +112,14 @@
left join sys_users_roles ur on role.role_id = ur.role_id
WHERE role.role_id = ur.role_id AND ur.user_id = #{userId}
</select>
<select id="countByDepts" resultType="int">
select count(*)
from sys_role r, sys_roles_depts d
where r.role_id = d.role_id
and d.dept_id in
<foreach collection="deptIds" item="deptId" open="(" separator="," close=")">
#{deptId}
</foreach>
</select>
</mapper>