12345678910111213141516171819202122232425262728 |
- <?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.inkasso.factoring.system.resource.dao.ResourceDAO">
- <select id="getResourceById" resultType="com.inkasso.factoring.system.resource.model.dto.ResourceDTO">
- select
- distinct
- d.*
- from kfb_sys_user_role a
- JOIN kfb_sys_role b on a.tenant_id = b.tenant_id and a.role_id = b.id
- JOIN kfb_sys_role_resource c on b.id = c.role_id
- LEFT JOIN kfb_sys_resource d on c.resource_id = d.id
- where a.user_id = #{userId} and a.tenant_id = #{tenantId}
- </select>
- <!-- 通过角色id 查询 该角色下的资源 -->
- <select id="getResourceByRoleId" resultType="com.inkasso.factoring.system.resource.model.dto.ResourceDTO"
- parameterType="java.lang.Long">
- select
- a.*
- from kfb_sys_resource a
- left join kfb_sys_role_resource b on a.id = b.resource_id
- where b.role_id = #{roleId}
- </select>
- </mapper>
|