<?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" />
    <result column="company_id" jdbcType="INTEGER" property="companyId" />
    <result column="order_total_amount" jdbcType="DECIMAL" property="orderTotalAmount" />
    <result column="usd_order_total_amount" jdbcType="DECIMAL" property="usdOrderTotalAmount" />
    <result column="product_sale_amount" jdbcType="DECIMAL" property="productSaleAmount" />
    <result column="is_deleted" jdbcType="BIT" property="isDeleted" />
    <result column="is_freeze" jdbcType="BIT" property="isFreeze" />
    <result column="order_status" jdbcType="VARCHAR" property="orderStatus" />
    <result column="shipping_status" jdbcType="VARCHAR" property="shippingStatus" />
    <result column="refund_type" jdbcType="VARCHAR" property="refundType" />
  </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, company_id, order_total_amount, usd_order_total_amount, product_sale_amount, 
    is_deleted, is_freeze, order_status, shipping_status, refund_type
  </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, company_id, order_total_amount, 
      usd_order_total_amount, product_sale_amount, 
      is_deleted, is_freeze, order_status, 
      shipping_status, refund_type)
    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}, #{companyId,jdbcType=INTEGER}, #{orderTotalAmount,jdbcType=DECIMAL}, 
      #{usdOrderTotalAmount,jdbcType=DECIMAL}, #{productSaleAmount,jdbcType=DECIMAL}, 
      #{isDeleted,jdbcType=BIT}, #{isFreeze,jdbcType=BIT}, #{orderStatus,jdbcType=VARCHAR}, 
      #{shippingStatus,jdbcType=VARCHAR}, #{refundType,jdbcType=VARCHAR})
  </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>
      <if test="companyId != null">
        company_id,
      </if>
      <if test="orderTotalAmount != null">
        order_total_amount,
      </if>
      <if test="usdOrderTotalAmount != null">
        usd_order_total_amount,
      </if>
      <if test="productSaleAmount != null">
        product_sale_amount,
      </if>
      <if test="isDeleted != null">
        is_deleted,
      </if>
      <if test="isFreeze != null">
        is_freeze,
      </if>
      <if test="orderStatus != null">
        order_status,
      </if>
      <if test="shippingStatus != null">
        shipping_status,
      </if>
      <if test="refundType != null">
        refund_type,
      </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>
      <if test="companyId != null">
        #{companyId,jdbcType=INTEGER},
      </if>
      <if test="orderTotalAmount != null">
        #{orderTotalAmount,jdbcType=DECIMAL},
      </if>
      <if test="usdOrderTotalAmount != null">
        #{usdOrderTotalAmount,jdbcType=DECIMAL},
      </if>
      <if test="productSaleAmount != null">
        #{productSaleAmount,jdbcType=DECIMAL},
      </if>
      <if test="isDeleted != null">
        #{isDeleted,jdbcType=BIT},
      </if>
      <if test="isFreeze != null">
        #{isFreeze,jdbcType=BIT},
      </if>
      <if test="orderStatus != null">
        #{orderStatus,jdbcType=VARCHAR},
      </if>
      <if test="shippingStatus != null">
        #{shippingStatus,jdbcType=VARCHAR},
      </if>
      <if test="refundType != null">
        #{refundType,jdbcType=VARCHAR},
      </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>
      <if test="record.companyId != null">
        company_id = #{record.companyId,jdbcType=INTEGER},
      </if>
      <if test="record.orderTotalAmount != null">
        order_total_amount = #{record.orderTotalAmount,jdbcType=DECIMAL},
      </if>
      <if test="record.usdOrderTotalAmount != null">
        usd_order_total_amount = #{record.usdOrderTotalAmount,jdbcType=DECIMAL},
      </if>
      <if test="record.productSaleAmount != null">
        product_sale_amount = #{record.productSaleAmount,jdbcType=DECIMAL},
      </if>
      <if test="record.isDeleted != null">
        is_deleted = #{record.isDeleted,jdbcType=BIT},
      </if>
      <if test="record.isFreeze != null">
        is_freeze = #{record.isFreeze,jdbcType=BIT},
      </if>
      <if test="record.orderStatus != null">
        order_status = #{record.orderStatus,jdbcType=VARCHAR},
      </if>
      <if test="record.shippingStatus != null">
        shipping_status = #{record.shippingStatus,jdbcType=VARCHAR},
      </if>
      <if test="record.refundType != null">
        refund_type = #{record.refundType,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.
    -->
    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},
      company_id = #{record.companyId,jdbcType=INTEGER},
      order_total_amount = #{record.orderTotalAmount,jdbcType=DECIMAL},
      usd_order_total_amount = #{record.usdOrderTotalAmount,jdbcType=DECIMAL},
      product_sale_amount = #{record.productSaleAmount,jdbcType=DECIMAL},
      is_deleted = #{record.isDeleted,jdbcType=BIT},
      is_freeze = #{record.isFreeze,jdbcType=BIT},
      order_status = #{record.orderStatus,jdbcType=VARCHAR},
      shipping_status = #{record.shippingStatus,jdbcType=VARCHAR},
      refund_type = #{record.refundType,jdbcType=VARCHAR}
    <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>
      <if test="companyId != null">
        company_id = #{companyId,jdbcType=INTEGER},
      </if>
      <if test="orderTotalAmount != null">
        order_total_amount = #{orderTotalAmount,jdbcType=DECIMAL},
      </if>
      <if test="usdOrderTotalAmount != null">
        usd_order_total_amount = #{usdOrderTotalAmount,jdbcType=DECIMAL},
      </if>
      <if test="productSaleAmount != null">
        product_sale_amount = #{productSaleAmount,jdbcType=DECIMAL},
      </if>
      <if test="isDeleted != null">
        is_deleted = #{isDeleted,jdbcType=BIT},
      </if>
      <if test="isFreeze != null">
        is_freeze = #{isFreeze,jdbcType=BIT},
      </if>
      <if test="orderStatus != null">
        order_status = #{orderStatus,jdbcType=VARCHAR},
      </if>
      <if test="shippingStatus != null">
        shipping_status = #{shippingStatus,jdbcType=VARCHAR},
      </if>
      <if test="refundType != null">
        refund_type = #{refundType,jdbcType=VARCHAR},
      </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},
      company_id = #{companyId,jdbcType=INTEGER},
      order_total_amount = #{orderTotalAmount,jdbcType=DECIMAL},
      usd_order_total_amount = #{usdOrderTotalAmount,jdbcType=DECIMAL},
      product_sale_amount = #{productSaleAmount,jdbcType=DECIMAL},
      is_deleted = #{isDeleted,jdbcType=BIT},
      is_freeze = #{isFreeze,jdbcType=BIT},
      order_status = #{orderStatus,jdbcType=VARCHAR},
      shipping_status = #{shippingStatus,jdbcType=VARCHAR},
      refund_type = #{refundType,jdbcType=VARCHAR}
    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>
      <if test="companyId != null">
        company_id,
      </if>
      <if test="orderTotalAmount != null">
        order_total_amount,
      </if>
      <if test="usdOrderTotalAmount != null">
        usd_order_total_amount,
      </if>
      <if test="productSaleAmount != null">
        product_sale_amount,
      </if>
      <if test="isDeleted != null">
        is_deleted,
      </if>
      <if test="isFreeze != null">
        is_freeze,
      </if>
      <if test="orderStatus != null">
        order_status,
      </if>
      <if test="shippingStatus != null">
        shipping_status,
      </if>
      <if test="refundType != null">
        refund_type,
      </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>
      <if test="companyId != null">
        #{companyId,jdbcType=INTEGER},
      </if>
      <if test="orderTotalAmount != null">
        #{orderTotalAmount,jdbcType=DECIMAL},
      </if>
      <if test="usdOrderTotalAmount != null">
        #{usdOrderTotalAmount,jdbcType=DECIMAL},
      </if>
      <if test="productSaleAmount != null">
        #{productSaleAmount,jdbcType=DECIMAL},
      </if>
      <if test="isDeleted != null">
        #{isDeleted,jdbcType=BIT},
      </if>
      <if test="isFreeze != null">
        #{isFreeze,jdbcType=BIT},
      </if>
      <if test="orderStatus != null">
        #{orderStatus,jdbcType=VARCHAR},
      </if>
      <if test="shippingStatus != null">
        #{shippingStatus,jdbcType=VARCHAR},
      </if>
      <if test="refundType != null">
        #{refundType,jdbcType=VARCHAR},
      </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>
      <if test="companyId != null">
        company_id = #{companyId,jdbcType=INTEGER},
      </if>
      <if test="orderTotalAmount != null">
        order_total_amount = #{orderTotalAmount,jdbcType=DECIMAL},
      </if>
      <if test="usdOrderTotalAmount != null">
        usd_order_total_amount = #{usdOrderTotalAmount,jdbcType=DECIMAL},
      </if>
      <if test="productSaleAmount != null">
        product_sale_amount = #{productSaleAmount,jdbcType=DECIMAL},
      </if>
      <if test="isDeleted != null">
        is_deleted = #{isDeleted,jdbcType=BIT},
      </if>
      <if test="isFreeze != null">
        is_freeze = #{isFreeze,jdbcType=BIT},
      </if>
      <if test="orderStatus != null">
        order_status = #{orderStatus,jdbcType=VARCHAR},
      </if>
      <if test="shippingStatus != null">
        shipping_status = #{shippingStatus,jdbcType=VARCHAR},
      </if>
      <if test="refundType != null">
        refund_type = #{refundType,jdbcType=VARCHAR},
      </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, company_id, order_total_amount, usd_order_total_amount, product_sale_amount, 
      is_deleted, is_freeze, order_status, shipping_status, refund_type)
    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}, #{companyId,jdbcType=INTEGER}, #{orderTotalAmount,jdbcType=DECIMAL}, 
      #{usdOrderTotalAmount,jdbcType=DECIMAL}, #{productSaleAmount,jdbcType=DECIMAL}, 
      #{isDeleted,jdbcType=BIT}, #{isFreeze,jdbcType=BIT}, #{orderStatus,jdbcType=VARCHAR}, 
      #{shippingStatus,jdbcType=VARCHAR}, #{refundType,jdbcType=VARCHAR})
    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}, 
    company_id = #{companyId,jdbcType=INTEGER}, 
    order_total_amount = #{orderTotalAmount,jdbcType=DECIMAL}, 
    usd_order_total_amount = #{usdOrderTotalAmount,jdbcType=DECIMAL}, 
    product_sale_amount = #{productSaleAmount,jdbcType=DECIMAL}, 
    is_deleted = #{isDeleted,jdbcType=BIT}, 
    is_freeze = #{isFreeze,jdbcType=BIT}, 
    order_status = #{orderStatus,jdbcType=VARCHAR}, 
    shipping_status = #{shippingStatus,jdbcType=VARCHAR}, 
    refund_type = #{refundType,jdbcType=VARCHAR}
  </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>

  <select id="selectByRefundDate" resultMap="BaseResultMap">
    select
    <include refid="Base_Column_List" />
    from dc_base_crm_refund
    where date_format(refund_time, '%Y-%m') = #{localDateStr}
    limit #{v1}, #{v2}
  </select>

  <select id="countByDate" resultType="java.lang.Long">
    select
    count(*)
    from dc_base_crm_refund
    where date_format(refund_time, '%Y-%m') = #{localDateStr}
  </select>
</mapper>