<?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.UserEduMapper" >
  <resultMap id="BaseResultMap" type="com.goafanti.common.model.UserEdu" >
    <id column="id" property="id" jdbcType="VARCHAR" />
    <result column="uid" property="uid" jdbcType="VARCHAR" />
    <result column="education" property="education" jdbcType="VARCHAR" />
    <result column="major_category" property="majorCategory" jdbcType="VARCHAR" />
    <result column="major_name" property="majorName" jdbcType="VARCHAR" />
    <result column="graduate_school" property="graduateSchool" jdbcType="VARCHAR" />
    <result column="graduation_time_year" property="graduationTimeYear" jdbcType="VARCHAR" />
    <result column="graduation_time_month" property="graduationTimeMonth" jdbcType="VARCHAR" />
    <result column="graduation_time_day" property="graduationTimeDay" jdbcType="VARCHAR" />
    <result column="diploma_url" property="diplomaUrl" jdbcType="VARCHAR" />
    <result column="diploma_code" property="diplomaCode" jdbcType="VARCHAR" />
    <result column="degree_diploma_url" property="degreeDiplomaUrl" jdbcType="VARCHAR" />
    <result column="degree_code" property="degreeCode" jdbcType="VARCHAR" />
  </resultMap>
  <sql id="Base_Column_List" >
    id, uid, education, major_category, major_name, graduate_school, graduation_time_year, 
    graduation_time_month, graduation_time_day,
    diploma_url, diploma_code, 
    degree_diploma_url, degree_code
  </sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
    select 
    <include refid="Base_Column_List" />
    from user_edu
    where id = #{id,jdbcType=VARCHAR}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
    delete from user_edu
    where id = #{id,jdbcType=VARCHAR}
  </delete>
  <insert id="insert" parameterType="com.goafanti.common.model.UserEdu" >
    insert into user_edu (id, uid, education, 
      major_category,  major_name, graduate_school, graduation_time_year, graduation_time_month, graduation_time_day, 
      diploma_url, diploma_code, degree_diploma_url, 
      degree_code)
    values (#{id,jdbcType=VARCHAR}, #{uid,jdbcType=VARCHAR}, #{education,jdbcType=VARCHAR}, 
      #{majorCategory,jdbcType=VARCHAR},  #{majorName,jdbcType=VARCHAR},
       #{graduateSchool,jdbcType=VARCHAR}, #{graduationTimeYear,jdbcType=VARCHAR},
       #{graduationTimeMonth,jdbcType=VARCHAR},#{graduationTimeDay,jdbcType=VARCHAR}, 
      #{diplomaUrl,jdbcType=VARCHAR}, #{diplomaCode,jdbcType=VARCHAR}, #{degreeDiplomaUrl,jdbcType=VARCHAR}, 
      #{degreeCode,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.goafanti.common.model.UserEdu" >
    insert into user_edu
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="id != null" >
        id,
      </if>
      <if test="uid != null" >
        uid,
      </if>
      <if test="education != null" >
        education,
      </if>
      <if test="majorCategory != null" >
        major_category,
      </if>
      <if test="majorName != null" >
        major_name,
      </if>
      <if test="graduateSchool != null" >
        graduate_school,
      </if>
      <if test="graduationTimeYear != null" >
        graduation_time_year,
      </if>
      <if test="graduationTimeMonth != null" >
        graduation_time_Month,
      </if>
      <if test="graduationTimeDay != null" >
        graduation_time_day,
      </if>
      <if test="diplomaUrl != null" >
        diploma_url,
      </if>
      <if test="diplomaCode != null" >
        diploma_code,
      </if>
      <if test="degreeDiplomaUrl != null" >
        degree_diploma_url,
      </if>
      <if test="degreeCode != null" >
        degree_code,
      </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="education != null" >
        #{education,jdbcType=VARCHAR},
      </if>
      <if test="majorCategory != null" >
        #{majorCategory,jdbcType=VARCHAR},
      </if>
       <if test="majorName != null" >
        #{majorName,jdbcType=VARCHAR},
      </if>
      <if test="graduateSchool != null" >
        #{graduateSchool,jdbcType=VARCHAR},
      </if>
      <if test="graduationTimeYear != null" >
        #{graduationTimeYear,jdbcType=VARCHAR},
      </if>
      <if test="graduationTimeMonth != null" >
        #{graduationTimeMonth,jdbcType=VARCHAR},
      </if>
      <if test="graduationTimeDay != null" >
        #{graduationTimeDay,jdbcType=VARCHAR},
      </if>
      <if test="diplomaUrl != null" >
        #{diplomaUrl,jdbcType=VARCHAR},
      </if>
      <if test="diplomaCode != null" >
        #{diplomaCode,jdbcType=VARCHAR},
      </if>
      <if test="degreeDiplomaUrl != null" >
        #{degreeDiplomaUrl,jdbcType=VARCHAR},
      </if>
      <if test="degreeCode != null" >
        #{degreeCode,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.UserEdu" >
    update user_edu
    <set >
      <if test="uid != null" >
        uid = #{uid,jdbcType=VARCHAR},
      </if>
      <if test="education != null" >
        education = #{education,jdbcType=VARCHAR},
      </if>
      <if test="majorCategory != null" >
        major_Category = #{majorCategory,jdbcType=VARCHAR},
      </if>
       <if test="majorName != null" >
        major_name = #{majorName,jdbcType=VARCHAR},
      </if>
      <if test="graduateSchool != null" >
        graduate_school = #{graduateSchool,jdbcType=VARCHAR},
      </if>
      <if test="graduationTimeYear != null" >
        graduation_time_year = #{graduationTimeYear,jdbcType=VARCHAR},
      </if>
      <if test="graduationTimeMonth != null" >
        graduation_time_month = #{graduationTimeMonth,jdbcType=VARCHAR},
      </if>
      <if test="graduationTimeDay != null" >
        graduation_time_day = #{graduationTimeDay,jdbcType=VARCHAR},
      </if>
      <if test="diplomaUrl != null" >
        diploma_Url = #{diplomaUrl,jdbcType=VARCHAR},
      </if>
      <if test="diplomaCode != null" >
        diploma_code = #{diplomaCode,jdbcType=VARCHAR},
      </if>
      <if test="degreeDiplomaUrl != null" >
        degree_diploma_url = #{degreeDiplomaUrl,jdbcType=VARCHAR},
      </if>
      <if test="degreeCode != null" >
        degree_code = #{degreeCode,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.UserEdu" >
    update user_edu
    set uid = #{uid,jdbcType=VARCHAR},
      education = #{education,jdbcType=VARCHAR},
      major_category = #{majorCategory,jdbcType=VARCHAR},
       major_name = #{majorName,jdbcType=VARCHAR},
      graduate_school = #{graduateSchool,jdbcType=VARCHAR},
      graduation_time_year = #{graduationTimeYear,jdbcType=VARCHAR},
      graduation_time_month = #{graduationTimeMonth,jdbcType=VARCHAR},
      graduation_time_day = #{graduationTimeDay,jdbcType=VARCHAR},
      diploma_url = #{diplomaUrl,jdbcType=VARCHAR},
      diploma_code = #{diplomaCode,jdbcType=VARCHAR},
      degree_diploma_url = #{degreeDiplomaUrl,jdbcType=VARCHAR},
      degree_code = #{degreeCode,jdbcType=VARCHAR}
    where id = #{id,jdbcType=VARCHAR}
  </update>
  
   <select id="selectUserEduByUserId" parameterType="java.lang.String" resultMap="BaseResultMap">
  	 select 
    <include refid="Base_Column_List" />
    from user_edu
    where uid = #{uid,jdbcType=VARCHAR}
  </select>
</mapper>