12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- <?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.gxzc.zen.api.sys.mapper.SysRoleMapper">
- <!-- 通用查询映射结果 -->
- <resultMap id="BaseResultMap" type="com.gxzc.zen.api.sys.model.SysRole">
- <result column="id" property="id"/>
- <result column="enable" property="enable"/>
- <result column="remark" property="remark"/>
- <result column="create_time" property="createTime"/>
- <result column="create_by" property="createBy"/>
- <result column="update_time" property="updateTime"/>
- <result column="update_by" property="updateBy"/>
- <result column="parent_id" property="parentId"/>
- <result column="name" property="name"/>
- <result column="path" property="path"/>
- <result column="code" property="code"/>
- <result column="ext1" property="ext1"/>
- <result column="ext2" property="ext2"/>
- <result column="ext3" property="ext3"/>
- <result column="ext4" property="ext4"/>
- <result column="ext5" property="ext5"/>
- </resultMap>
- <sql id="CommonColumns">
- ${prefix}.id,
- ${prefix}.enable,
- ${prefix}.remark,
- ${prefix}.create_time AS createTime,
- ${prefix}.create_by AS createBy,
- ${prefix}.update_time AS updateTime,
- ${prefix}.update_by AS updateBy,
- </sql>
- <sql id="Columns">
- <include refid="CommonColumns">
- <property name="prefix" value="${prefix}"/>
- </include>
- ${prefix}.parent_id AS parentId,
- ${prefix}.name,
- ${prefix}.path,
- ${prefix}.code,
- ${prefix}.ext1,
- ${prefix}.ext2,
- ${prefix}.ext3,
- ${prefix}.ext4,
- ${prefix}.ext5
- </sql>
- <select id="selectByUserId" resultType="com.gxzc.zen.api.sys.model.SysRole">
- SELECT
- <include refid="Columns">
- <property name="prefix" value="A"/>
- </include>
- FROM sys_role AS A
- INNER JOIN sys_user_role AS B ON A.id = B.role_id
- WHERE B.user_id = #{userId}
- AND A.enable = 1
- </select>
- </mapper>
|