<?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.goafanti.common.dao.StarMapper" >
  <resultMap id="BaseResultMap" type="com.goafanti.common.model.Star" >
    <id column="id" property="id" jdbcType="VARCHAR" />
    <result column="uid" property="uid" jdbcType="VARCHAR" />
    <result column="hot" property="hot" jdbcType="INTEGER" />
    <result column="star" property="star" jdbcType="INTEGER" />
    <result column="portal_url" property="portalUrl" jdbcType="VARCHAR" />
  </resultMap>
  <sql id="Base_Column_List" >
    id, uid, hot, star, portal_url
  </sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
    select 
    <include refid="Base_Column_List" />
    from star
    where id = #{id,jdbcType=VARCHAR}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
    delete from star
    where id = #{id,jdbcType=VARCHAR}
  </delete>
  <insert id="insert" parameterType="com.goafanti.common.model.Star" >
    insert into star (id, uid, hot, 
      star, portal_url)
    values (#{id,jdbcType=VARCHAR}, #{uid,jdbcType=VARCHAR}, #{hot,jdbcType=INTEGER}, 
      #{star,jdbcType=INTEGER}, #{portalUrl,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.goafanti.common.model.Star" >
    insert into star
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="id != null" >
        id,
      </if>
      <if test="uid != null" >
        uid,
      </if>
      <if test="hot != null" >
        hot,
      </if>
      <if test="star != null" >
        star,
      </if>
      <if test="portalUrl != null" >
        portal_url,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="id != null" >
        #{id,jdbcType=VARCHAR},
      </if>
      <if test="uid != null" >
        #{uid,jdbcType=VARCHAR},
      </if>
      <if test="hot != null" >
        #{hot,jdbcType=INTEGER},
      </if>
      <if test="star != null" >
        #{star,jdbcType=INTEGER},
      </if>
      <if test="portalUrl != null" >
        #{portalUrl,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.Star" >
    update star
    <set >
      <if test="uid != null" >
        uid = #{uid,jdbcType=VARCHAR},
      </if>
      <if test="hot != null" >
        hot = #{hot,jdbcType=INTEGER},
      </if>
      <if test="star != null" >
        star = #{star,jdbcType=INTEGER},
      </if>
      <if test="portalUrl != null" >
        portal_url = #{portalUrl,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.Star" >
    update star
    set uid = #{uid,jdbcType=VARCHAR},
      hot = #{hot,jdbcType=INTEGER},
      star = #{star,jdbcType=INTEGER},
      portal_url = #{portalUrl,jdbcType=VARCHAR}
    where id = #{id,jdbcType=VARCHAR}
  </update>
</mapper>