From f30f3b24ea362ecc544d92bee39be74089a7856c Mon Sep 17 00:00:00 2001 From: Zheng Jie <201507802@qq.com> Date: Tue, 27 Jun 2023 17:33:40 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=83=A8=E9=97=A8=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E6=97=B6sql=E8=A7=A3=E6=9E=90=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../me/zhengjie/modules/system/mapper/RoleMapper.java | 4 +--- .../src/main/resources/mapper/system/RoleMapper.xml | 10 ++++++++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/eladmin/eladmin-system/src/main/java/me/zhengjie/modules/system/mapper/RoleMapper.java b/eladmin/eladmin-system/src/main/java/me/zhengjie/modules/system/mapper/RoleMapper.java index e3219d7..8e50369 100644 --- a/eladmin/eladmin-system/src/main/java/me/zhengjie/modules/system/mapper/RoleMapper.java +++ b/eladmin/eladmin-system/src/main/java/me/zhengjie/modules/system/mapper/RoleMapper.java @@ -44,9 +44,7 @@ public interface RoleMapper extends BaseMapper { List 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 deptIds); + int countByDepts(@Param("deptIds") Set 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}") diff --git a/eladmin/eladmin-system/src/main/resources/mapper/system/RoleMapper.xml b/eladmin/eladmin-system/src/main/resources/mapper/system/RoleMapper.xml index 51d5558..c4962e5 100644 --- a/eladmin/eladmin-system/src/main/resources/mapper/system/RoleMapper.xml +++ b/eladmin/eladmin-system/src/main/resources/mapper/system/RoleMapper.xml @@ -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} + + \ No newline at end of file