<?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.UserCareerMapper" >
  <resultMap id="BaseResultMap" type="com.goafanti.common.model.UserCareer" >
    <id column="id" property="id" jdbcType="VARCHAR" />
    <result column="uid" property="uid" jdbcType="VARCHAR" />
    <result column="engaged_field" property="engagedField" jdbcType="VARCHAR" />
    <result column="working_age" property="workingAge" jdbcType="VARCHAR" />
    <result column="professional_title" property="professionalTitle" jdbcType="VARCHAR" />
    <result column="professional_title_gettime" property="professionalTitleGettime" jdbcType="VARCHAR" />
    <result column="professional_certificate_url" property="professionalCertificateUrl" jdbcType="VARCHAR" />
    <result column="qualification" property="qualification" jdbcType="VARCHAR" />
    <result column="qualification_gettime" property="qualificationGettime" jdbcType="VARCHAR" />
    <result column="qualification_certificate_url" property="qualificationCertificateUrl" jdbcType="VARCHAR" />
    <result column="work_unit" property="workUnit" jdbcType="VARCHAR" />
    <result column="position" property="position" jdbcType="VARCHAR" />
    <result column="experiences" property="experiences" jdbcType="VARCHAR" />
    <result column="achievement" property="achievement" jdbcType="VARCHAR" />
  </resultMap>
  <sql id="Base_Column_List" >
    id, uid, engaged_field, working_age, professional_title, professional_title_gettime, 
    professional_certificate_url, qualification, qualification_gettime, qualification_certificate_url, 
    work_unit, position, experiences, achievement
  </sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
    select 
    <include refid="Base_Column_List" />
    from user_career
    where id = #{id,jdbcType=VARCHAR}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
    delete from user_career
    where id = #{id,jdbcType=VARCHAR}
  </delete>
  <insert id="insert" parameterType="com.goafanti.common.model.UserCareer" >
    insert into user_career (id, uid, engaged_field, 
      working_age, professional_title, professional_title_gettime, 
      professional_certificate_url, qualification, 
      qualification_gettime, qualification_certificate_url, 
      work_unit, position, experiences, 
      achievement)
    values (#{id,jdbcType=VARCHAR}, #{uid,jdbcType=VARCHAR}, #{engagedField,jdbcType=VARCHAR}, 
      #{workingAge,jdbcType=VARCHAR}, #{professionalTitle,jdbcType=VARCHAR}, #{professionalTitleGettime,jdbcType=VARCHAR}, 
      #{professionalCertificateUrl,jdbcType=VARCHAR}, #{qualification,jdbcType=VARCHAR}, 
      #{qualificationGettime,jdbcType=VARCHAR}, #{qualificationCertificateUrl,jdbcType=VARCHAR}, 
      #{workUnit,jdbcType=VARCHAR}, #{position,jdbcType=VARCHAR}, #{experiences,jdbcType=VARCHAR}, 
      #{achievement,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.goafanti.common.model.UserCareer" >
    insert into user_career
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="id != null" >
        id,
      </if>
      <if test="uid != null" >
        uid,
      </if>
      <if test="engagedField != null" >
        engaged_field,
      </if>
      <if test="workingAge != null" >
        working_age,
      </if>
      <if test="professionalTitle != null" >
        professional_title,
      </if>
      <if test="professionalTitleGettime != null" >
        professional_title_gettime,
      </if>
      <if test="professionalCertificateUrl != null" >
        professional_certificate_url,
      </if>
      <if test="qualification != null" >
        qualification,
      </if>
      <if test="qualificationGettime != null" >
        qualification_gettime,
      </if>
      <if test="qualificationCertificateUrl != null" >
        qualification_certificate_url,
      </if>
      <if test="workUnit != null" >
        work_unit,
      </if>
      <if test="position != null" >
        position,
      </if>
      <if test="experiences != null" >
        experiences,
      </if>
      <if test="achievement != null" >
        achievement,
      </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="engagedField != null" >
        #{engagedField,jdbcType=VARCHAR},
      </if>
      <if test="workingAge != null" >
        #{workingAge,jdbcType=VARCHAR},
      </if>
      <if test="professionalTitle != null" >
        #{professionalTitle,jdbcType=VARCHAR},
      </if>
      <if test="professionalTitleGettime != null" >
        #{professionalTitleGettime,jdbcType=VARCHAR},
      </if>
      <if test="professionalCertificateUrl != null" >
        #{professionalCertificateUrl,jdbcType=VARCHAR},
      </if>
      <if test="qualification != null" >
        #{qualification,jdbcType=VARCHAR},
      </if>
      <if test="qualificationGettime != null" >
        #{qualificationGettime,jdbcType=VARCHAR},
      </if>
      <if test="qualificationCertificateUrl != null" >
        #{qualificationCertificateUrl,jdbcType=VARCHAR},
      </if>
      <if test="workUnit != null" >
        #{workUnit,jdbcType=VARCHAR},
      </if>
      <if test="position != null" >
        #{position,jdbcType=VARCHAR},
      </if>
      <if test="experiences != null" >
        #{experiences,jdbcType=VARCHAR},
      </if>
      <if test="achievement != null" >
        #{achievement,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.UserCareer" >
    update user_career
    <set >
      <if test="uid != null" >
        uid = #{uid,jdbcType=VARCHAR},
      </if>
      <if test="engagedField != null" >
        engaged_field = #{engagedField,jdbcType=VARCHAR},
      </if>
      <if test="workingAge != null" >
        working_age = #{workingAge,jdbcType=VARCHAR},
      </if>
      <if test="professionalTitle != null" >
        professional_title = #{professionalTitle,jdbcType=VARCHAR},
      </if>
      <if test="professionalTitleGettime != null" >
        professional_title_gettime = #{professionalTitleGettime,jdbcType=VARCHAR},
      </if>
      <if test="professionalCertificateUrl != null" >
        professional_certificate_url = #{professionalCertificateUrl,jdbcType=VARCHAR},
      </if>
      <if test="qualification != null" >
        qualification = #{qualification,jdbcType=VARCHAR},
      </if>
      <if test="qualificationGettime != null" >
        qualification_gettime = #{qualificationGettime,jdbcType=VARCHAR},
      </if>
      <if test="qualificationCertificateUrl != null" >
        qualification_certificate_url = #{qualificationCertificateUrl,jdbcType=VARCHAR},
      </if>
      <if test="workUnit != null" >
        work_unit = #{workUnit,jdbcType=VARCHAR},
      </if>
      <if test="position != null" >
        position = #{position,jdbcType=VARCHAR},
      </if>
      <if test="experiences != null" >
        experiences = #{experiences,jdbcType=VARCHAR},
      </if>
      <if test="achievement != null" >
        achievement = #{achievement,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.UserCareer" >
    update user_career
    set uid = #{uid,jdbcType=VARCHAR},
      engaged_field = #{engagedField,jdbcType=VARCHAR},
      working_age = #{workingAge,jdbcType=VARCHAR},
      professional_title = #{professionalTitle,jdbcType=VARCHAR},
      professional_title_gettime = #{professionalTitleGettime,jdbcType=VARCHAR},
      professional_certificate_url = #{professionalCertificateUrl,jdbcType=VARCHAR},
      qualification = #{qualification,jdbcType=VARCHAR},
      qualification_gettime = #{qualificationGettime,jdbcType=VARCHAR},
      qualification_certificate_url = #{qualificationCertificateUrl,jdbcType=VARCHAR},
      work_unit = #{workUnit,jdbcType=VARCHAR},
      position = #{position,jdbcType=VARCHAR},
      experiences = #{experiences,jdbcType=VARCHAR},
      achievement = #{achievement,jdbcType=VARCHAR}
    where id = #{id,jdbcType=VARCHAR}
  </update>
  
   <select id="selectUserCareerByUserId" parameterType="java.lang.String" resultMap="BaseResultMap">
  	 select 
    <include refid="Base_Column_List" />
    from user_career
    where uid = #{uid,jdbcType=VARCHAR}
  </select>
  
  
</mapper>