<?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.OrganizationTechMapper" >
  <resultMap id="BaseResultMap" type="com.goafanti.common.model.OrganizationTech" >
    <id column="id" property="id" jdbcType="VARCHAR" />
    <result column="uid" property="uid" jdbcType="VARCHAR" />
    <result column="technical_people_num" property="technicalPeopleNum" jdbcType="VARCHAR" />
    <result column="search_area_category" property="searchAreaCategory" jdbcType="VARCHAR" />
    <result column="search_area_det" property="searchAreaDet" jdbcType="VARCHAR" />
    <result column="specialty" property="specialty" jdbcType="VARCHAR" />
  </resultMap>
  <sql id="Base_Column_List" >
    id, uid, technical_people_num, search_area_category, search_area_det, specialty
  </sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
    select 
    <include refid="Base_Column_List" />
    from organization_tech
    where id = #{id,jdbcType=VARCHAR}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
    delete from organization_tech
    where id = #{id,jdbcType=VARCHAR}
  </delete>
  <insert id="insert" parameterType="com.goafanti.common.model.OrganizationTech" >
    insert into organization_tech (id, uid, technical_people_num, 
      search_area_category, search_area_det,specialty)
    values (#{id,jdbcType=VARCHAR}, #{uid,jdbcType=VARCHAR}, #{technicalPeopleNum,jdbcType=VARCHAR}, 
      #{searchAreaCategory,jdbcType=VARCHAR}, #{searchAreaDet,jdbcType=VARCHAR}, #{specialty,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.goafanti.common.model.OrganizationTech" >
    insert into organization_tech
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="id != null" >
        id,
      </if>
      <if test="uid != null" >
        uid,
      </if>
      <if test="technicalPeopleNum != null" >
        technical_people_num,
      </if>
      <if test="searchAreaCategory != null" >
        search_area_category,
      </if>
       <if test="searchAreaDet != null" >
        search_area_det,
      </if>
      <if test="specialty != null" >
        specialty,
      </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="technicalPeopleNum != null" >
        #{technicalPeopleNum,jdbcType=VARCHAR},
      </if>
      <if test="searchAreaCategory != null" >
        #{searchAreaCategory,jdbcType=VARCHAR},
      </if>
      <if test="searchAreaDet != null" >
        #{searchAreaDet,jdbcType=VARCHAR},
      </if>
      <if test="specialty != null" >
        #{specialty,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.OrganizationTech" >
    update organization_tech
    <set >
      <if test="uid != null" >
        uid = #{uid,jdbcType=VARCHAR},
      </if>
      <if test="technicalPeopleNum != null" >
        technical_people_num = #{technicalPeopleNum,jdbcType=VARCHAR},
      </if>
      <if test="searchAreaCategory != null" >
        search_area_category = #{searchAreaCategory,jdbcType=VARCHAR},
      </if>
      <if test="searchAreaDet != null" >
        search_area_det = #{searchAreaDet,jdbcType=VARCHAR},
      </if>
      <if test="specialty != null" >
        specialty = #{specialty,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.OrganizationTech" >
    update organization_tech
    set uid = #{uid,jdbcType=VARCHAR},
      technical_people_num = #{technicalPeopleNum,jdbcType=VARCHAR},
      search_area_category = #{searchAreaCategory,jdbcType=VARCHAR},
      search_area_det = #{searchAreaDet,jdbcType=VARCHAR},
      specialty = #{specialty,jdbcType=VARCHAR}
    where id = #{id,jdbcType=VARCHAR}
  </update>
  
   <select id="selectOrgTechByUserId" parameterType="java.lang.String" resultMap="BaseResultMap">
  	 select 
    <include refid="Base_Column_List" />
    from organization_tech
    where  uid = #{uid,jdbcType=VARCHAR}
  </select>
</mapper>