<?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.DcBaseFinanceAmazonItemMapper">
  <resultMap id="BaseResultMap" type="com.bailuntec.domain.entity.DcBaseFinanceAmazonItem">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="amazon_id" jdbcType="INTEGER" property="amazonId" />
    <result column="campaign_id" jdbcType="VARCHAR" property="campaignId" />
    <result column="ad_group_id" jdbcType="VARCHAR" property="adGroupId" />
    <result column="sku" jdbcType="VARCHAR" property="sku" />
    <result column="item_id" jdbcType="VARCHAR" property="itemId" />
    <result column="bailun_sku" jdbcType="VARCHAR" property="bailunSku" />
    <result column="site" jdbcType="VARCHAR" property="site" />
    <result column="cost" jdbcType="DECIMAL" property="cost" />
    <result column="sku_cost" jdbcType="DECIMAL" property="skuCost" />
    <result column="sku_count" jdbcType="INTEGER" property="skuCount" />
    <result column="sku_ratio" jdbcType="DECIMAL" property="skuRatio" />
    <result column="report_date" jdbcType="DATE" property="reportDate" />
    <result column="asin" jdbcType="VARCHAR" property="asin" />
    <result column="currency" jdbcType="VARCHAR" property="currency" />
    <result column="account_id" jdbcType="INTEGER" property="accountId" />
    <result column="company_id" jdbcType="INTEGER" property="companyId" />
    <result column="exchange_rate" jdbcType="DECIMAL" property="exchangeRate" />
    <result column="exchange_rate_usd" jdbcType="DECIMAL" property="exchangeRateUsd" />
    <result column="bj_create" jdbcType="TIMESTAMP" property="bjCreate" />
    <result column="bj_modified" jdbcType="TIMESTAMP" property="bjModified" />
  </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, amazon_id, campaign_id, ad_group_id, sku, item_id, bailun_sku, site, cost, sku_cost, 
    sku_count, sku_ratio, report_date, asin, currency, account_id, company_id, exchange_rate, 
    exchange_rate_usd, bj_create, bj_modified
  </sql>
  <select id="selectByExample" parameterType="com.bailuntec.domain.example.DcBaseFinanceAmazonItemExample" 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_base_finance_amazon_item
    <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_base_finance_amazon_item
    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_base_finance_amazon_item
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <delete id="deleteByExample" parameterType="com.bailuntec.domain.example.DcBaseFinanceAmazonItemExample">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    delete from dc_base_finance_amazon_item
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.bailuntec.domain.entity.DcBaseFinanceAmazonItem">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into dc_base_finance_amazon_item (id, amazon_id, campaign_id, 
      ad_group_id, sku, item_id, 
      bailun_sku, site, cost, 
      sku_cost, sku_count, sku_ratio, 
      report_date, asin, currency, 
      account_id, company_id, exchange_rate, 
      exchange_rate_usd, bj_create, bj_modified
      )
    values (#{id,jdbcType=INTEGER}, #{amazonId,jdbcType=INTEGER}, #{campaignId,jdbcType=VARCHAR}, 
      #{adGroupId,jdbcType=VARCHAR}, #{sku,jdbcType=VARCHAR}, #{itemId,jdbcType=VARCHAR}, 
      #{bailunSku,jdbcType=VARCHAR}, #{site,jdbcType=VARCHAR}, #{cost,jdbcType=DECIMAL}, 
      #{skuCost,jdbcType=DECIMAL}, #{skuCount,jdbcType=INTEGER}, #{skuRatio,jdbcType=DECIMAL}, 
      #{reportDate,jdbcType=DATE}, #{asin,jdbcType=VARCHAR}, #{currency,jdbcType=VARCHAR}, 
      #{accountId,jdbcType=INTEGER}, #{companyId,jdbcType=INTEGER}, #{exchangeRate,jdbcType=DECIMAL}, 
      #{exchangeRateUsd,jdbcType=DECIMAL}, #{bjCreate,jdbcType=TIMESTAMP}, #{bjModified,jdbcType=TIMESTAMP}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.bailuntec.domain.entity.DcBaseFinanceAmazonItem">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into dc_base_finance_amazon_item
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="amazonId != null">
        amazon_id,
      </if>
      <if test="campaignId != null">
        campaign_id,
      </if>
      <if test="adGroupId != null">
        ad_group_id,
      </if>
      <if test="sku != null">
        sku,
      </if>
      <if test="itemId != null">
        item_id,
      </if>
      <if test="bailunSku != null">
        bailun_sku,
      </if>
      <if test="site != null">
        site,
      </if>
      <if test="cost != null">
        cost,
      </if>
      <if test="skuCost != null">
        sku_cost,
      </if>
      <if test="skuCount != null">
        sku_count,
      </if>
      <if test="skuRatio != null">
        sku_ratio,
      </if>
      <if test="reportDate != null">
        report_date,
      </if>
      <if test="asin != null">
        asin,
      </if>
      <if test="currency != null">
        currency,
      </if>
      <if test="accountId != null">
        account_id,
      </if>
      <if test="companyId != null">
        company_id,
      </if>
      <if test="exchangeRate != null">
        exchange_rate,
      </if>
      <if test="exchangeRateUsd != null">
        exchange_rate_usd,
      </if>
      <if test="bjCreate != null">
        bj_create,
      </if>
      <if test="bjModified != null">
        bj_modified,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=INTEGER},
      </if>
      <if test="amazonId != null">
        #{amazonId,jdbcType=INTEGER},
      </if>
      <if test="campaignId != null">
        #{campaignId,jdbcType=VARCHAR},
      </if>
      <if test="adGroupId != null">
        #{adGroupId,jdbcType=VARCHAR},
      </if>
      <if test="sku != null">
        #{sku,jdbcType=VARCHAR},
      </if>
      <if test="itemId != null">
        #{itemId,jdbcType=VARCHAR},
      </if>
      <if test="bailunSku != null">
        #{bailunSku,jdbcType=VARCHAR},
      </if>
      <if test="site != null">
        #{site,jdbcType=VARCHAR},
      </if>
      <if test="cost != null">
        #{cost,jdbcType=DECIMAL},
      </if>
      <if test="skuCost != null">
        #{skuCost,jdbcType=DECIMAL},
      </if>
      <if test="skuCount != null">
        #{skuCount,jdbcType=INTEGER},
      </if>
      <if test="skuRatio != null">
        #{skuRatio,jdbcType=DECIMAL},
      </if>
      <if test="reportDate != null">
        #{reportDate,jdbcType=DATE},
      </if>
      <if test="asin != null">
        #{asin,jdbcType=VARCHAR},
      </if>
      <if test="currency != null">
        #{currency,jdbcType=VARCHAR},
      </if>
      <if test="accountId != null">
        #{accountId,jdbcType=INTEGER},
      </if>
      <if test="companyId != null">
        #{companyId,jdbcType=INTEGER},
      </if>
      <if test="exchangeRate != null">
        #{exchangeRate,jdbcType=DECIMAL},
      </if>
      <if test="exchangeRateUsd != null">
        #{exchangeRateUsd,jdbcType=DECIMAL},
      </if>
      <if test="bjCreate != null">
        #{bjCreate,jdbcType=TIMESTAMP},
      </if>
      <if test="bjModified != null">
        #{bjModified,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.bailuntec.domain.example.DcBaseFinanceAmazonItemExample" resultType="java.lang.Long">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select count(*) from dc_base_finance_amazon_item
    <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_base_finance_amazon_item
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=INTEGER},
      </if>
      <if test="record.amazonId != null">
        amazon_id = #{record.amazonId,jdbcType=INTEGER},
      </if>
      <if test="record.campaignId != null">
        campaign_id = #{record.campaignId,jdbcType=VARCHAR},
      </if>
      <if test="record.adGroupId != null">
        ad_group_id = #{record.adGroupId,jdbcType=VARCHAR},
      </if>
      <if test="record.sku != null">
        sku = #{record.sku,jdbcType=VARCHAR},
      </if>
      <if test="record.itemId != null">
        item_id = #{record.itemId,jdbcType=VARCHAR},
      </if>
      <if test="record.bailunSku != null">
        bailun_sku = #{record.bailunSku,jdbcType=VARCHAR},
      </if>
      <if test="record.site != null">
        site = #{record.site,jdbcType=VARCHAR},
      </if>
      <if test="record.cost != null">
        cost = #{record.cost,jdbcType=DECIMAL},
      </if>
      <if test="record.skuCost != null">
        sku_cost = #{record.skuCost,jdbcType=DECIMAL},
      </if>
      <if test="record.skuCount != null">
        sku_count = #{record.skuCount,jdbcType=INTEGER},
      </if>
      <if test="record.skuRatio != null">
        sku_ratio = #{record.skuRatio,jdbcType=DECIMAL},
      </if>
      <if test="record.reportDate != null">
        report_date = #{record.reportDate,jdbcType=DATE},
      </if>
      <if test="record.asin != null">
        asin = #{record.asin,jdbcType=VARCHAR},
      </if>
      <if test="record.currency != null">
        currency = #{record.currency,jdbcType=VARCHAR},
      </if>
      <if test="record.accountId != null">
        account_id = #{record.accountId,jdbcType=INTEGER},
      </if>
      <if test="record.companyId != null">
        company_id = #{record.companyId,jdbcType=INTEGER},
      </if>
      <if test="record.exchangeRate != null">
        exchange_rate = #{record.exchangeRate,jdbcType=DECIMAL},
      </if>
      <if test="record.exchangeRateUsd != null">
        exchange_rate_usd = #{record.exchangeRateUsd,jdbcType=DECIMAL},
      </if>
      <if test="record.bjCreate != null">
        bj_create = #{record.bjCreate,jdbcType=TIMESTAMP},
      </if>
      <if test="record.bjModified != null">
        bj_modified = #{record.bjModified,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_base_finance_amazon_item
    set id = #{record.id,jdbcType=INTEGER},
      amazon_id = #{record.amazonId,jdbcType=INTEGER},
      campaign_id = #{record.campaignId,jdbcType=VARCHAR},
      ad_group_id = #{record.adGroupId,jdbcType=VARCHAR},
      sku = #{record.sku,jdbcType=VARCHAR},
      item_id = #{record.itemId,jdbcType=VARCHAR},
      bailun_sku = #{record.bailunSku,jdbcType=VARCHAR},
      site = #{record.site,jdbcType=VARCHAR},
      cost = #{record.cost,jdbcType=DECIMAL},
      sku_cost = #{record.skuCost,jdbcType=DECIMAL},
      sku_count = #{record.skuCount,jdbcType=INTEGER},
      sku_ratio = #{record.skuRatio,jdbcType=DECIMAL},
      report_date = #{record.reportDate,jdbcType=DATE},
      asin = #{record.asin,jdbcType=VARCHAR},
      currency = #{record.currency,jdbcType=VARCHAR},
      account_id = #{record.accountId,jdbcType=INTEGER},
      company_id = #{record.companyId,jdbcType=INTEGER},
      exchange_rate = #{record.exchangeRate,jdbcType=DECIMAL},
      exchange_rate_usd = #{record.exchangeRateUsd,jdbcType=DECIMAL},
      bj_create = #{record.bjCreate,jdbcType=TIMESTAMP},
      bj_modified = #{record.bjModified,jdbcType=TIMESTAMP}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.bailuntec.domain.entity.DcBaseFinanceAmazonItem">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update dc_base_finance_amazon_item
    <set>
      <if test="amazonId != null">
        amazon_id = #{amazonId,jdbcType=INTEGER},
      </if>
      <if test="campaignId != null">
        campaign_id = #{campaignId,jdbcType=VARCHAR},
      </if>
      <if test="adGroupId != null">
        ad_group_id = #{adGroupId,jdbcType=VARCHAR},
      </if>
      <if test="sku != null">
        sku = #{sku,jdbcType=VARCHAR},
      </if>
      <if test="itemId != null">
        item_id = #{itemId,jdbcType=VARCHAR},
      </if>
      <if test="bailunSku != null">
        bailun_sku = #{bailunSku,jdbcType=VARCHAR},
      </if>
      <if test="site != null">
        site = #{site,jdbcType=VARCHAR},
      </if>
      <if test="cost != null">
        cost = #{cost,jdbcType=DECIMAL},
      </if>
      <if test="skuCost != null">
        sku_cost = #{skuCost,jdbcType=DECIMAL},
      </if>
      <if test="skuCount != null">
        sku_count = #{skuCount,jdbcType=INTEGER},
      </if>
      <if test="skuRatio != null">
        sku_ratio = #{skuRatio,jdbcType=DECIMAL},
      </if>
      <if test="reportDate != null">
        report_date = #{reportDate,jdbcType=DATE},
      </if>
      <if test="asin != null">
        asin = #{asin,jdbcType=VARCHAR},
      </if>
      <if test="currency != null">
        currency = #{currency,jdbcType=VARCHAR},
      </if>
      <if test="accountId != null">
        account_id = #{accountId,jdbcType=INTEGER},
      </if>
      <if test="companyId != null">
        company_id = #{companyId,jdbcType=INTEGER},
      </if>
      <if test="exchangeRate != null">
        exchange_rate = #{exchangeRate,jdbcType=DECIMAL},
      </if>
      <if test="exchangeRateUsd != null">
        exchange_rate_usd = #{exchangeRateUsd,jdbcType=DECIMAL},
      </if>
      <if test="bjCreate != null">
        bj_create = #{bjCreate,jdbcType=TIMESTAMP},
      </if>
      <if test="bjModified != null">
        bj_modified = #{bjModified,jdbcType=TIMESTAMP},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.bailuntec.domain.entity.DcBaseFinanceAmazonItem">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update dc_base_finance_amazon_item
    set amazon_id = #{amazonId,jdbcType=INTEGER},
      campaign_id = #{campaignId,jdbcType=VARCHAR},
      ad_group_id = #{adGroupId,jdbcType=VARCHAR},
      sku = #{sku,jdbcType=VARCHAR},
      item_id = #{itemId,jdbcType=VARCHAR},
      bailun_sku = #{bailunSku,jdbcType=VARCHAR},
      site = #{site,jdbcType=VARCHAR},
      cost = #{cost,jdbcType=DECIMAL},
      sku_cost = #{skuCost,jdbcType=DECIMAL},
      sku_count = #{skuCount,jdbcType=INTEGER},
      sku_ratio = #{skuRatio,jdbcType=DECIMAL},
      report_date = #{reportDate,jdbcType=DATE},
      asin = #{asin,jdbcType=VARCHAR},
      currency = #{currency,jdbcType=VARCHAR},
      account_id = #{accountId,jdbcType=INTEGER},
      company_id = #{companyId,jdbcType=INTEGER},
      exchange_rate = #{exchangeRate,jdbcType=DECIMAL},
      exchange_rate_usd = #{exchangeRateUsd,jdbcType=DECIMAL},
      bj_create = #{bjCreate,jdbcType=TIMESTAMP},
      bj_modified = #{bjModified,jdbcType=TIMESTAMP}
    where id = #{id,jdbcType=INTEGER}
  </update>
  <insert id="upsertSelective" parameterType="com.bailuntec.domain.entity.DcBaseFinanceAmazonItem">
    <!--
      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_base_finance_amazon_item
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="amazonId != null">
        amazon_id,
      </if>
      <if test="campaignId != null">
        campaign_id,
      </if>
      <if test="adGroupId != null">
        ad_group_id,
      </if>
      <if test="sku != null">
        sku,
      </if>
      <if test="itemId != null">
        item_id,
      </if>
      <if test="bailunSku != null">
        bailun_sku,
      </if>
      <if test="site != null">
        site,
      </if>
      <if test="cost != null">
        cost,
      </if>
      <if test="skuCost != null">
        sku_cost,
      </if>
      <if test="skuCount != null">
        sku_count,
      </if>
      <if test="skuRatio != null">
        sku_ratio,
      </if>
      <if test="reportDate != null">
        report_date,
      </if>
      <if test="asin != null">
        asin,
      </if>
      <if test="currency != null">
        currency,
      </if>
      <if test="accountId != null">
        account_id,
      </if>
      <if test="companyId != null">
        company_id,
      </if>
      <if test="exchangeRate != null">
        exchange_rate,
      </if>
      <if test="exchangeRateUsd != null">
        exchange_rate_usd,
      </if>
      <if test="bjCreate != null">
        bj_create,
      </if>
      <if test="bjModified != null">
        bj_modified,
      </if>
    </trim>
    values
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=INTEGER},
      </if>
      <if test="amazonId != null">
        #{amazonId,jdbcType=INTEGER},
      </if>
      <if test="campaignId != null">
        #{campaignId,jdbcType=VARCHAR},
      </if>
      <if test="adGroupId != null">
        #{adGroupId,jdbcType=VARCHAR},
      </if>
      <if test="sku != null">
        #{sku,jdbcType=VARCHAR},
      </if>
      <if test="itemId != null">
        #{itemId,jdbcType=VARCHAR},
      </if>
      <if test="bailunSku != null">
        #{bailunSku,jdbcType=VARCHAR},
      </if>
      <if test="site != null">
        #{site,jdbcType=VARCHAR},
      </if>
      <if test="cost != null">
        #{cost,jdbcType=DECIMAL},
      </if>
      <if test="skuCost != null">
        #{skuCost,jdbcType=DECIMAL},
      </if>
      <if test="skuCount != null">
        #{skuCount,jdbcType=INTEGER},
      </if>
      <if test="skuRatio != null">
        #{skuRatio,jdbcType=DECIMAL},
      </if>
      <if test="reportDate != null">
        #{reportDate,jdbcType=DATE},
      </if>
      <if test="asin != null">
        #{asin,jdbcType=VARCHAR},
      </if>
      <if test="currency != null">
        #{currency,jdbcType=VARCHAR},
      </if>
      <if test="accountId != null">
        #{accountId,jdbcType=INTEGER},
      </if>
      <if test="companyId != null">
        #{companyId,jdbcType=INTEGER},
      </if>
      <if test="exchangeRate != null">
        #{exchangeRate,jdbcType=DECIMAL},
      </if>
      <if test="exchangeRateUsd != null">
        #{exchangeRateUsd,jdbcType=DECIMAL},
      </if>
      <if test="bjCreate != null">
        #{bjCreate,jdbcType=TIMESTAMP},
      </if>
      <if test="bjModified != null">
        #{bjModified,jdbcType=TIMESTAMP},
      </if>
    </trim>
    on duplicate key update 
    <trim suffixOverrides=",">
      <if test="id != null">
        id = #{id,jdbcType=INTEGER},
      </if>
      <if test="amazonId != null">
        amazon_id = #{amazonId,jdbcType=INTEGER},
      </if>
      <if test="campaignId != null">
        campaign_id = #{campaignId,jdbcType=VARCHAR},
      </if>
      <if test="adGroupId != null">
        ad_group_id = #{adGroupId,jdbcType=VARCHAR},
      </if>
      <if test="sku != null">
        sku = #{sku,jdbcType=VARCHAR},
      </if>
      <if test="itemId != null">
        item_id = #{itemId,jdbcType=VARCHAR},
      </if>
      <if test="bailunSku != null">
        bailun_sku = #{bailunSku,jdbcType=VARCHAR},
      </if>
      <if test="site != null">
        site = #{site,jdbcType=VARCHAR},
      </if>
      <if test="cost != null">
        cost = #{cost,jdbcType=DECIMAL},
      </if>
      <if test="skuCost != null">
        sku_cost = #{skuCost,jdbcType=DECIMAL},
      </if>
      <if test="skuCount != null">
        sku_count = #{skuCount,jdbcType=INTEGER},
      </if>
      <if test="skuRatio != null">
        sku_ratio = #{skuRatio,jdbcType=DECIMAL},
      </if>
      <if test="reportDate != null">
        report_date = #{reportDate,jdbcType=DATE},
      </if>
      <if test="asin != null">
        asin = #{asin,jdbcType=VARCHAR},
      </if>
      <if test="currency != null">
        currency = #{currency,jdbcType=VARCHAR},
      </if>
      <if test="accountId != null">
        account_id = #{accountId,jdbcType=INTEGER},
      </if>
      <if test="companyId != null">
        company_id = #{companyId,jdbcType=INTEGER},
      </if>
      <if test="exchangeRate != null">
        exchange_rate = #{exchangeRate,jdbcType=DECIMAL},
      </if>
      <if test="exchangeRateUsd != null">
        exchange_rate_usd = #{exchangeRateUsd,jdbcType=DECIMAL},
      </if>
      <if test="bjCreate != null">
        bj_create = #{bjCreate,jdbcType=TIMESTAMP},
      </if>
      <if test="bjModified != null">
        bj_modified = #{bjModified,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
  <insert id="upsert" parameterType="com.bailuntec.domain.entity.DcBaseFinanceAmazonItem">
    <!--
      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_base_finance_amazon_item
    (id, amazon_id, campaign_id, ad_group_id, sku, item_id, bailun_sku, site, cost, sku_cost, 
      sku_count, sku_ratio, report_date, asin, currency, account_id, company_id, exchange_rate, 
      exchange_rate_usd, bj_create, bj_modified)
    values
    (#{id,jdbcType=INTEGER}, #{amazonId,jdbcType=INTEGER}, #{campaignId,jdbcType=VARCHAR}, 
      #{adGroupId,jdbcType=VARCHAR}, #{sku,jdbcType=VARCHAR}, #{itemId,jdbcType=VARCHAR}, 
      #{bailunSku,jdbcType=VARCHAR}, #{site,jdbcType=VARCHAR}, #{cost,jdbcType=DECIMAL}, 
      #{skuCost,jdbcType=DECIMAL}, #{skuCount,jdbcType=INTEGER}, #{skuRatio,jdbcType=DECIMAL}, 
      #{reportDate,jdbcType=DATE}, #{asin,jdbcType=VARCHAR}, #{currency,jdbcType=VARCHAR}, 
      #{accountId,jdbcType=INTEGER}, #{companyId,jdbcType=INTEGER}, #{exchangeRate,jdbcType=DECIMAL}, 
      #{exchangeRateUsd,jdbcType=DECIMAL}, #{bjCreate,jdbcType=TIMESTAMP}, #{bjModified,jdbcType=TIMESTAMP}
      )
    on duplicate key update 
    id = #{id,jdbcType=INTEGER}, 
    amazon_id = #{amazonId,jdbcType=INTEGER}, 
    campaign_id = #{campaignId,jdbcType=VARCHAR}, 
    ad_group_id = #{adGroupId,jdbcType=VARCHAR}, 
    sku = #{sku,jdbcType=VARCHAR}, 
    item_id = #{itemId,jdbcType=VARCHAR}, 
    bailun_sku = #{bailunSku,jdbcType=VARCHAR}, 
    site = #{site,jdbcType=VARCHAR}, 
    cost = #{cost,jdbcType=DECIMAL}, 
    sku_cost = #{skuCost,jdbcType=DECIMAL}, 
    sku_count = #{skuCount,jdbcType=INTEGER}, 
    sku_ratio = #{skuRatio,jdbcType=DECIMAL}, 
    report_date = #{reportDate,jdbcType=DATE}, 
    asin = #{asin,jdbcType=VARCHAR}, 
    currency = #{currency,jdbcType=VARCHAR}, 
    account_id = #{accountId,jdbcType=INTEGER}, 
    company_id = #{companyId,jdbcType=INTEGER}, 
    exchange_rate = #{exchangeRate,jdbcType=DECIMAL}, 
    exchange_rate_usd = #{exchangeRateUsd,jdbcType=DECIMAL}, 
    bj_create = #{bjCreate,jdbcType=TIMESTAMP}, 
    bj_modified = #{bjModified,jdbcType=TIMESTAMP}
  </insert>
  <select id="selectOneByExample" parameterType="com.bailuntec.domain.example.DcBaseFinanceAmazonItemExample" 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_base_finance_amazon_item
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
    limit 1
  </select>
</mapper>