<?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.sooka.mybatis.mapper.TSysRoleMapper">
  <resultMap id="BaseResultMap" type="com.sooka.mybatis.model.TSysRole">
    <id column="role_id" jdbcType="INTEGER" property="roleId" />
    <result column="rolename" jdbcType="VARCHAR" property="rolename" />
    <result column="description" jdbcType="LONGVARCHAR" property="description" />
  </resultMap>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    delete from t_sys_role
    where role_id = #{roleId,jdbcType=INTEGER}
  </delete>
  <insert id="insert" useGeneratedKeys="true" keyProperty="roleId" parameterType="com.sooka.mybatis.model.TSysRole">
    insert into t_sys_role (rolename, description
      )
    values (#{rolename,jdbcType=VARCHAR}, #{description,jdbcType=LONGVARCHAR})
  </insert>
  <update id="updateByPrimaryKey" parameterType="com.sooka.mybatis.model.TSysRole">
    update t_sys_role
    set rolename = #{rolename,jdbcType=VARCHAR},
      description = #{description,jdbcType=LONGVARCHAR}
    where role_id = #{roleId,jdbcType=INTEGER}
  </update>
  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
    select role_id, rolename, description
    from t_sys_role
    where role_id = #{roleId,jdbcType=INTEGER}
  </select>
  <select id="selectAll" resultMap="BaseResultMap">
    select role_id, rolename, description
    from t_sys_role
  </select>
</mapper>