1234567891011121314151617181920212223242526272829303132333435363738 |
- <?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.SysUserRoleMapper">
- <!-- 通用查询映射结果 -->
- <resultMap id="BaseResultMap" type="com.gxzc.zen.api.sys.model.SysUserRole">
- <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="role_id" property="roleId"/>
- <result column="user_id" property="userId"/>
- </resultMap>
- <select id="selectUserRoleListByUserId" resultType="com.gxzc.zen.api.sys.model.SysRole">
- SELECT A.*
- FROM
- sys_role AS A
- INNER JOIN sys_user_role AS B ON B.role_id = A.id
- WHERE B.user_id = #{userId}
- </select>
- <select id="selectUserRoleListByUserIdList" parameterType="java.util.Map" resultType="com.gxzc.zen.api.sys.model.SysRole">
- SELECT A.*
- FROM
- sys_role AS A
- INNER JOIN sys_user_role AS B ON B.role_id = A.id
- WHERE
- B.user_id IN
- <foreach collection="userIdList" item="item" open="(" close=")">
- #{item}
- </foreach>
- </select>
- </mapper>
|