<?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.microservices.wiki.mapper.sys.UserExtensionMapper">
    <resultMap id="BaseResultMap" type="com.microservices.wiki.domain.sys.UserExtension">
    <id column="id" property="id" jdbcType="INTEGER" />
    <result column="user_id" property="userId" jdbcType="INTEGER" />
    <result column="birthday" property="birthday" jdbcType="DATE" />
    <result column="brief_introduction" property="briefIntroduction" jdbcType="VARCHAR" />
    <result column="gender" property="gender" jdbcType="INTEGER" />
    <result column="location" property="location" jdbcType="VARCHAR" />
    <result column="occupation" property="occupation" jdbcType="VARCHAR" />
    <result column="work_experience" property="workExperience" jdbcType="INTEGER" />
    <result column="zip_code" property="zipCode" jdbcType="INTEGER" />
    <result column="created_at" property="createdAt" jdbcType="TIMESTAMP" />
    <result column="updated_at" property="updatedAt" jdbcType="TIMESTAMP" />
    <result column="identity" property="identity" jdbcType="INTEGER" />
    <result column="technical_title" property="technicalTitle" jdbcType="VARCHAR" />
    <result column="student_id" property="studentId" jdbcType="VARCHAR" />
    <result column="teacher_realname" property="teacherRealname" jdbcType="VARCHAR" />
    <result column="student_realname" property="studentRealname" jdbcType="VARCHAR" />
    <result column="location_city" property="locationCity" jdbcType="VARCHAR" />
    <result column="school_id" property="schoolId" jdbcType="INTEGER" />
    <result column="description" property="description" jdbcType="VARCHAR" />
    <result column="department_id" property="departmentId" jdbcType="INTEGER" />
  </resultMap>
    <resultMap id="ResultMapWithBLOBs" type="com.microservices.wiki.domain.sys.UserExtension" extends="BaseResultMap">
    <result column="province" property="province" jdbcType="LONGVARCHAR" />
  </resultMap>
  <sql id="Base_Column_List" >
    id, user_id, birthday, brief_introduction, gender, location, occupation, work_experience, 
    zip_code, created_at, updated_at, identity, technical_title, student_id, teacher_realname, 
    student_realname, location_city, school_id, description, department_id
  </sql>
  <sql id="Blob_Column_List" >
    province
  </sql>
  <select id="selectByPrimaryKey" resultMap="ResultMapWithBLOBs" parameterType="java.lang.Integer" >
    select 
    <include refid="Base_Column_List" />
    ,
    <include refid="Blob_Column_List" />
    from user_extensions
    where id = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
    delete from user_extensions
    where id = #{id,jdbcType=INTEGER}
  </delete>
    <insert id="insert" parameterType="com.microservices.wiki.domain.sys.UserExtension">
    insert into user_extensions (id, user_id, birthday, 
      brief_introduction, gender, location, 
      occupation, work_experience, zip_code, 
      created_at, updated_at, identity, 
      technical_title, student_id, teacher_realname, 
      student_realname, location_city, school_id, 
      description, department_id, province
      )
    values (#{id,jdbcType=INTEGER}, #{userId,jdbcType=INTEGER}, #{birthday,jdbcType=DATE}, 
      #{briefIntroduction,jdbcType=VARCHAR}, #{gender,jdbcType=INTEGER}, #{location,jdbcType=VARCHAR}, 
      #{occupation,jdbcType=VARCHAR}, #{workExperience,jdbcType=INTEGER}, #{zipCode,jdbcType=INTEGER}, 
      #{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP}, #{identity,jdbcType=INTEGER}, 
      #{technicalTitle,jdbcType=VARCHAR}, #{studentId,jdbcType=VARCHAR}, #{teacherRealname,jdbcType=VARCHAR}, 
      #{studentRealname,jdbcType=VARCHAR}, #{locationCity,jdbcType=VARCHAR}, #{schoolId,jdbcType=INTEGER}, 
      #{description,jdbcType=VARCHAR}, #{departmentId,jdbcType=INTEGER}, #{province,jdbcType=LONGVARCHAR}
      )
  </insert>
    <insert id="insertSelective" parameterType="com.microservices.wiki.domain.sys.UserExtension">
    insert into user_extensions
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="id != null" >
        id,
      </if>
      <if test="userId != null" >
        user_id,
      </if>
      <if test="birthday != null" >
        birthday,
      </if>
      <if test="briefIntroduction != null" >
        brief_introduction,
      </if>
      <if test="gender != null" >
        gender,
      </if>
      <if test="location != null" >
        location,
      </if>
      <if test="occupation != null" >
        occupation,
      </if>
      <if test="workExperience != null" >
        work_experience,
      </if>
      <if test="zipCode != null" >
        zip_code,
      </if>
      <if test="createdAt != null" >
        created_at,
      </if>
      <if test="updatedAt != null" >
        updated_at,
      </if>
      <if test="identity != null" >
        identity,
      </if>
      <if test="technicalTitle != null" >
        technical_title,
      </if>
      <if test="studentId != null" >
        student_id,
      </if>
      <if test="teacherRealname != null" >
        teacher_realname,
      </if>
      <if test="studentRealname != null" >
        student_realname,
      </if>
      <if test="locationCity != null" >
        location_city,
      </if>
      <if test="schoolId != null" >
        school_id,
      </if>
      <if test="description != null" >
        description,
      </if>
      <if test="departmentId != null" >
        department_id,
      </if>
      <if test="province != null" >
        province,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="id != null" >
        #{id,jdbcType=INTEGER},
      </if>
      <if test="userId != null" >
        #{userId,jdbcType=INTEGER},
      </if>
      <if test="birthday != null" >
        #{birthday,jdbcType=DATE},
      </if>
      <if test="briefIntroduction != null" >
        #{briefIntroduction,jdbcType=VARCHAR},
      </if>
      <if test="gender != null" >
        #{gender,jdbcType=INTEGER},
      </if>
      <if test="location != null" >
        #{location,jdbcType=VARCHAR},
      </if>
      <if test="occupation != null" >
        #{occupation,jdbcType=VARCHAR},
      </if>
      <if test="workExperience != null" >
        #{workExperience,jdbcType=INTEGER},
      </if>
      <if test="zipCode != null" >
        #{zipCode,jdbcType=INTEGER},
      </if>
      <if test="createdAt != null" >
        #{createdAt,jdbcType=TIMESTAMP},
      </if>
      <if test="updatedAt != null" >
        #{updatedAt,jdbcType=TIMESTAMP},
      </if>
      <if test="identity != null" >
        #{identity,jdbcType=INTEGER},
      </if>
      <if test="technicalTitle != null" >
        #{technicalTitle,jdbcType=VARCHAR},
      </if>
      <if test="studentId != null" >
        #{studentId,jdbcType=VARCHAR},
      </if>
      <if test="teacherRealname != null" >
        #{teacherRealname,jdbcType=VARCHAR},
      </if>
      <if test="studentRealname != null" >
        #{studentRealname,jdbcType=VARCHAR},
      </if>
      <if test="locationCity != null" >
        #{locationCity,jdbcType=VARCHAR},
      </if>
      <if test="schoolId != null" >
        #{schoolId,jdbcType=INTEGER},
      </if>
      <if test="description != null" >
        #{description,jdbcType=VARCHAR},
      </if>
      <if test="departmentId != null" >
        #{departmentId,jdbcType=INTEGER},
      </if>
      <if test="province != null" >
        #{province,jdbcType=LONGVARCHAR},
      </if>
    </trim>
  </insert>
    <update id="updateByPrimaryKeySelective" parameterType="com.microservices.wiki.domain.sys.UserExtension">
    update user_extensions
    <set >
      <if test="userId != null" >
        user_id = #{userId,jdbcType=INTEGER},
      </if>
      <if test="birthday != null" >
        birthday = #{birthday,jdbcType=DATE},
      </if>
      <if test="briefIntroduction != null" >
        brief_introduction = #{briefIntroduction,jdbcType=VARCHAR},
      </if>
      <if test="gender != null" >
        gender = #{gender,jdbcType=INTEGER},
      </if>
      <if test="location != null" >
        location = #{location,jdbcType=VARCHAR},
      </if>
      <if test="occupation != null" >
        occupation = #{occupation,jdbcType=VARCHAR},
      </if>
      <if test="workExperience != null" >
        work_experience = #{workExperience,jdbcType=INTEGER},
      </if>
      <if test="zipCode != null" >
        zip_code = #{zipCode,jdbcType=INTEGER},
      </if>
      <if test="createdAt != null" >
        created_at = #{createdAt,jdbcType=TIMESTAMP},
      </if>
      <if test="updatedAt != null" >
        updated_at = #{updatedAt,jdbcType=TIMESTAMP},
      </if>
      <if test="identity != null" >
        identity = #{identity,jdbcType=INTEGER},
      </if>
      <if test="technicalTitle != null" >
        technical_title = #{technicalTitle,jdbcType=VARCHAR},
      </if>
      <if test="studentId != null" >
        student_id = #{studentId,jdbcType=VARCHAR},
      </if>
      <if test="teacherRealname != null" >
        teacher_realname = #{teacherRealname,jdbcType=VARCHAR},
      </if>
      <if test="studentRealname != null" >
        student_realname = #{studentRealname,jdbcType=VARCHAR},
      </if>
      <if test="locationCity != null" >
        location_city = #{locationCity,jdbcType=VARCHAR},
      </if>
      <if test="schoolId != null" >
        school_id = #{schoolId,jdbcType=INTEGER},
      </if>
      <if test="description != null" >
        description = #{description,jdbcType=VARCHAR},
      </if>
      <if test="departmentId != null" >
        department_id = #{departmentId,jdbcType=INTEGER},
      </if>
      <if test="province != null" >
        province = #{province,jdbcType=LONGVARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
    <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.microservices.wiki.domain.sys.UserExtension">
    update user_extensions
    set user_id = #{userId,jdbcType=INTEGER},
      birthday = #{birthday,jdbcType=DATE},
      brief_introduction = #{briefIntroduction,jdbcType=VARCHAR},
      gender = #{gender,jdbcType=INTEGER},
      location = #{location,jdbcType=VARCHAR},
      occupation = #{occupation,jdbcType=VARCHAR},
      work_experience = #{workExperience,jdbcType=INTEGER},
      zip_code = #{zipCode,jdbcType=INTEGER},
      created_at = #{createdAt,jdbcType=TIMESTAMP},
      updated_at = #{updatedAt,jdbcType=TIMESTAMP},
      identity = #{identity,jdbcType=INTEGER},
      technical_title = #{technicalTitle,jdbcType=VARCHAR},
      student_id = #{studentId,jdbcType=VARCHAR},
      teacher_realname = #{teacherRealname,jdbcType=VARCHAR},
      student_realname = #{studentRealname,jdbcType=VARCHAR},
      location_city = #{locationCity,jdbcType=VARCHAR},
      school_id = #{schoolId,jdbcType=INTEGER},
      description = #{description,jdbcType=VARCHAR},
      department_id = #{departmentId,jdbcType=INTEGER},
      province = #{province,jdbcType=LONGVARCHAR}
    where id = #{id,jdbcType=INTEGER}
  </update>
    <update id="updateByPrimaryKey" parameterType="com.microservices.wiki.domain.sys.UserExtension">
    update user_extensions
    set user_id = #{userId,jdbcType=INTEGER},
      birthday = #{birthday,jdbcType=DATE},
      brief_introduction = #{briefIntroduction,jdbcType=VARCHAR},
      gender = #{gender,jdbcType=INTEGER},
      location = #{location,jdbcType=VARCHAR},
      occupation = #{occupation,jdbcType=VARCHAR},
      work_experience = #{workExperience,jdbcType=INTEGER},
      zip_code = #{zipCode,jdbcType=INTEGER},
      created_at = #{createdAt,jdbcType=TIMESTAMP},
      updated_at = #{updatedAt,jdbcType=TIMESTAMP},
      identity = #{identity,jdbcType=INTEGER},
      technical_title = #{technicalTitle,jdbcType=VARCHAR},
      student_id = #{studentId,jdbcType=VARCHAR},
      teacher_realname = #{teacherRealname,jdbcType=VARCHAR},
      student_realname = #{studentRealname,jdbcType=VARCHAR},
      location_city = #{locationCity,jdbcType=VARCHAR},
      school_id = #{schoolId,jdbcType=INTEGER},
      description = #{description,jdbcType=VARCHAR},
      department_id = #{departmentId,jdbcType=INTEGER}
    where id = #{id,jdbcType=INTEGER}
  </update>
</mapper>