<?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.UserFollowBusinessMapper">
  <resultMap id="BaseResultMap" type="com.goafanti.common.model.UserFollowBusiness">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Sat May 05 10:50:19 CST 2018.
    -->
    <id column="id" jdbcType="VARCHAR" property="id" />
    <result column="follow_id" jdbcType="VARCHAR" property="followId" />
    <result column="business_id" jdbcType="VARCHAR" property="businessId" />
    <result column="follow_situation" jdbcType="INTEGER" property="followSituation" />
    <result column="customer_status" jdbcType="INTEGER" property="customerStatus" />
    <result column="remarks" jdbcType="VARCHAR" property="remarks" />
    <result column="business_project_id" jdbcType="VARCHAR" property="businessProjectId" />
  </resultMap>
  <sql id="Example_Where_Clause">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Sat May 05 10:50:19 CST 2018.
    -->
    <where>
      <foreach collection="oredCriteria" item="criteria" separator="or">
        <if test="criteria.valid">
          <trim prefix="(" prefixOverrides="and" suffix=")">
            <foreach collection="criteria.criteria" item="criterion">
              <choose>
                <when test="criterion.noValue">
                  and ${criterion.condition}
                </when>
                <when test="criterion.singleValue">
                  and ${criterion.condition} #{criterion.value}
                </when>
                <when test="criterion.betweenValue">
                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
                </when>
                <when test="criterion.listValue">
                  and ${criterion.condition}
                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
                    #{listItem}
                  </foreach>
                </when>
              </choose>
            </foreach>
          </trim>
        </if>
      </foreach>
    </where>
  </sql>
  <sql id="Update_By_Example_Where_Clause">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Sat May 05 10:50:19 CST 2018.
    -->
    <where>
      <foreach collection="example.oredCriteria" item="criteria" separator="or">
        <if test="criteria.valid">
          <trim prefix="(" prefixOverrides="and" suffix=")">
            <foreach collection="criteria.criteria" item="criterion">
              <choose>
                <when test="criterion.noValue">
                  and ${criterion.condition}
                </when>
                <when test="criterion.singleValue">
                  and ${criterion.condition} #{criterion.value}
                </when>
                <when test="criterion.betweenValue">
                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
                </when>
                <when test="criterion.listValue">
                  and ${criterion.condition}
                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
                    #{listItem}
                  </foreach>
                </when>
              </choose>
            </foreach>
          </trim>
        </if>
      </foreach>
    </where>
  </sql>
  <sql id="Base_Column_List">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Sat May 05 10:50:19 CST 2018.
    -->
    id, follow_id, business_id, follow_situation, customer_status, remarks, business_project_id
  </sql>
  <select id="selectByExample" parameterType="com.goafanti.common.model.UserFollowBusinessExample" resultMap="BaseResultMap">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Sat May 05 10:50:19 CST 2018.
    -->
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from user_follow_business
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Sat May 05 10:50:19 CST 2018.
    -->
    select 
    <include refid="Base_Column_List" />
    from user_follow_business
    where id = #{id,jdbcType=VARCHAR}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Sat May 05 10:50:19 CST 2018.
    -->
    delete from user_follow_business
    where id = #{id,jdbcType=VARCHAR}
  </delete>
  <delete id="deleteByExample" parameterType="com.goafanti.common.model.UserFollowBusinessExample">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Sat May 05 10:50:19 CST 2018.
    -->
    delete from user_follow_business
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.goafanti.common.model.UserFollowBusiness">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Sat May 05 10:50:19 CST 2018.
    -->
    insert into user_follow_business (id, follow_id, business_id, 
      follow_situation, customer_status, remarks, 
      business_project_id)
    values (#{id,jdbcType=VARCHAR}, #{followId,jdbcType=VARCHAR}, #{businessId,jdbcType=VARCHAR}, 
      #{followSituation,jdbcType=INTEGER}, #{customerStatus,jdbcType=INTEGER}, #{remarks,jdbcType=VARCHAR}, 
      #{businessProjectId,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.goafanti.common.model.UserFollowBusiness">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Sat May 05 10:50:19 CST 2018.
    -->
    insert into user_follow_business
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="followId != null">
        follow_id,
      </if>
      <if test="businessId != null">
        business_id,
      </if>
      <if test="followSituation != null">
        follow_situation,
      </if>
      <if test="customerStatus != null">
        customer_status,
      </if>
      <if test="remarks != null">
        remarks,
      </if>
      <if test="businessProjectId != null">
        business_project_id,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=VARCHAR},
      </if>
      <if test="followId != null">
        #{followId,jdbcType=VARCHAR},
      </if>
      <if test="businessId != null">
        #{businessId,jdbcType=VARCHAR},
      </if>
      <if test="followSituation != null">
        #{followSituation,jdbcType=INTEGER},
      </if>
      <if test="customerStatus != null">
        #{customerStatus,jdbcType=INTEGER},
      </if>
      <if test="remarks != null">
        #{remarks,jdbcType=VARCHAR},
      </if>
      <if test="businessProjectId != null">
        #{businessProjectId,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.goafanti.common.model.UserFollowBusinessExample" resultType="java.lang.Long">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Sat May 05 10:50:19 CST 2018.
    -->
    select count(*) from user_follow_business
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Sat May 05 10:50:19 CST 2018.
    -->
    update user_follow_business
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=VARCHAR},
      </if>
      <if test="record.followId != null">
        follow_id = #{record.followId,jdbcType=VARCHAR},
      </if>
      <if test="record.businessId != null">
        business_id = #{record.businessId,jdbcType=VARCHAR},
      </if>
      <if test="record.followSituation != null">
        follow_situation = #{record.followSituation,jdbcType=INTEGER},
      </if>
      <if test="record.customerStatus != null">
        customer_status = #{record.customerStatus,jdbcType=INTEGER},
      </if>
      <if test="record.remarks != null">
        remarks = #{record.remarks,jdbcType=VARCHAR},
      </if>
      <if test="record.businessProjectId != null">
        business_project_id = #{record.businessProjectId,jdbcType=VARCHAR},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Sat May 05 10:50:19 CST 2018.
    -->
    update user_follow_business
    set id = #{record.id,jdbcType=VARCHAR},
      follow_id = #{record.followId,jdbcType=VARCHAR},
      business_id = #{record.businessId,jdbcType=VARCHAR},
      follow_situation = #{record.followSituation,jdbcType=INTEGER},
      customer_status = #{record.customerStatus,jdbcType=INTEGER},
      remarks = #{record.remarks,jdbcType=VARCHAR},
      business_project_id = #{record.businessProjectId,jdbcType=VARCHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.UserFollowBusiness">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Sat May 05 10:50:19 CST 2018.
    -->
    update user_follow_business
    <set>
      <if test="followId != null">
        follow_id = #{followId,jdbcType=VARCHAR},
      </if>
      <if test="businessId != null">
        business_id = #{businessId,jdbcType=VARCHAR},
      </if>
      <if test="followSituation != null">
        follow_situation = #{followSituation,jdbcType=INTEGER},
      </if>
      <if test="customerStatus != null">
        customer_status = #{customerStatus,jdbcType=INTEGER},
      </if>
      <if test="remarks != null">
        remarks = #{remarks,jdbcType=VARCHAR},
      </if>
      <if test="businessProjectId != null">
        business_project_id = #{businessProjectId,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.UserFollowBusiness">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Sat May 05 10:50:19 CST 2018.
    -->
    update user_follow_business
    set follow_id = #{followId,jdbcType=VARCHAR},
      business_id = #{businessId,jdbcType=VARCHAR},
      follow_situation = #{followSituation,jdbcType=INTEGER},
      customer_status = #{customerStatus,jdbcType=INTEGER},
      remarks = #{remarks,jdbcType=VARCHAR},
      business_project_id = #{businessProjectId,jdbcType=VARCHAR}
    where id = #{id,jdbcType=VARCHAR}
  </update>
</mapper>