菜单代码更新
This commit is contained in:
@@ -13,7 +13,7 @@ import java.util.List;
|
|||||||
* 菜单表 Mapper 接口
|
* 菜单表 Mapper 接口
|
||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
* @author generator
|
* @author ldjun
|
||||||
* @since 2022-12-15
|
* @since 2022-12-15
|
||||||
*/
|
*/
|
||||||
public interface SysMenuMapper extends BaseMapper<SysMenu> {
|
public interface SysMenuMapper extends BaseMapper<SysMenu> {
|
||||||
@@ -32,12 +32,12 @@ public interface SysMenuMapper extends BaseMapper<SysMenu> {
|
|||||||
List<SysMenu> findByUser(@Param("userId") String userId);
|
List<SysMenu> findByUser(@Param("userId") String userId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据id获取权限
|
* 根据用户标识获取权限列表
|
||||||
*
|
*
|
||||||
* @param userId
|
* @param userId 用户标识
|
||||||
* @return
|
* @return 权限列表
|
||||||
*/
|
*/
|
||||||
List<String> getPermissionByUserId(String userId);
|
List<String> getPermissionByUserId(@Param("userId") String userId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 解绑角色菜单
|
* 解绑角色菜单
|
||||||
|
|||||||
@@ -15,34 +15,38 @@
|
|||||||
FROM
|
FROM
|
||||||
sys_roles_menus
|
sys_roles_menus
|
||||||
WHERE
|
WHERE
|
||||||
role_id IN ( SELECT role_id FROM sys_users_roles WHERE 1 = 1 and user_id=#{userId} ))
|
role_id IN ( SELECT role_id FROM sys_users_roles
|
||||||
|
<where>
|
||||||
|
and user_id=#{userId}
|
||||||
|
</where>
|
||||||
|
))
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
<select id="getPermissionByUserId" resultType="java.lang.String">
|
<select id="getPermissionByUserId" resultType="java.lang.String">
|
||||||
SELECT DISTINCT
|
SELECT DISTINCT
|
||||||
permission
|
permission
|
||||||
FROM
|
FROM
|
||||||
sys_menu
|
sys_menu
|
||||||
WHERE
|
WHERE
|
||||||
menu_id IN
|
menu_id IN
|
||||||
(
|
(
|
||||||
SELECT
|
SELECT
|
||||||
menu_id
|
menu_id
|
||||||
FROM
|
FROM
|
||||||
sys_roles_menus
|
sys_roles_menus
|
||||||
WHERE
|
WHERE
|
||||||
role_id IN
|
role_id IN
|
||||||
(
|
(
|
||||||
SELECT
|
SELECT
|
||||||
role_id
|
role_id
|
||||||
FROM
|
FROM
|
||||||
sys_users_roles
|
sys_users_roles
|
||||||
WHERE
|
<where>
|
||||||
1=1
|
<if test="userId != null">
|
||||||
<if test="userId != null">
|
AND user_id = #{userId}
|
||||||
AND user_id = #{userId}
|
</if>
|
||||||
</if>
|
</where>
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
AND permission IS NOT NULL
|
AND permission IS NOT NULL
|
||||||
AND permission != ''
|
AND permission != ''
|
||||||
|
|||||||
Reference in New Issue
Block a user