| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- <?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.yt.zhylplat.moduleLhzx.role.mapper.TLhzxRoleMapper">
- <!-- 通用查询映射结果 -->
- <resultMap id="BaseResultMap" type="com.yt.zhylplat.moduleLhzx.role.entity.TLhzxRole">
- <id column="id" property="id" />
- <result column="role_name" property="roleName" />
- <result column="role_key" property="roleKey" />
- <result column="role_sort" property="roleSort" />
- <result column="data_scope" property="dataScope" />
- <result column="menu_check_strictly" property="menuCheckStrictly" />
- <result column="dept_check_strictly" property="deptCheckStrictly" />
- <result column="status" property="status" />
- <result column="remark" property="remark" />
- <result column="create_user_id" property="createUserId" />
- <result column="create_date" property="createDate" />
- <result column="update_user_id" property="updateUserId" />
- <result column="update_date" property="updateDate" />
- <result column="del_flg" property="delFlg" />
- </resultMap>
- <!-- 通用查询结果列 -->
- <sql id="Base_Column_List">
- id, role_name, role_key, role_sort, data_scope, menu_check_strictly, dept_check_strictly, status, remark, create_user_id, create_date, update_user_id, update_date, del_flg
- </sql>
- <select id="selectRoleByUserId" resultType="com.yt.zhylplat.moduleLhzx.role.entity.TLhzxRole">
- select
- *
- from
- T_Lhzx_Role
- where
- del_flg = 0
- and
- id in (
- select
- role_id
- from
- T_Lhzx_User_Role
- where
- del_flg = 0
- and
- user_id = #{userId}
- )
- </select>
- <select id="selectMenuListByRoleId" resultType="java.lang.Integer">
- select
- m.id
- from
- T_Lhzx_Menu m
- left join
- T_Lhzx_Role_Menu rm on m.id = rm.menu_id
- where rm.role_id = #{roleId}
- and m.dept_type = #{deptType}
- <if test="menuCheckStrictly">
- and m.id not in (
- select
- m.parent_id
- from
- T_Lhzx_Menu m
- inner join
- T_Lhzx_Role_Menu rm on m.id = rm.menu_id and rm.role_id = #{roleId}
- )
- </if>
- order by m.parent_id, m.order_num
- </select>
- <select id="selectRolePermissionByUserId" resultType="com.yt.zhylplat.moduleLhzx.role.entity.TLhzxRole">
- select distinct
- r.id,
- r.role_name,
- r.role_key,
- r.role_sort,
- r.data_scope,
- r.menu_check_strictly,
- r.dept_check_strictly,
- r.status,
- r.del_flg,
- r.create_date,
- r.remark,
- r.id as roleId
- from
- T_Lhzx_Role r
- left join
- T_Lhzx_User_Role ur on ur.role_id = r.id
- left join
- T_Sys_UserAccount u on u.F_UserId = ur.user_id
- WHERE
- r.del_flg = 0
- and
- ur.user_id = #{userId}
- </select>
- </mapper>
|