50 lines
1.7 KiB
XML
50 lines
1.7 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
|
<mapper namespace="com.njzscloud.supervisory.resource.mapper.SysResourceMapper">
|
|
|
|
<resultMap id="listUserMenuMap" autoMapping="true" type="com.njzscloud.common.security.support.MenuResource">
|
|
<result property="breadcrumb" column="breadcrumb" typeHandler="com.njzscloud.common.mp.support.handler.j.JsonTypeHandler"/>
|
|
</resultMap>
|
|
<select id="listUserMenu" resultMap="listUserMenuMap">
|
|
SELECT DISTINCT a.id,
|
|
a.sn,
|
|
a.pid,
|
|
a.title,
|
|
a.icon,
|
|
a.tier,
|
|
a.breadcrumb,
|
|
a.sort,
|
|
a.route_name,
|
|
a.menu_category
|
|
FROM sys_menu a
|
|
INNER JOIN sys_role_resource b ON b.data_id = a.id AND b.table_name = 'sys_menu'
|
|
AND b.role_id IN (SELECT a.id
|
|
FROM sys_role a
|
|
INNER JOIN sys_user_role b ON b.role_id = a.id AND b.user_id = #{userId}
|
|
WHERE a.deleted = 0)
|
|
WHERE a.deleted = 0
|
|
</select>
|
|
|
|
<select id="listUserEndpoint" resultType="com.njzscloud.common.security.support.EndpointResource">
|
|
SELECT DISTINCT a.id,
|
|
a.request_method,
|
|
a.routing_path,
|
|
a.endpoint_path,
|
|
a.access_model,
|
|
a.memo,
|
|
a.creator_id,
|
|
a.modifier_id,
|
|
a.create_time,
|
|
a.modify_time,
|
|
a.deleted
|
|
FROM sys_endpoint a
|
|
INNER JOIN sys_role_resource b ON b.data_id = a.id AND b.table_name = 'sys_endpoint'
|
|
AND b.role_id IN (SELECT a.id
|
|
FROM sys_role a
|
|
INNER JOIN sys_user_role b ON b.role_id = a.id AND b.user_id = #{userId}
|
|
WHERE a.deleted = 0)
|
|
WHERE a.deleted = 0
|
|
</select>
|
|
</mapper>
|