<?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="io.renren.modules.sys.dao.algs.CategoryMapper">
    <resultMap id="BaseResultMap" type="io.renren.modules.sys.entity.algs.CategoryEntity">
        <id column="id" jdbcType="INTEGER" property="categoryId" />
        <result column="name" jdbcType="VARCHAR" property="categoryName" />
    </resultMap>
    <sql id="Base_Column_List">
    id, name
  </sql>
    <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List" />
        from classification
        where id = #{categoryId,jdbcType=INTEGER}
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    delete from classification
    where id = #{categoryId,jdbcType=INTEGER}
  </delete>
    <insert id="insert" parameterType="io.renren.modules.sys.entity.algs.CategoryEntity">
    insert into classification (id, name)
    values (#{categoryId,jdbcType=INTEGER}, #{categoryName,jdbcType=VARCHAR})
  </insert>
    <insert id="insertSelective" parameterType="io.renren.modules.sys.entity.algs.CategoryEntity">
        insert into classification
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="categoryId != null">
                id,
            </if>
            <if test="categoryName != null">
                name,
            </if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="categoryId != null">
                #{id,jdbcType=INTEGER},
            </if>
            <if test="categoryName != null">
                #{name,jdbcType=VARCHAR},
            </if>
        </trim>
    </insert>
    <update id="updateByPrimaryKeySelective" parameterType="io.renren.modules.sys.entity.algs.CategoryEntity">
        update classification
        <set>
            <if test="categoryName != null">
                name = #{categoryName,jdbcType=VARCHAR},
            </if>
        </set>
        where id = #{categoryId,jdbcType=INTEGER}
    </update>
    <update id="updateByPrimaryKey" parameterType="io.renren.modules.sys.entity.algs.CategoryEntity">
    update classification
    set name = #{categoryName,jdbcType=VARCHAR}
    where id = #{categoryId,jdbcType=INTEGER}
  </update>
</mapper>