|
- <?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.imitate.common.shiro.mapper.SysRoleMapper">
-
- <resultMap id="rm" type="com.imitate.common.shiro.pojo.SysRole">
- <result property="id" jdbcType="BIGINT" column="id"/>
- <result property="roleName" jdbcType="VARCHAR" column="role_name"/>
- <result property="remark" jdbcType="VARCHAR" column="remark"/>
- <result column="create_user_id" property="createUserId" jdbcType="BIGINT" />
- <result property="createTime" jdbcType="TIMESTAMP" column="create_time"/>
- <result property="updateTime" jdbcType="TIMESTAMP" column="update_time"/>
- <result property="userNum" column="user_num" jdbcType="INTEGER" />
- </resultMap>
-
-
- <!-- 查询用户创建的角色ID列表 -->
- <select id="queryRoleIdList" resultType="long">
- select id from edu_sys_role where create_user_id = #{createUserId}
- </select>
-
-
- <select id="get" parameterType="Long" resultMap="rm">
- SELECT a.`id`, a.`role_name`, a.`remark`,
- a.`create_user_id`, a.`create_time`,a.`update_time`
- FROM edu_sys_role AS a
- WHERE 1=1
- <if test="id != null">
- AND a.id = #{id}
- </if>
- ORDER BY
- a.id DESC
- </select>
-
-
- </mapper>
|