<?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.DcBaseCostFirstFinishMapper">
  <resultMap id="BaseResultMap" type="com.bailuntec.domain.entity.DcBaseCostFirstFinish">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="channel_order_id" jdbcType="VARCHAR" property="channelOrderId" />
    <result column="channel_id" jdbcType="INTEGER" property="channelId" />
    <result column="box_id" jdbcType="VARCHAR" property="boxId" />
    <result column="transfer_order_id" jdbcType="VARCHAR" property="transferOrderId" />
    <result column="cost_first" jdbcType="DECIMAL" property="costFirst" />
    <result column="cost_goods_clearance" jdbcType="DECIMAL" property="costGoodsClearance" />
    <result column="cost_duty" jdbcType="DECIMAL" property="costDuty" />
    <result column="cost_customs_clearance" jdbcType="DECIMAL" property="costCustomsClearance" />
    <result column="cost_weight" jdbcType="DECIMAL" property="costWeight" />
    <result column="cost_fuel" jdbcType="DECIMAL" property="costFuel" />
    <result column="warehouse_code" jdbcType="VARCHAR" property="warehouseCode" />
    <result column="area_id" jdbcType="INTEGER" property="areaId" />
    <result column="company_id" jdbcType="INTEGER" property="companyId" />
    <result column="bailun_sku" jdbcType="VARCHAR" property="bailunSku" />
    <result column="quantity" jdbcType="INTEGER" property="quantity" />
    <result column="sku_weight" jdbcType="DECIMAL" property="skuWeight" />
    <result column="sku_weight_ratio" jdbcType="DECIMAL" property="skuWeightRatio" />
    <result column="sku_cost_first" jdbcType="DECIMAL" property="skuCostFirst" />
    <result column="sku_stock_quantity" jdbcType="INTEGER" property="skuStockQuantity" />
    <result column="pre_avl_sku_cost_first" jdbcType="DECIMAL" property="preAvlSkuCostFirst" />
    <result column="after_avl_sku_cost_first" jdbcType="DECIMAL" property="afterAvlSkuCostFirst" />
    <result column="has_calculation" jdbcType="BIT" property="hasCalculation" />
    <result column="operation_time" jdbcType="TIMESTAMP" property="operationTime" />
    <result column="bj_create_time" jdbcType="TIMESTAMP" property="bjCreateTime" />
  </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, channel_order_id, channel_id, box_id, transfer_order_id, cost_first, cost_goods_clearance, 
    cost_duty, cost_customs_clearance, cost_weight, cost_fuel, warehouse_code, area_id, 
    company_id, bailun_sku, quantity, sku_weight, sku_weight_ratio, sku_cost_first, sku_stock_quantity, 
    pre_avl_sku_cost_first, after_avl_sku_cost_first, has_calculation, operation_time, 
    bj_create_time
  </sql>
  <select id="selectByExample" parameterType="com.bailuntec.domain.example.DcBaseCostFirstFinishExample" 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_cost_first_finish
    <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_cost_first_finish
    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_cost_first_finish
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <delete id="deleteByExample" parameterType="com.bailuntec.domain.example.DcBaseCostFirstFinishExample">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    delete from dc_base_cost_first_finish
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.bailuntec.domain.entity.DcBaseCostFirstFinish">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into dc_base_cost_first_finish (id, channel_order_id, channel_id, 
      box_id, transfer_order_id, cost_first, 
      cost_goods_clearance, cost_duty, cost_customs_clearance, 
      cost_weight, cost_fuel, warehouse_code, 
      area_id, company_id, bailun_sku, 
      quantity, sku_weight, sku_weight_ratio, 
      sku_cost_first, sku_stock_quantity, pre_avl_sku_cost_first, 
      after_avl_sku_cost_first, has_calculation, operation_time, 
      bj_create_time)
    values (#{id,jdbcType=INTEGER}, #{channelOrderId,jdbcType=VARCHAR}, #{channelId,jdbcType=INTEGER}, 
      #{boxId,jdbcType=VARCHAR}, #{transferOrderId,jdbcType=VARCHAR}, #{costFirst,jdbcType=DECIMAL}, 
      #{costGoodsClearance,jdbcType=DECIMAL}, #{costDuty,jdbcType=DECIMAL}, #{costCustomsClearance,jdbcType=DECIMAL}, 
      #{costWeight,jdbcType=DECIMAL}, #{costFuel,jdbcType=DECIMAL}, #{warehouseCode,jdbcType=VARCHAR}, 
      #{areaId,jdbcType=INTEGER}, #{companyId,jdbcType=INTEGER}, #{bailunSku,jdbcType=VARCHAR}, 
      #{quantity,jdbcType=INTEGER}, #{skuWeight,jdbcType=DECIMAL}, #{skuWeightRatio,jdbcType=DECIMAL}, 
      #{skuCostFirst,jdbcType=DECIMAL}, #{skuStockQuantity,jdbcType=INTEGER}, #{preAvlSkuCostFirst,jdbcType=DECIMAL}, 
      #{afterAvlSkuCostFirst,jdbcType=DECIMAL}, #{hasCalculation,jdbcType=BIT}, #{operationTime,jdbcType=TIMESTAMP}, 
      #{bjCreateTime,jdbcType=TIMESTAMP})
  </insert>
  <insert id="insertSelective" parameterType="com.bailuntec.domain.entity.DcBaseCostFirstFinish">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into dc_base_cost_first_finish
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="channelOrderId != null">
        channel_order_id,
      </if>
      <if test="channelId != null">
        channel_id,
      </if>
      <if test="boxId != null">
        box_id,
      </if>
      <if test="transferOrderId != null">
        transfer_order_id,
      </if>
      <if test="costFirst != null">
        cost_first,
      </if>
      <if test="costGoodsClearance != null">
        cost_goods_clearance,
      </if>
      <if test="costDuty != null">
        cost_duty,
      </if>
      <if test="costCustomsClearance != null">
        cost_customs_clearance,
      </if>
      <if test="costWeight != null">
        cost_weight,
      </if>
      <if test="costFuel != null">
        cost_fuel,
      </if>
      <if test="warehouseCode != null">
        warehouse_code,
      </if>
      <if test="areaId != null">
        area_id,
      </if>
      <if test="companyId != null">
        company_id,
      </if>
      <if test="bailunSku != null">
        bailun_sku,
      </if>
      <if test="quantity != null">
        quantity,
      </if>
      <if test="skuWeight != null">
        sku_weight,
      </if>
      <if test="skuWeightRatio != null">
        sku_weight_ratio,
      </if>
      <if test="skuCostFirst != null">
        sku_cost_first,
      </if>
      <if test="skuStockQuantity != null">
        sku_stock_quantity,
      </if>
      <if test="preAvlSkuCostFirst != null">
        pre_avl_sku_cost_first,
      </if>
      <if test="afterAvlSkuCostFirst != null">
        after_avl_sku_cost_first,
      </if>
      <if test="hasCalculation != null">
        has_calculation,
      </if>
      <if test="operationTime != null">
        operation_time,
      </if>
      <if test="bjCreateTime != null">
        bj_create_time,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=INTEGER},
      </if>
      <if test="channelOrderId != null">
        #{channelOrderId,jdbcType=VARCHAR},
      </if>
      <if test="channelId != null">
        #{channelId,jdbcType=INTEGER},
      </if>
      <if test="boxId != null">
        #{boxId,jdbcType=VARCHAR},
      </if>
      <if test="transferOrderId != null">
        #{transferOrderId,jdbcType=VARCHAR},
      </if>
      <if test="costFirst != null">
        #{costFirst,jdbcType=DECIMAL},
      </if>
      <if test="costGoodsClearance != null">
        #{costGoodsClearance,jdbcType=DECIMAL},
      </if>
      <if test="costDuty != null">
        #{costDuty,jdbcType=DECIMAL},
      </if>
      <if test="costCustomsClearance != null">
        #{costCustomsClearance,jdbcType=DECIMAL},
      </if>
      <if test="costWeight != null">
        #{costWeight,jdbcType=DECIMAL},
      </if>
      <if test="costFuel != null">
        #{costFuel,jdbcType=DECIMAL},
      </if>
      <if test="warehouseCode != null">
        #{warehouseCode,jdbcType=VARCHAR},
      </if>
      <if test="areaId != null">
        #{areaId,jdbcType=INTEGER},
      </if>
      <if test="companyId != null">
        #{companyId,jdbcType=INTEGER},
      </if>
      <if test="bailunSku != null">
        #{bailunSku,jdbcType=VARCHAR},
      </if>
      <if test="quantity != null">
        #{quantity,jdbcType=INTEGER},
      </if>
      <if test="skuWeight != null">
        #{skuWeight,jdbcType=DECIMAL},
      </if>
      <if test="skuWeightRatio != null">
        #{skuWeightRatio,jdbcType=DECIMAL},
      </if>
      <if test="skuCostFirst != null">
        #{skuCostFirst,jdbcType=DECIMAL},
      </if>
      <if test="skuStockQuantity != null">
        #{skuStockQuantity,jdbcType=INTEGER},
      </if>
      <if test="preAvlSkuCostFirst != null">
        #{preAvlSkuCostFirst,jdbcType=DECIMAL},
      </if>
      <if test="afterAvlSkuCostFirst != null">
        #{afterAvlSkuCostFirst,jdbcType=DECIMAL},
      </if>
      <if test="hasCalculation != null">
        #{hasCalculation,jdbcType=BIT},
      </if>
      <if test="operationTime != null">
        #{operationTime,jdbcType=TIMESTAMP},
      </if>
      <if test="bjCreateTime != null">
        #{bjCreateTime,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.bailuntec.domain.example.DcBaseCostFirstFinishExample" resultType="java.lang.Long">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select count(*) from dc_base_cost_first_finish
    <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_cost_first_finish
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=INTEGER},
      </if>
      <if test="record.channelOrderId != null">
        channel_order_id = #{record.channelOrderId,jdbcType=VARCHAR},
      </if>
      <if test="record.channelId != null">
        channel_id = #{record.channelId,jdbcType=INTEGER},
      </if>
      <if test="record.boxId != null">
        box_id = #{record.boxId,jdbcType=VARCHAR},
      </if>
      <if test="record.transferOrderId != null">
        transfer_order_id = #{record.transferOrderId,jdbcType=VARCHAR},
      </if>
      <if test="record.costFirst != null">
        cost_first = #{record.costFirst,jdbcType=DECIMAL},
      </if>
      <if test="record.costGoodsClearance != null">
        cost_goods_clearance = #{record.costGoodsClearance,jdbcType=DECIMAL},
      </if>
      <if test="record.costDuty != null">
        cost_duty = #{record.costDuty,jdbcType=DECIMAL},
      </if>
      <if test="record.costCustomsClearance != null">
        cost_customs_clearance = #{record.costCustomsClearance,jdbcType=DECIMAL},
      </if>
      <if test="record.costWeight != null">
        cost_weight = #{record.costWeight,jdbcType=DECIMAL},
      </if>
      <if test="record.costFuel != null">
        cost_fuel = #{record.costFuel,jdbcType=DECIMAL},
      </if>
      <if test="record.warehouseCode != null">
        warehouse_code = #{record.warehouseCode,jdbcType=VARCHAR},
      </if>
      <if test="record.areaId != null">
        area_id = #{record.areaId,jdbcType=INTEGER},
      </if>
      <if test="record.companyId != null">
        company_id = #{record.companyId,jdbcType=INTEGER},
      </if>
      <if test="record.bailunSku != null">
        bailun_sku = #{record.bailunSku,jdbcType=VARCHAR},
      </if>
      <if test="record.quantity != null">
        quantity = #{record.quantity,jdbcType=INTEGER},
      </if>
      <if test="record.skuWeight != null">
        sku_weight = #{record.skuWeight,jdbcType=DECIMAL},
      </if>
      <if test="record.skuWeightRatio != null">
        sku_weight_ratio = #{record.skuWeightRatio,jdbcType=DECIMAL},
      </if>
      <if test="record.skuCostFirst != null">
        sku_cost_first = #{record.skuCostFirst,jdbcType=DECIMAL},
      </if>
      <if test="record.skuStockQuantity != null">
        sku_stock_quantity = #{record.skuStockQuantity,jdbcType=INTEGER},
      </if>
      <if test="record.preAvlSkuCostFirst != null">
        pre_avl_sku_cost_first = #{record.preAvlSkuCostFirst,jdbcType=DECIMAL},
      </if>
      <if test="record.afterAvlSkuCostFirst != null">
        after_avl_sku_cost_first = #{record.afterAvlSkuCostFirst,jdbcType=DECIMAL},
      </if>
      <if test="record.hasCalculation != null">
        has_calculation = #{record.hasCalculation,jdbcType=BIT},
      </if>
      <if test="record.operationTime != null">
        operation_time = #{record.operationTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.bjCreateTime != null">
        bj_create_time = #{record.bjCreateTime,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_cost_first_finish
    set id = #{record.id,jdbcType=INTEGER},
      channel_order_id = #{record.channelOrderId,jdbcType=VARCHAR},
      channel_id = #{record.channelId,jdbcType=INTEGER},
      box_id = #{record.boxId,jdbcType=VARCHAR},
      transfer_order_id = #{record.transferOrderId,jdbcType=VARCHAR},
      cost_first = #{record.costFirst,jdbcType=DECIMAL},
      cost_goods_clearance = #{record.costGoodsClearance,jdbcType=DECIMAL},
      cost_duty = #{record.costDuty,jdbcType=DECIMAL},
      cost_customs_clearance = #{record.costCustomsClearance,jdbcType=DECIMAL},
      cost_weight = #{record.costWeight,jdbcType=DECIMAL},
      cost_fuel = #{record.costFuel,jdbcType=DECIMAL},
      warehouse_code = #{record.warehouseCode,jdbcType=VARCHAR},
      area_id = #{record.areaId,jdbcType=INTEGER},
      company_id = #{record.companyId,jdbcType=INTEGER},
      bailun_sku = #{record.bailunSku,jdbcType=VARCHAR},
      quantity = #{record.quantity,jdbcType=INTEGER},
      sku_weight = #{record.skuWeight,jdbcType=DECIMAL},
      sku_weight_ratio = #{record.skuWeightRatio,jdbcType=DECIMAL},
      sku_cost_first = #{record.skuCostFirst,jdbcType=DECIMAL},
      sku_stock_quantity = #{record.skuStockQuantity,jdbcType=INTEGER},
      pre_avl_sku_cost_first = #{record.preAvlSkuCostFirst,jdbcType=DECIMAL},
      after_avl_sku_cost_first = #{record.afterAvlSkuCostFirst,jdbcType=DECIMAL},
      has_calculation = #{record.hasCalculation,jdbcType=BIT},
      operation_time = #{record.operationTime,jdbcType=TIMESTAMP},
      bj_create_time = #{record.bjCreateTime,jdbcType=TIMESTAMP}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.bailuntec.domain.entity.DcBaseCostFirstFinish">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update dc_base_cost_first_finish
    <set>
      <if test="channelOrderId != null">
        channel_order_id = #{channelOrderId,jdbcType=VARCHAR},
      </if>
      <if test="channelId != null">
        channel_id = #{channelId,jdbcType=INTEGER},
      </if>
      <if test="boxId != null">
        box_id = #{boxId,jdbcType=VARCHAR},
      </if>
      <if test="transferOrderId != null">
        transfer_order_id = #{transferOrderId,jdbcType=VARCHAR},
      </if>
      <if test="costFirst != null">
        cost_first = #{costFirst,jdbcType=DECIMAL},
      </if>
      <if test="costGoodsClearance != null">
        cost_goods_clearance = #{costGoodsClearance,jdbcType=DECIMAL},
      </if>
      <if test="costDuty != null">
        cost_duty = #{costDuty,jdbcType=DECIMAL},
      </if>
      <if test="costCustomsClearance != null">
        cost_customs_clearance = #{costCustomsClearance,jdbcType=DECIMAL},
      </if>
      <if test="costWeight != null">
        cost_weight = #{costWeight,jdbcType=DECIMAL},
      </if>
      <if test="costFuel != null">
        cost_fuel = #{costFuel,jdbcType=DECIMAL},
      </if>
      <if test="warehouseCode != null">
        warehouse_code = #{warehouseCode,jdbcType=VARCHAR},
      </if>
      <if test="areaId != null">
        area_id = #{areaId,jdbcType=INTEGER},
      </if>
      <if test="companyId != null">
        company_id = #{companyId,jdbcType=INTEGER},
      </if>
      <if test="bailunSku != null">
        bailun_sku = #{bailunSku,jdbcType=VARCHAR},
      </if>
      <if test="quantity != null">
        quantity = #{quantity,jdbcType=INTEGER},
      </if>
      <if test="skuWeight != null">
        sku_weight = #{skuWeight,jdbcType=DECIMAL},
      </if>
      <if test="skuWeightRatio != null">
        sku_weight_ratio = #{skuWeightRatio,jdbcType=DECIMAL},
      </if>
      <if test="skuCostFirst != null">
        sku_cost_first = #{skuCostFirst,jdbcType=DECIMAL},
      </if>
      <if test="skuStockQuantity != null">
        sku_stock_quantity = #{skuStockQuantity,jdbcType=INTEGER},
      </if>
      <if test="preAvlSkuCostFirst != null">
        pre_avl_sku_cost_first = #{preAvlSkuCostFirst,jdbcType=DECIMAL},
      </if>
      <if test="afterAvlSkuCostFirst != null">
        after_avl_sku_cost_first = #{afterAvlSkuCostFirst,jdbcType=DECIMAL},
      </if>
      <if test="hasCalculation != null">
        has_calculation = #{hasCalculation,jdbcType=BIT},
      </if>
      <if test="operationTime != null">
        operation_time = #{operationTime,jdbcType=TIMESTAMP},
      </if>
      <if test="bjCreateTime != null">
        bj_create_time = #{bjCreateTime,jdbcType=TIMESTAMP},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.bailuntec.domain.entity.DcBaseCostFirstFinish">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update dc_base_cost_first_finish
    set channel_order_id = #{channelOrderId,jdbcType=VARCHAR},
      channel_id = #{channelId,jdbcType=INTEGER},
      box_id = #{boxId,jdbcType=VARCHAR},
      transfer_order_id = #{transferOrderId,jdbcType=VARCHAR},
      cost_first = #{costFirst,jdbcType=DECIMAL},
      cost_goods_clearance = #{costGoodsClearance,jdbcType=DECIMAL},
      cost_duty = #{costDuty,jdbcType=DECIMAL},
      cost_customs_clearance = #{costCustomsClearance,jdbcType=DECIMAL},
      cost_weight = #{costWeight,jdbcType=DECIMAL},
      cost_fuel = #{costFuel,jdbcType=DECIMAL},
      warehouse_code = #{warehouseCode,jdbcType=VARCHAR},
      area_id = #{areaId,jdbcType=INTEGER},
      company_id = #{companyId,jdbcType=INTEGER},
      bailun_sku = #{bailunSku,jdbcType=VARCHAR},
      quantity = #{quantity,jdbcType=INTEGER},
      sku_weight = #{skuWeight,jdbcType=DECIMAL},
      sku_weight_ratio = #{skuWeightRatio,jdbcType=DECIMAL},
      sku_cost_first = #{skuCostFirst,jdbcType=DECIMAL},
      sku_stock_quantity = #{skuStockQuantity,jdbcType=INTEGER},
      pre_avl_sku_cost_first = #{preAvlSkuCostFirst,jdbcType=DECIMAL},
      after_avl_sku_cost_first = #{afterAvlSkuCostFirst,jdbcType=DECIMAL},
      has_calculation = #{hasCalculation,jdbcType=BIT},
      operation_time = #{operationTime,jdbcType=TIMESTAMP},
      bj_create_time = #{bjCreateTime,jdbcType=TIMESTAMP}
    where id = #{id,jdbcType=INTEGER}
  </update>
  <insert id="upsertSelective" parameterType="com.bailuntec.domain.entity.DcBaseCostFirstFinish">
    <!--
      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_cost_first_finish
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="channelOrderId != null">
        channel_order_id,
      </if>
      <if test="channelId != null">
        channel_id,
      </if>
      <if test="boxId != null">
        box_id,
      </if>
      <if test="transferOrderId != null">
        transfer_order_id,
      </if>
      <if test="costFirst != null">
        cost_first,
      </if>
      <if test="costGoodsClearance != null">
        cost_goods_clearance,
      </if>
      <if test="costDuty != null">
        cost_duty,
      </if>
      <if test="costCustomsClearance != null">
        cost_customs_clearance,
      </if>
      <if test="costWeight != null">
        cost_weight,
      </if>
      <if test="costFuel != null">
        cost_fuel,
      </if>
      <if test="warehouseCode != null">
        warehouse_code,
      </if>
      <if test="areaId != null">
        area_id,
      </if>
      <if test="companyId != null">
        company_id,
      </if>
      <if test="bailunSku != null">
        bailun_sku,
      </if>
      <if test="quantity != null">
        quantity,
      </if>
      <if test="skuWeight != null">
        sku_weight,
      </if>
      <if test="skuWeightRatio != null">
        sku_weight_ratio,
      </if>
      <if test="skuCostFirst != null">
        sku_cost_first,
      </if>
      <if test="skuStockQuantity != null">
        sku_stock_quantity,
      </if>
      <if test="preAvlSkuCostFirst != null">
        pre_avl_sku_cost_first,
      </if>
      <if test="afterAvlSkuCostFirst != null">
        after_avl_sku_cost_first,
      </if>
      <if test="hasCalculation != null">
        has_calculation,
      </if>
      <if test="operationTime != null">
        operation_time,
      </if>
      <if test="bjCreateTime != null">
        bj_create_time,
      </if>
    </trim>
    values
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=INTEGER},
      </if>
      <if test="channelOrderId != null">
        #{channelOrderId,jdbcType=VARCHAR},
      </if>
      <if test="channelId != null">
        #{channelId,jdbcType=INTEGER},
      </if>
      <if test="boxId != null">
        #{boxId,jdbcType=VARCHAR},
      </if>
      <if test="transferOrderId != null">
        #{transferOrderId,jdbcType=VARCHAR},
      </if>
      <if test="costFirst != null">
        #{costFirst,jdbcType=DECIMAL},
      </if>
      <if test="costGoodsClearance != null">
        #{costGoodsClearance,jdbcType=DECIMAL},
      </if>
      <if test="costDuty != null">
        #{costDuty,jdbcType=DECIMAL},
      </if>
      <if test="costCustomsClearance != null">
        #{costCustomsClearance,jdbcType=DECIMAL},
      </if>
      <if test="costWeight != null">
        #{costWeight,jdbcType=DECIMAL},
      </if>
      <if test="costFuel != null">
        #{costFuel,jdbcType=DECIMAL},
      </if>
      <if test="warehouseCode != null">
        #{warehouseCode,jdbcType=VARCHAR},
      </if>
      <if test="areaId != null">
        #{areaId,jdbcType=INTEGER},
      </if>
      <if test="companyId != null">
        #{companyId,jdbcType=INTEGER},
      </if>
      <if test="bailunSku != null">
        #{bailunSku,jdbcType=VARCHAR},
      </if>
      <if test="quantity != null">
        #{quantity,jdbcType=INTEGER},
      </if>
      <if test="skuWeight != null">
        #{skuWeight,jdbcType=DECIMAL},
      </if>
      <if test="skuWeightRatio != null">
        #{skuWeightRatio,jdbcType=DECIMAL},
      </if>
      <if test="skuCostFirst != null">
        #{skuCostFirst,jdbcType=DECIMAL},
      </if>
      <if test="skuStockQuantity != null">
        #{skuStockQuantity,jdbcType=INTEGER},
      </if>
      <if test="preAvlSkuCostFirst != null">
        #{preAvlSkuCostFirst,jdbcType=DECIMAL},
      </if>
      <if test="afterAvlSkuCostFirst != null">
        #{afterAvlSkuCostFirst,jdbcType=DECIMAL},
      </if>
      <if test="hasCalculation != null">
        #{hasCalculation,jdbcType=BIT},
      </if>
      <if test="operationTime != null">
        #{operationTime,jdbcType=TIMESTAMP},
      </if>
      <if test="bjCreateTime != null">
        #{bjCreateTime,jdbcType=TIMESTAMP},
      </if>
    </trim>
    on duplicate key update 
    <trim suffixOverrides=",">
      <if test="id != null">
        id = #{id,jdbcType=INTEGER},
      </if>
      <if test="channelOrderId != null">
        channel_order_id = #{channelOrderId,jdbcType=VARCHAR},
      </if>
      <if test="channelId != null">
        channel_id = #{channelId,jdbcType=INTEGER},
      </if>
      <if test="boxId != null">
        box_id = #{boxId,jdbcType=VARCHAR},
      </if>
      <if test="transferOrderId != null">
        transfer_order_id = #{transferOrderId,jdbcType=VARCHAR},
      </if>
      <if test="costFirst != null">
        cost_first = #{costFirst,jdbcType=DECIMAL},
      </if>
      <if test="costGoodsClearance != null">
        cost_goods_clearance = #{costGoodsClearance,jdbcType=DECIMAL},
      </if>
      <if test="costDuty != null">
        cost_duty = #{costDuty,jdbcType=DECIMAL},
      </if>
      <if test="costCustomsClearance != null">
        cost_customs_clearance = #{costCustomsClearance,jdbcType=DECIMAL},
      </if>
      <if test="costWeight != null">
        cost_weight = #{costWeight,jdbcType=DECIMAL},
      </if>
      <if test="costFuel != null">
        cost_fuel = #{costFuel,jdbcType=DECIMAL},
      </if>
      <if test="warehouseCode != null">
        warehouse_code = #{warehouseCode,jdbcType=VARCHAR},
      </if>
      <if test="areaId != null">
        area_id = #{areaId,jdbcType=INTEGER},
      </if>
      <if test="companyId != null">
        company_id = #{companyId,jdbcType=INTEGER},
      </if>
      <if test="bailunSku != null">
        bailun_sku = #{bailunSku,jdbcType=VARCHAR},
      </if>
      <if test="quantity != null">
        quantity = #{quantity,jdbcType=INTEGER},
      </if>
      <if test="skuWeight != null">
        sku_weight = #{skuWeight,jdbcType=DECIMAL},
      </if>
      <if test="skuWeightRatio != null">
        sku_weight_ratio = #{skuWeightRatio,jdbcType=DECIMAL},
      </if>
      <if test="skuCostFirst != null">
        sku_cost_first = #{skuCostFirst,jdbcType=DECIMAL},
      </if>
      <if test="skuStockQuantity != null">
        sku_stock_quantity = #{skuStockQuantity,jdbcType=INTEGER},
      </if>
      <if test="preAvlSkuCostFirst != null">
        pre_avl_sku_cost_first = #{preAvlSkuCostFirst,jdbcType=DECIMAL},
      </if>
      <if test="afterAvlSkuCostFirst != null">
        after_avl_sku_cost_first = #{afterAvlSkuCostFirst,jdbcType=DECIMAL},
      </if>
      <if test="hasCalculation != null">
        has_calculation = #{hasCalculation,jdbcType=BIT},
      </if>
      <if test="operationTime != null">
        operation_time = #{operationTime,jdbcType=TIMESTAMP},
      </if>
      <if test="bjCreateTime != null">
        bj_create_time = #{bjCreateTime,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
  <insert id="upsert" parameterType="com.bailuntec.domain.entity.DcBaseCostFirstFinish">
    <!--
      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_cost_first_finish
    (id, channel_order_id, channel_id, box_id, transfer_order_id, cost_first, cost_goods_clearance, 
      cost_duty, cost_customs_clearance, cost_weight, cost_fuel, warehouse_code, area_id, 
      company_id, bailun_sku, quantity, sku_weight, sku_weight_ratio, sku_cost_first, 
      sku_stock_quantity, pre_avl_sku_cost_first, after_avl_sku_cost_first, has_calculation, 
      operation_time, bj_create_time)
    values
    (#{id,jdbcType=INTEGER}, #{channelOrderId,jdbcType=VARCHAR}, #{channelId,jdbcType=INTEGER}, 
      #{boxId,jdbcType=VARCHAR}, #{transferOrderId,jdbcType=VARCHAR}, #{costFirst,jdbcType=DECIMAL}, 
      #{costGoodsClearance,jdbcType=DECIMAL}, #{costDuty,jdbcType=DECIMAL}, #{costCustomsClearance,jdbcType=DECIMAL}, 
      #{costWeight,jdbcType=DECIMAL}, #{costFuel,jdbcType=DECIMAL}, #{warehouseCode,jdbcType=VARCHAR}, 
      #{areaId,jdbcType=INTEGER}, #{companyId,jdbcType=INTEGER}, #{bailunSku,jdbcType=VARCHAR}, 
      #{quantity,jdbcType=INTEGER}, #{skuWeight,jdbcType=DECIMAL}, #{skuWeightRatio,jdbcType=DECIMAL}, 
      #{skuCostFirst,jdbcType=DECIMAL}, #{skuStockQuantity,jdbcType=INTEGER}, #{preAvlSkuCostFirst,jdbcType=DECIMAL}, 
      #{afterAvlSkuCostFirst,jdbcType=DECIMAL}, #{hasCalculation,jdbcType=BIT}, #{operationTime,jdbcType=TIMESTAMP}, 
      #{bjCreateTime,jdbcType=TIMESTAMP})
    on duplicate key update 
    id = #{id,jdbcType=INTEGER}, 
    channel_order_id = #{channelOrderId,jdbcType=VARCHAR}, 
    channel_id = #{channelId,jdbcType=INTEGER}, 
    box_id = #{boxId,jdbcType=VARCHAR}, 
    transfer_order_id = #{transferOrderId,jdbcType=VARCHAR}, 
    cost_first = #{costFirst,jdbcType=DECIMAL}, 
    cost_goods_clearance = #{costGoodsClearance,jdbcType=DECIMAL}, 
    cost_duty = #{costDuty,jdbcType=DECIMAL}, 
    cost_customs_clearance = #{costCustomsClearance,jdbcType=DECIMAL}, 
    cost_weight = #{costWeight,jdbcType=DECIMAL}, 
    cost_fuel = #{costFuel,jdbcType=DECIMAL}, 
    warehouse_code = #{warehouseCode,jdbcType=VARCHAR}, 
    area_id = #{areaId,jdbcType=INTEGER}, 
    company_id = #{companyId,jdbcType=INTEGER}, 
    bailun_sku = #{bailunSku,jdbcType=VARCHAR}, 
    quantity = #{quantity,jdbcType=INTEGER}, 
    sku_weight = #{skuWeight,jdbcType=DECIMAL}, 
    sku_weight_ratio = #{skuWeightRatio,jdbcType=DECIMAL}, 
    sku_cost_first = #{skuCostFirst,jdbcType=DECIMAL}, 
    sku_stock_quantity = #{skuStockQuantity,jdbcType=INTEGER}, 
    pre_avl_sku_cost_first = #{preAvlSkuCostFirst,jdbcType=DECIMAL}, 
    after_avl_sku_cost_first = #{afterAvlSkuCostFirst,jdbcType=DECIMAL}, 
    has_calculation = #{hasCalculation,jdbcType=BIT}, 
    operation_time = #{operationTime,jdbcType=TIMESTAMP}, 
    bj_create_time = #{bjCreateTime,jdbcType=TIMESTAMP}
  </insert>
  <select id="selectOneByExample" parameterType="com.bailuntec.domain.example.DcBaseCostFirstFinishExample" 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_cost_first_finish
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
    limit 1
  </select>
</mapper>