<?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.OrganizationBusinessScopeMapper">
  <resultMap id="BaseResultMap" type="com.goafanti.common.model.OrganizationBusinessScope">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Mon Jan 04 17:13:19 CST 2021.
    -->
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="uid" jdbcType="VARCHAR" property="uid" />
    <result column="keyword" jdbcType="VARCHAR" property="keyword" />
  </resultMap>
  <sql id="Base_Column_List">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Mon Jan 04 17:13:19 CST 2021.
    -->
    id, `uid`, keyword
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Mon Jan 04 17:13:19 CST 2021.
    -->
    select 
    <include refid="Base_Column_List" />
    from organization_business_scope
    where id = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Mon Jan 04 17:13:19 CST 2021.
    -->
    delete from organization_business_scope
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="com.goafanti.common.model.OrganizationBusinessScope">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Mon Jan 04 17:13:19 CST 2021.
    -->
    insert into organization_business_scope (id, `uid`, keyword
      )
    values (#{id,jdbcType=INTEGER}, #{uid,jdbcType=VARCHAR}, #{keyword,jdbcType=VARCHAR}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.goafanti.common.model.OrganizationBusinessScope">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Mon Jan 04 17:13:19 CST 2021.
    -->
    insert into organization_business_scope
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="uid != null">
        `uid`,
      </if>
      <if test="keyword != null">
        keyword,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=INTEGER},
      </if>
      <if test="uid != null">
        #{uid,jdbcType=VARCHAR},
      </if>
      <if test="keyword != null">
        #{keyword,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.OrganizationBusinessScope">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Mon Jan 04 17:13:19 CST 2021.
    -->
    update organization_business_scope
    <set>
      <if test="uid != null">
        `uid` = #{uid,jdbcType=VARCHAR},
      </if>
      <if test="keyword != null">
        keyword = #{keyword,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.OrganizationBusinessScope">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Mon Jan 04 17:13:19 CST 2021.
    -->
    update organization_business_scope
    set `uid` = #{uid,jdbcType=VARCHAR},
      keyword = #{keyword,jdbcType=VARCHAR}
    where id = #{id,jdbcType=INTEGER}
  </update>
  
  <insert id="insertBatch" parameterType="com.goafanti.common.model.OrganizationBusinessScope">
    insert into organization_business_scope
    (`uid`, keyword)
     values    
    <foreach item="item" index="index" collection="list" separator=",">
      (#{item.uid,jdbcType=VARCHAR},
        #{item.keyword,jdbcType=VARCHAR})
     </foreach>   
  </insert>
  
  <delete id="deleteByUid">
  delete from organization_business_scope where uid= #{uid}
  </delete>
</mapper>