123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- <?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.abi.qms.platform.dao.mapper.UserRoleMapper">
- <!-- 通用查询映射结果 -->
- <resultMap id="BaseResultMap" type="com.abi.qms.platform.dao.entity.UserRole">
- <id column="ID" property="id" />
- <result column="ROLE_CODE" property="roleCode" />
- <result column="ROLE_NAME" property="roleName" />
- <result column="ROLE_DESC" property="roleDesc" />
- <result column="ROLE_LEVEL" property="roleLevel" />
- <result column="parent_role_code" property="parentRoleCode" />
- <result column="L1_ROLE_CODE" property="l1RoleCode" />
- <result column="L2_ROLE_CODE" property="l2RoleCode" />
- <result column="L3_ROLE_CODE" property="l3RoleCode" />
- <result column="L4_ROLE_CODE" property="l4RoleCode" />
- <result column="L5_ROLE_CODE" property="l5RoleCode" />
- <result column="is_enable" property="isEnable" />
- <result column="CREATE_TIME" property="createTime" />
- <result column="CREATE_BY" property="createBy" />
- <result column="UPDATE_TIME" property="updateTime" />
- <result column="IS_DELETE" property="isDelete" />
- </resultMap>
- <!-- 通用查询结果列 -->
- <sql id="Base_Column_List">
- ID, ROLE_CODE, ROLE_NAME, ROLE_DESC, ROLE_LEVEL, L1_ROLE_CODE, L2_ROLE_CODE, L3_ROLE_CODE, L4_ROLE_CODE, L5_ROLE_CODE, is_enable, CREATE_TIME, CREATE_BY, UPDATE_TIME, IS_DELETE
- </sql>
- <select id="listRoleFromRootRoleCode" resultType="com.abi.qms.platform.dao.vo.result.ListRoleVO">
- select r.role_code,r.role_name,r.role_desc,
- pr.role_name as parent_role_name,
- r.is_enable,r.update_time
- from user_role r
- inner join user_role pr on pr.role_code=r.parent_role_code
- <where>
- <if test="param.roleName!=null and param.roleName!=''">
- and r.role_name=#{param.roleName}
- </if>
- <if test="param.isEnable!=null and param.isEnable!=''">
- and r.is_enable=#{param.isEnable}
- </if>
- <!-- 仅可以查看当前角色树下的角色 -->
- <if test="roleLevel==1">
- and r.l1_role_code=#{roleCode}
- </if>
- <if test="roleLevel==2">
- and r.l2_role_code=#{roleCode}
- </if>
- <if test="roleLevel==3">
- and r.l3_role_code=#{roleCode}
- </if>
- <if test="roleLevel==4">
- and r.l4_role_code=#{roleCode}
- </if>
- <if test="roleLevel==5">
- and r.l5_role_code=#{roleCode}
- </if>
- </where>
- </select>
- <select id="countList" resultType="long">
- select IFNULL(count(distinct user_id),0) as user_count
- from user_mapping_info_role
- where role_code=#{roleCode}
- and is_delete=0
- </select>
- </mapper>
|