<?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.DcBaseCrmRefundMapper">
  <resultMap id="BaseResultMap" type="com.bailuntec.domain.entity.DcBaseCrmRefund">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="platform_type" jdbcType="VARCHAR" property="platformType" />
    <result column="bailun_account" jdbcType="VARCHAR" property="bailunAccount" />
    <result column="bailun_account_id" jdbcType="INTEGER" property="bailunAccountId" />
    <result column="website" jdbcType="VARCHAR" property="website" />
    <result column="origin_order_id" jdbcType="VARCHAR" property="originOrderId" />
    <result column="bailun_sku" jdbcType="VARCHAR" property="bailunSku" />
    <result column="platform_sku" jdbcType="VARCHAR" property="platformSku" />
    <result column="amount_refund" jdbcType="DECIMAL" property="amountRefund" />
    <result column="order_currency" jdbcType="VARCHAR" property="orderCurrency" />
    <result column="refund_time" jdbcType="TIMESTAMP" property="refundTime" />
    <result column="bailun_sku_quantity_refund" jdbcType="INTEGER" property="bailunSkuQuantityRefund" />
    <result column="bailun_sku_unit_price" jdbcType="DECIMAL" property="bailunSkuUnitPrice" />
    <result column="gmt_create" jdbcType="TIMESTAMP" property="gmtCreate" />
    <result column="gmt_modified" jdbcType="TIMESTAMP" property="gmtModified" />
    <result column="linked" jdbcType="BIT" property="linked" />
    <result column="amount_refund_rmb" jdbcType="DECIMAL" property="amountRefundRmb" />
    <result column="crm_id" jdbcType="INTEGER" property="crmId" />
    <result column="amount_refund_usd" jdbcType="DECIMAL" property="amountRefundUsd" />
  </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, platform_type, bailun_account, bailun_account_id, website, origin_order_id, bailun_sku, 
    platform_sku, amount_refund, order_currency, refund_time, bailun_sku_quantity_refund, 
    bailun_sku_unit_price, gmt_create, gmt_modified, linked, amount_refund_rmb, crm_id, 
    amount_refund_usd
  </sql>
  <select id="selectByExample" parameterType="com.bailuntec.domain.example.DcBaseCrmRefundExample" 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_crm_refund
    <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_crm_refund
    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_crm_refund
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <delete id="deleteByExample" parameterType="com.bailuntec.domain.example.DcBaseCrmRefundExample">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    delete from dc_base_crm_refund
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.bailuntec.domain.entity.DcBaseCrmRefund">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into dc_base_crm_refund (id, platform_type, bailun_account, 
      bailun_account_id, website, origin_order_id, 
      bailun_sku, platform_sku, amount_refund, 
      order_currency, refund_time, bailun_sku_quantity_refund, 
      bailun_sku_unit_price, gmt_create, gmt_modified, 
      linked, amount_refund_rmb, crm_id, 
      amount_refund_usd)
    values (#{id,jdbcType=INTEGER}, #{platformType,jdbcType=VARCHAR}, #{bailunAccount,jdbcType=VARCHAR}, 
      #{bailunAccountId,jdbcType=INTEGER}, #{website,jdbcType=VARCHAR}, #{originOrderId,jdbcType=VARCHAR}, 
      #{bailunSku,jdbcType=VARCHAR}, #{platformSku,jdbcType=VARCHAR}, #{amountRefund,jdbcType=DECIMAL}, 
      #{orderCurrency,jdbcType=VARCHAR}, #{refundTime,jdbcType=TIMESTAMP}, #{bailunSkuQuantityRefund,jdbcType=INTEGER}, 
      #{bailunSkuUnitPrice,jdbcType=DECIMAL}, #{gmtCreate,jdbcType=TIMESTAMP}, #{gmtModified,jdbcType=TIMESTAMP}, 
      #{linked,jdbcType=BIT}, #{amountRefundRmb,jdbcType=DECIMAL}, #{crmId,jdbcType=INTEGER}, 
      #{amountRefundUsd,jdbcType=DECIMAL})
  </insert>
  <insert id="insertSelective" parameterType="com.bailuntec.domain.entity.DcBaseCrmRefund">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into dc_base_crm_refund
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="platformType != null">
        platform_type,
      </if>
      <if test="bailunAccount != null">
        bailun_account,
      </if>
      <if test="bailunAccountId != null">
        bailun_account_id,
      </if>
      <if test="website != null">
        website,
      </if>
      <if test="originOrderId != null">
        origin_order_id,
      </if>
      <if test="bailunSku != null">
        bailun_sku,
      </if>
      <if test="platformSku != null">
        platform_sku,
      </if>
      <if test="amountRefund != null">
        amount_refund,
      </if>
      <if test="orderCurrency != null">
        order_currency,
      </if>
      <if test="refundTime != null">
        refund_time,
      </if>
      <if test="bailunSkuQuantityRefund != null">
        bailun_sku_quantity_refund,
      </if>
      <if test="bailunSkuUnitPrice != null">
        bailun_sku_unit_price,
      </if>
      <if test="gmtCreate != null">
        gmt_create,
      </if>
      <if test="gmtModified != null">
        gmt_modified,
      </if>
      <if test="linked != null">
        linked,
      </if>
      <if test="amountRefundRmb != null">
        amount_refund_rmb,
      </if>
      <if test="crmId != null">
        crm_id,
      </if>
      <if test="amountRefundUsd != null">
        amount_refund_usd,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=INTEGER},
      </if>
      <if test="platformType != null">
        #{platformType,jdbcType=VARCHAR},
      </if>
      <if test="bailunAccount != null">
        #{bailunAccount,jdbcType=VARCHAR},
      </if>
      <if test="bailunAccountId != null">
        #{bailunAccountId,jdbcType=INTEGER},
      </if>
      <if test="website != null">
        #{website,jdbcType=VARCHAR},
      </if>
      <if test="originOrderId != null">
        #{originOrderId,jdbcType=VARCHAR},
      </if>
      <if test="bailunSku != null">
        #{bailunSku,jdbcType=VARCHAR},
      </if>
      <if test="platformSku != null">
        #{platformSku,jdbcType=VARCHAR},
      </if>
      <if test="amountRefund != null">
        #{amountRefund,jdbcType=DECIMAL},
      </if>
      <if test="orderCurrency != null">
        #{orderCurrency,jdbcType=VARCHAR},
      </if>
      <if test="refundTime != null">
        #{refundTime,jdbcType=TIMESTAMP},
      </if>
      <if test="bailunSkuQuantityRefund != null">
        #{bailunSkuQuantityRefund,jdbcType=INTEGER},
      </if>
      <if test="bailunSkuUnitPrice != null">
        #{bailunSkuUnitPrice,jdbcType=DECIMAL},
      </if>
      <if test="gmtCreate != null">
        #{gmtCreate,jdbcType=TIMESTAMP},
      </if>
      <if test="gmtModified != null">
        #{gmtModified,jdbcType=TIMESTAMP},
      </if>
      <if test="linked != null">
        #{linked,jdbcType=BIT},
      </if>
      <if test="amountRefundRmb != null">
        #{amountRefundRmb,jdbcType=DECIMAL},
      </if>
      <if test="crmId != null">
        #{crmId,jdbcType=INTEGER},
      </if>
      <if test="amountRefundUsd != null">
        #{amountRefundUsd,jdbcType=DECIMAL},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.bailuntec.domain.example.DcBaseCrmRefundExample" resultType="java.lang.Long">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select count(*) from dc_base_crm_refund
    <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_crm_refund
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=INTEGER},
      </if>
      <if test="record.platformType != null">
        platform_type = #{record.platformType,jdbcType=VARCHAR},
      </if>
      <if test="record.bailunAccount != null">
        bailun_account = #{record.bailunAccount,jdbcType=VARCHAR},
      </if>
      <if test="record.bailunAccountId != null">
        bailun_account_id = #{record.bailunAccountId,jdbcType=INTEGER},
      </if>
      <if test="record.website != null">
        website = #{record.website,jdbcType=VARCHAR},
      </if>
      <if test="record.originOrderId != null">
        origin_order_id = #{record.originOrderId,jdbcType=VARCHAR},
      </if>
      <if test="record.bailunSku != null">
        bailun_sku = #{record.bailunSku,jdbcType=VARCHAR},
      </if>
      <if test="record.platformSku != null">
        platform_sku = #{record.platformSku,jdbcType=VARCHAR},
      </if>
      <if test="record.amountRefund != null">
        amount_refund = #{record.amountRefund,jdbcType=DECIMAL},
      </if>
      <if test="record.orderCurrency != null">
        order_currency = #{record.orderCurrency,jdbcType=VARCHAR},
      </if>
      <if test="record.refundTime != null">
        refund_time = #{record.refundTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.bailunSkuQuantityRefund != null">
        bailun_sku_quantity_refund = #{record.bailunSkuQuantityRefund,jdbcType=INTEGER},
      </if>
      <if test="record.bailunSkuUnitPrice != null">
        bailun_sku_unit_price = #{record.bailunSkuUnitPrice,jdbcType=DECIMAL},
      </if>
      <if test="record.gmtCreate != null">
        gmt_create = #{record.gmtCreate,jdbcType=TIMESTAMP},
      </if>
      <if test="record.gmtModified != null">
        gmt_modified = #{record.gmtModified,jdbcType=TIMESTAMP},
      </if>
      <if test="record.linked != null">
        linked = #{record.linked,jdbcType=BIT},
      </if>
      <if test="record.amountRefundRmb != null">
        amount_refund_rmb = #{record.amountRefundRmb,jdbcType=DECIMAL},
      </if>
      <if test="record.crmId != null">
        crm_id = #{record.crmId,jdbcType=INTEGER},
      </if>
      <if test="record.amountRefundUsd != null">
        amount_refund_usd = #{record.amountRefundUsd,jdbcType=DECIMAL},
      </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_crm_refund
    set id = #{record.id,jdbcType=INTEGER},
      platform_type = #{record.platformType,jdbcType=VARCHAR},
      bailun_account = #{record.bailunAccount,jdbcType=VARCHAR},
      bailun_account_id = #{record.bailunAccountId,jdbcType=INTEGER},
      website = #{record.website,jdbcType=VARCHAR},
      origin_order_id = #{record.originOrderId,jdbcType=VARCHAR},
      bailun_sku = #{record.bailunSku,jdbcType=VARCHAR},
      platform_sku = #{record.platformSku,jdbcType=VARCHAR},
      amount_refund = #{record.amountRefund,jdbcType=DECIMAL},
      order_currency = #{record.orderCurrency,jdbcType=VARCHAR},
      refund_time = #{record.refundTime,jdbcType=TIMESTAMP},
      bailun_sku_quantity_refund = #{record.bailunSkuQuantityRefund,jdbcType=INTEGER},
      bailun_sku_unit_price = #{record.bailunSkuUnitPrice,jdbcType=DECIMAL},
      gmt_create = #{record.gmtCreate,jdbcType=TIMESTAMP},
      gmt_modified = #{record.gmtModified,jdbcType=TIMESTAMP},
      linked = #{record.linked,jdbcType=BIT},
      amount_refund_rmb = #{record.amountRefundRmb,jdbcType=DECIMAL},
      crm_id = #{record.crmId,jdbcType=INTEGER},
      amount_refund_usd = #{record.amountRefundUsd,jdbcType=DECIMAL}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.bailuntec.domain.entity.DcBaseCrmRefund">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update dc_base_crm_refund
    <set>
      <if test="platformType != null">
        platform_type = #{platformType,jdbcType=VARCHAR},
      </if>
      <if test="bailunAccount != null">
        bailun_account = #{bailunAccount,jdbcType=VARCHAR},
      </if>
      <if test="bailunAccountId != null">
        bailun_account_id = #{bailunAccountId,jdbcType=INTEGER},
      </if>
      <if test="website != null">
        website = #{website,jdbcType=VARCHAR},
      </if>
      <if test="originOrderId != null">
        origin_order_id = #{originOrderId,jdbcType=VARCHAR},
      </if>
      <if test="bailunSku != null">
        bailun_sku = #{bailunSku,jdbcType=VARCHAR},
      </if>
      <if test="platformSku != null">
        platform_sku = #{platformSku,jdbcType=VARCHAR},
      </if>
      <if test="amountRefund != null">
        amount_refund = #{amountRefund,jdbcType=DECIMAL},
      </if>
      <if test="orderCurrency != null">
        order_currency = #{orderCurrency,jdbcType=VARCHAR},
      </if>
      <if test="refundTime != null">
        refund_time = #{refundTime,jdbcType=TIMESTAMP},
      </if>
      <if test="bailunSkuQuantityRefund != null">
        bailun_sku_quantity_refund = #{bailunSkuQuantityRefund,jdbcType=INTEGER},
      </if>
      <if test="bailunSkuUnitPrice != null">
        bailun_sku_unit_price = #{bailunSkuUnitPrice,jdbcType=DECIMAL},
      </if>
      <if test="gmtCreate != null">
        gmt_create = #{gmtCreate,jdbcType=TIMESTAMP},
      </if>
      <if test="gmtModified != null">
        gmt_modified = #{gmtModified,jdbcType=TIMESTAMP},
      </if>
      <if test="linked != null">
        linked = #{linked,jdbcType=BIT},
      </if>
      <if test="amountRefundRmb != null">
        amount_refund_rmb = #{amountRefundRmb,jdbcType=DECIMAL},
      </if>
      <if test="crmId != null">
        crm_id = #{crmId,jdbcType=INTEGER},
      </if>
      <if test="amountRefundUsd != null">
        amount_refund_usd = #{amountRefundUsd,jdbcType=DECIMAL},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.bailuntec.domain.entity.DcBaseCrmRefund">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update dc_base_crm_refund
    set platform_type = #{platformType,jdbcType=VARCHAR},
      bailun_account = #{bailunAccount,jdbcType=VARCHAR},
      bailun_account_id = #{bailunAccountId,jdbcType=INTEGER},
      website = #{website,jdbcType=VARCHAR},
      origin_order_id = #{originOrderId,jdbcType=VARCHAR},
      bailun_sku = #{bailunSku,jdbcType=VARCHAR},
      platform_sku = #{platformSku,jdbcType=VARCHAR},
      amount_refund = #{amountRefund,jdbcType=DECIMAL},
      order_currency = #{orderCurrency,jdbcType=VARCHAR},
      refund_time = #{refundTime,jdbcType=TIMESTAMP},
      bailun_sku_quantity_refund = #{bailunSkuQuantityRefund,jdbcType=INTEGER},
      bailun_sku_unit_price = #{bailunSkuUnitPrice,jdbcType=DECIMAL},
      gmt_create = #{gmtCreate,jdbcType=TIMESTAMP},
      gmt_modified = #{gmtModified,jdbcType=TIMESTAMP},
      linked = #{linked,jdbcType=BIT},
      amount_refund_rmb = #{amountRefundRmb,jdbcType=DECIMAL},
      crm_id = #{crmId,jdbcType=INTEGER},
      amount_refund_usd = #{amountRefundUsd,jdbcType=DECIMAL}
    where id = #{id,jdbcType=INTEGER}
  </update>
  <insert id="upsertSelective" parameterType="com.bailuntec.domain.entity.DcBaseCrmRefund">
    <!--
      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_crm_refund
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="platformType != null">
        platform_type,
      </if>
      <if test="bailunAccount != null">
        bailun_account,
      </if>
      <if test="bailunAccountId != null">
        bailun_account_id,
      </if>
      <if test="website != null">
        website,
      </if>
      <if test="originOrderId != null">
        origin_order_id,
      </if>
      <if test="bailunSku != null">
        bailun_sku,
      </if>
      <if test="platformSku != null">
        platform_sku,
      </if>
      <if test="amountRefund != null">
        amount_refund,
      </if>
      <if test="orderCurrency != null">
        order_currency,
      </if>
      <if test="refundTime != null">
        refund_time,
      </if>
      <if test="bailunSkuQuantityRefund != null">
        bailun_sku_quantity_refund,
      </if>
      <if test="bailunSkuUnitPrice != null">
        bailun_sku_unit_price,
      </if>
      <if test="gmtCreate != null">
        gmt_create,
      </if>
      <if test="gmtModified != null">
        gmt_modified,
      </if>
      <if test="linked != null">
        linked,
      </if>
      <if test="amountRefundRmb != null">
        amount_refund_rmb,
      </if>
      <if test="crmId != null">
        crm_id,
      </if>
      <if test="amountRefundUsd != null">
        amount_refund_usd,
      </if>
    </trim>
    values
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=INTEGER},
      </if>
      <if test="platformType != null">
        #{platformType,jdbcType=VARCHAR},
      </if>
      <if test="bailunAccount != null">
        #{bailunAccount,jdbcType=VARCHAR},
      </if>
      <if test="bailunAccountId != null">
        #{bailunAccountId,jdbcType=INTEGER},
      </if>
      <if test="website != null">
        #{website,jdbcType=VARCHAR},
      </if>
      <if test="originOrderId != null">
        #{originOrderId,jdbcType=VARCHAR},
      </if>
      <if test="bailunSku != null">
        #{bailunSku,jdbcType=VARCHAR},
      </if>
      <if test="platformSku != null">
        #{platformSku,jdbcType=VARCHAR},
      </if>
      <if test="amountRefund != null">
        #{amountRefund,jdbcType=DECIMAL},
      </if>
      <if test="orderCurrency != null">
        #{orderCurrency,jdbcType=VARCHAR},
      </if>
      <if test="refundTime != null">
        #{refundTime,jdbcType=TIMESTAMP},
      </if>
      <if test="bailunSkuQuantityRefund != null">
        #{bailunSkuQuantityRefund,jdbcType=INTEGER},
      </if>
      <if test="bailunSkuUnitPrice != null">
        #{bailunSkuUnitPrice,jdbcType=DECIMAL},
      </if>
      <if test="gmtCreate != null">
        #{gmtCreate,jdbcType=TIMESTAMP},
      </if>
      <if test="gmtModified != null">
        #{gmtModified,jdbcType=TIMESTAMP},
      </if>
      <if test="linked != null">
        #{linked,jdbcType=BIT},
      </if>
      <if test="amountRefundRmb != null">
        #{amountRefundRmb,jdbcType=DECIMAL},
      </if>
      <if test="crmId != null">
        #{crmId,jdbcType=INTEGER},
      </if>
      <if test="amountRefundUsd != null">
        #{amountRefundUsd,jdbcType=DECIMAL},
      </if>
    </trim>
    on duplicate key update 
    <trim suffixOverrides=",">
      <if test="id != null">
        id = #{id,jdbcType=INTEGER},
      </if>
      <if test="platformType != null">
        platform_type = #{platformType,jdbcType=VARCHAR},
      </if>
      <if test="bailunAccount != null">
        bailun_account = #{bailunAccount,jdbcType=VARCHAR},
      </if>
      <if test="bailunAccountId != null">
        bailun_account_id = #{bailunAccountId,jdbcType=INTEGER},
      </if>
      <if test="website != null">
        website = #{website,jdbcType=VARCHAR},
      </if>
      <if test="originOrderId != null">
        origin_order_id = #{originOrderId,jdbcType=VARCHAR},
      </if>
      <if test="bailunSku != null">
        bailun_sku = #{bailunSku,jdbcType=VARCHAR},
      </if>
      <if test="platformSku != null">
        platform_sku = #{platformSku,jdbcType=VARCHAR},
      </if>
      <if test="amountRefund != null">
        amount_refund = #{amountRefund,jdbcType=DECIMAL},
      </if>
      <if test="orderCurrency != null">
        order_currency = #{orderCurrency,jdbcType=VARCHAR},
      </if>
      <if test="refundTime != null">
        refund_time = #{refundTime,jdbcType=TIMESTAMP},
      </if>
      <if test="bailunSkuQuantityRefund != null">
        bailun_sku_quantity_refund = #{bailunSkuQuantityRefund,jdbcType=INTEGER},
      </if>
      <if test="bailunSkuUnitPrice != null">
        bailun_sku_unit_price = #{bailunSkuUnitPrice,jdbcType=DECIMAL},
      </if>
      <if test="gmtCreate != null">
        gmt_create = #{gmtCreate,jdbcType=TIMESTAMP},
      </if>
      <if test="gmtModified != null">
        gmt_modified = #{gmtModified,jdbcType=TIMESTAMP},
      </if>
      <if test="linked != null">
        linked = #{linked,jdbcType=BIT},
      </if>
      <if test="amountRefundRmb != null">
        amount_refund_rmb = #{amountRefundRmb,jdbcType=DECIMAL},
      </if>
      <if test="crmId != null">
        crm_id = #{crmId,jdbcType=INTEGER},
      </if>
      <if test="amountRefundUsd != null">
        amount_refund_usd = #{amountRefundUsd,jdbcType=DECIMAL},
      </if>
    </trim>
  </insert>
  <insert id="upsert" parameterType="com.bailuntec.domain.entity.DcBaseCrmRefund">
    <!--
      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_crm_refund
    (id, platform_type, bailun_account, bailun_account_id, website, origin_order_id, 
      bailun_sku, platform_sku, amount_refund, order_currency, refund_time, bailun_sku_quantity_refund, 
      bailun_sku_unit_price, gmt_create, gmt_modified, linked, amount_refund_rmb, crm_id, 
      amount_refund_usd)
    values
    (#{id,jdbcType=INTEGER}, #{platformType,jdbcType=VARCHAR}, #{bailunAccount,jdbcType=VARCHAR}, 
      #{bailunAccountId,jdbcType=INTEGER}, #{website,jdbcType=VARCHAR}, #{originOrderId,jdbcType=VARCHAR}, 
      #{bailunSku,jdbcType=VARCHAR}, #{platformSku,jdbcType=VARCHAR}, #{amountRefund,jdbcType=DECIMAL}, 
      #{orderCurrency,jdbcType=VARCHAR}, #{refundTime,jdbcType=TIMESTAMP}, #{bailunSkuQuantityRefund,jdbcType=INTEGER}, 
      #{bailunSkuUnitPrice,jdbcType=DECIMAL}, #{gmtCreate,jdbcType=TIMESTAMP}, #{gmtModified,jdbcType=TIMESTAMP}, 
      #{linked,jdbcType=BIT}, #{amountRefundRmb,jdbcType=DECIMAL}, #{crmId,jdbcType=INTEGER}, 
      #{amountRefundUsd,jdbcType=DECIMAL})
    on duplicate key update 
    id = #{id,jdbcType=INTEGER}, 
    platform_type = #{platformType,jdbcType=VARCHAR}, 
    bailun_account = #{bailunAccount,jdbcType=VARCHAR}, 
    bailun_account_id = #{bailunAccountId,jdbcType=INTEGER}, 
    website = #{website,jdbcType=VARCHAR}, 
    origin_order_id = #{originOrderId,jdbcType=VARCHAR}, 
    bailun_sku = #{bailunSku,jdbcType=VARCHAR}, 
    platform_sku = #{platformSku,jdbcType=VARCHAR}, 
    amount_refund = #{amountRefund,jdbcType=DECIMAL}, 
    order_currency = #{orderCurrency,jdbcType=VARCHAR}, 
    refund_time = #{refundTime,jdbcType=TIMESTAMP}, 
    bailun_sku_quantity_refund = #{bailunSkuQuantityRefund,jdbcType=INTEGER}, 
    bailun_sku_unit_price = #{bailunSkuUnitPrice,jdbcType=DECIMAL}, 
    gmt_create = #{gmtCreate,jdbcType=TIMESTAMP}, 
    gmt_modified = #{gmtModified,jdbcType=TIMESTAMP}, 
    linked = #{linked,jdbcType=BIT}, 
    amount_refund_rmb = #{amountRefundRmb,jdbcType=DECIMAL}, 
    crm_id = #{crmId,jdbcType=INTEGER}, 
    amount_refund_usd = #{amountRefundUsd,jdbcType=DECIMAL}
  </insert>
  <select id="selectOneByExample" parameterType="com.bailuntec.domain.example.DcBaseCrmRefundExample" 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_crm_refund
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
    limit 1
  </select>
</mapper>