<?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.bailuntec.mapper.DcMidFbaFeeAvgMapper">
  <resultMap id="BaseResultMap" type="com.bailuntec.domain.entity.DcMidFbaFeeAvg">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="bailun_sku" jdbcType="VARCHAR" property="bailunSku" />
    <result column="max_fba_fee" jdbcType="DECIMAL" property="maxFbaFee" />
    <result column="average_fba_fee" jdbcType="DECIMAL" property="averageFbaFee" />
    <result column="min_fba_fee" jdbcType="DECIMAL" property="minFbaFee" />
    <result column="website" jdbcType="VARCHAR" property="website" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
  </resultMap>
  <sql id="Example_Where_Clause">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <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.
    -->
    <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.
    -->
    id, bailun_sku, max_fba_fee, average_fba_fee, min_fba_fee, website, create_time, 
    update_time
  </sql>
  <select id="selectByExample" parameterType="com.bailuntec.domain.example.DcMidFbaFeeAvgExample" resultMap="BaseResultMap">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from dc_mid_fba_fee_avg
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
    <if test="rows != null">
      <if test="offset != null">
        limit ${offset}, ${rows}
      </if>
      <if test="offset == null">
        limit ${rows}
      </if>
    </if>
  </select>
  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select 
    <include refid="Base_Column_List" />
    from dc_mid_fba_fee_avg
    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.
    -->
    delete from dc_mid_fba_fee_avg
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <delete id="deleteByExample" parameterType="com.bailuntec.domain.example.DcMidFbaFeeAvgExample">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    delete from dc_mid_fba_fee_avg
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.bailuntec.domain.entity.DcMidFbaFeeAvg">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into dc_mid_fba_fee_avg (id, bailun_sku, max_fba_fee, 
      average_fba_fee, min_fba_fee, website, 
      create_time, update_time)
    values (#{id,jdbcType=INTEGER}, #{bailunSku,jdbcType=VARCHAR}, #{maxFbaFee,jdbcType=DECIMAL}, 
      #{averageFbaFee,jdbcType=DECIMAL}, #{minFbaFee,jdbcType=DECIMAL}, #{website,jdbcType=VARCHAR}, 
      #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})
  </insert>
  <insert id="insertSelective" parameterType="com.bailuntec.domain.entity.DcMidFbaFeeAvg">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into dc_mid_fba_fee_avg
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="bailunSku != null">
        bailun_sku,
      </if>
      <if test="maxFbaFee != null">
        max_fba_fee,
      </if>
      <if test="averageFbaFee != null">
        average_fba_fee,
      </if>
      <if test="minFbaFee != null">
        min_fba_fee,
      </if>
      <if test="website != null">
        website,
      </if>
      <if test="createTime != null">
        create_time,
      </if>
      <if test="updateTime != null">
        update_time,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=INTEGER},
      </if>
      <if test="bailunSku != null">
        #{bailunSku,jdbcType=VARCHAR},
      </if>
      <if test="maxFbaFee != null">
        #{maxFbaFee,jdbcType=DECIMAL},
      </if>
      <if test="averageFbaFee != null">
        #{averageFbaFee,jdbcType=DECIMAL},
      </if>
      <if test="minFbaFee != null">
        #{minFbaFee,jdbcType=DECIMAL},
      </if>
      <if test="website != null">
        #{website,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateTime != null">
        #{updateTime,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.bailuntec.domain.example.DcMidFbaFeeAvgExample" resultType="java.lang.Long">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select count(*) from dc_mid_fba_fee_avg
    <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.
    -->
    update dc_mid_fba_fee_avg
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=INTEGER},
      </if>
      <if test="record.bailunSku != null">
        bailun_sku = #{record.bailunSku,jdbcType=VARCHAR},
      </if>
      <if test="record.maxFbaFee != null">
        max_fba_fee = #{record.maxFbaFee,jdbcType=DECIMAL},
      </if>
      <if test="record.averageFbaFee != null">
        average_fba_fee = #{record.averageFbaFee,jdbcType=DECIMAL},
      </if>
      <if test="record.minFbaFee != null">
        min_fba_fee = #{record.minFbaFee,jdbcType=DECIMAL},
      </if>
      <if test="record.website != null">
        website = #{record.website,jdbcType=VARCHAR},
      </if>
      <if test="record.createTime != null">
        create_time = #{record.createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.updateTime != null">
        update_time = #{record.updateTime,jdbcType=TIMESTAMP},
      </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.
    -->
    update dc_mid_fba_fee_avg
    set id = #{record.id,jdbcType=INTEGER},
      bailun_sku = #{record.bailunSku,jdbcType=VARCHAR},
      max_fba_fee = #{record.maxFbaFee,jdbcType=DECIMAL},
      average_fba_fee = #{record.averageFbaFee,jdbcType=DECIMAL},
      min_fba_fee = #{record.minFbaFee,jdbcType=DECIMAL},
      website = #{record.website,jdbcType=VARCHAR},
      create_time = #{record.createTime,jdbcType=TIMESTAMP},
      update_time = #{record.updateTime,jdbcType=TIMESTAMP}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.bailuntec.domain.entity.DcMidFbaFeeAvg">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update dc_mid_fba_fee_avg
    <set>
      <if test="bailunSku != null">
        bailun_sku = #{bailunSku,jdbcType=VARCHAR},
      </if>
      <if test="maxFbaFee != null">
        max_fba_fee = #{maxFbaFee,jdbcType=DECIMAL},
      </if>
      <if test="averageFbaFee != null">
        average_fba_fee = #{averageFbaFee,jdbcType=DECIMAL},
      </if>
      <if test="minFbaFee != null">
        min_fba_fee = #{minFbaFee,jdbcType=DECIMAL},
      </if>
      <if test="website != null">
        website = #{website,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        create_time = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateTime != null">
        update_time = #{updateTime,jdbcType=TIMESTAMP},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.bailuntec.domain.entity.DcMidFbaFeeAvg">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update dc_mid_fba_fee_avg
    set bailun_sku = #{bailunSku,jdbcType=VARCHAR},
      max_fba_fee = #{maxFbaFee,jdbcType=DECIMAL},
      average_fba_fee = #{averageFbaFee,jdbcType=DECIMAL},
      min_fba_fee = #{minFbaFee,jdbcType=DECIMAL},
      website = #{website,jdbcType=VARCHAR},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      update_time = #{updateTime,jdbcType=TIMESTAMP}
    where id = #{id,jdbcType=INTEGER}
  </update>
  <insert id="upsertSelective" parameterType="com.bailuntec.domain.entity.DcMidFbaFeeAvg">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      @project https://github.com/itfsw/mybatis-generator-plugin
    -->
    insert into dc_mid_fba_fee_avg
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="bailunSku != null">
        bailun_sku,
      </if>
      <if test="maxFbaFee != null">
        max_fba_fee,
      </if>
      <if test="averageFbaFee != null">
        average_fba_fee,
      </if>
      <if test="minFbaFee != null">
        min_fba_fee,
      </if>
      <if test="website != null">
        website,
      </if>
      <if test="createTime != null">
        create_time,
      </if>
      <if test="updateTime != null">
        update_time,
      </if>
    </trim>
    values
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=INTEGER},
      </if>
      <if test="bailunSku != null">
        #{bailunSku,jdbcType=VARCHAR},
      </if>
      <if test="maxFbaFee != null">
        #{maxFbaFee,jdbcType=DECIMAL},
      </if>
      <if test="averageFbaFee != null">
        #{averageFbaFee,jdbcType=DECIMAL},
      </if>
      <if test="minFbaFee != null">
        #{minFbaFee,jdbcType=DECIMAL},
      </if>
      <if test="website != null">
        #{website,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateTime != null">
        #{updateTime,jdbcType=TIMESTAMP},
      </if>
    </trim>
    on duplicate key update 
    <trim suffixOverrides=",">
      <if test="id != null">
        id = #{id,jdbcType=INTEGER},
      </if>
      <if test="bailunSku != null">
        bailun_sku = #{bailunSku,jdbcType=VARCHAR},
      </if>
      <if test="maxFbaFee != null">
        max_fba_fee = #{maxFbaFee,jdbcType=DECIMAL},
      </if>
      <if test="averageFbaFee != null">
        average_fba_fee = #{averageFbaFee,jdbcType=DECIMAL},
      </if>
      <if test="minFbaFee != null">
        min_fba_fee = #{minFbaFee,jdbcType=DECIMAL},
      </if>
      <if test="website != null">
        website = #{website,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        create_time = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateTime != null">
        update_time = #{updateTime,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
  <insert id="upsert" parameterType="com.bailuntec.domain.entity.DcMidFbaFeeAvg">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      @project https://github.com/itfsw/mybatis-generator-plugin
    -->
    insert into dc_mid_fba_fee_avg
    (id, bailun_sku, max_fba_fee, average_fba_fee, min_fba_fee, website, create_time, 
      update_time)
    values
    (#{id,jdbcType=INTEGER}, #{bailunSku,jdbcType=VARCHAR}, #{maxFbaFee,jdbcType=DECIMAL}, 
      #{averageFbaFee,jdbcType=DECIMAL}, #{minFbaFee,jdbcType=DECIMAL}, #{website,jdbcType=VARCHAR}, 
      #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})
    on duplicate key update 
    id = #{id,jdbcType=INTEGER}, 
    bailun_sku = #{bailunSku,jdbcType=VARCHAR}, 
    max_fba_fee = #{maxFbaFee,jdbcType=DECIMAL}, 
    average_fba_fee = #{averageFbaFee,jdbcType=DECIMAL}, 
    min_fba_fee = #{minFbaFee,jdbcType=DECIMAL}, 
    website = #{website,jdbcType=VARCHAR}, 
    create_time = #{createTime,jdbcType=TIMESTAMP},
    update_time = #{updateTime,jdbcType=TIMESTAMP}
  </insert>
  <select id="selectOneByExample" parameterType="com.bailuntec.domain.example.DcMidFbaFeeAvgExample" resultMap="BaseResultMap">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      @project https://github.com/itfsw/mybatis-generator-plugin
    -->
    select
    <include refid="Base_Column_List" />
    from dc_mid_fba_fee_avg
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
    limit 1
  </select>
</mapper>