<?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.hanserwei.hannote.user.biz.domain.mapper.RoleDOMapper">
  <resultMap id="BaseResultMap" type="com.hanserwei.hannote.user.biz.domain.dataobject.RoleDO">
    <!--@mbg.generated-->
    <!--@Table t_role-->
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="role_name" jdbcType="VARCHAR" property="roleName" />
    <result column="role_key" jdbcType="VARCHAR" property="roleKey" />
    <result column="status" jdbcType="TINYINT" property="status" />
    <result column="sort" jdbcType="INTEGER" property="sort" />
    <result column="remark" jdbcType="VARCHAR" property="remark" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
    <result column="is_deleted" jdbcType="BIT" property="isDeleted" />
  </resultMap>
  <sql id="Base_Column_List">
    <!--@mbg.generated-->
    id, role_name, role_key, `status`, sort, remark, create_time, update_time, is_deleted
  </sql>

  <select id="selectEnabledList" resultMap="BaseResultMap">
      select id, role_key, role_name
      from t_role
      where status = 0
        and is_deleted = 0;
  </select>

  <select id="selectByPrimaryKey" resultMap="BaseResultMap">
      select
      <include refid="Base_Column_List"/>
      from t_role
      where id = #{id,jdbcType=BIGINT}
        and is_deleted = 0
        and status = 0;
  </select>
</mapper>