<?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.DcBaseStockMapper">
  <resultMap id="BaseResultMap" type="com.bailuntec.domain.entity.DcBaseStock">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="bailun_sku" jdbcType="VARCHAR" property="bailunSku" />
    <result column="warehouse_code" jdbcType="VARCHAR" property="warehouseCode" />
    <result column="owner_code" jdbcType="VARCHAR" property="ownerCode" />
    <result column="quantity_reservation" jdbcType="INTEGER" property="quantityReservation" />
    <result column="quantity_transport" jdbcType="INTEGER" property="quantityTransport" />
    <result column="quantity_transfer" jdbcType="INTEGER" property="quantityTransfer" />
    <result column="quantity_freeze" jdbcType="INTEGER" property="quantityFreeze" />
    <result column="quantity_supplier" jdbcType="INTEGER" property="quantitySupplier" />
    <result column="quantity_presell" jdbcType="INTEGER" property="quantityPresell" />
    <result column="quantity_defective" jdbcType="INTEGER" property="quantityDefective" />
    <result column="quantity_transit" jdbcType="INTEGER" property="quantityTransit" />
    <result column="wait_check" jdbcType="INTEGER" property="waitCheck" />
    <result column="wait_putaway" jdbcType="INTEGER" property="waitPutaway" />
    <result column="usable_stock" jdbcType="INTEGER" property="usableStock" />
    <result column="usable_sales" jdbcType="INTEGER" property="usableSales" />
    <result column="usable_sales_private" jdbcType="INTEGER" property="usableSalesPrivate" />
    <result column="usable_sales_share" jdbcType="INTEGER" property="usableSalesShare" />
    <result column="in_warehouse_share" jdbcType="INTEGER" property="inWarehouseShare" />
    <result column="in_warehouse_private" jdbcType="INTEGER" property="inWarehousePrivate" />
    <result column="in_warehouse" jdbcType="INTEGER" property="inWarehouse" />
    <result column="occupy_stock_share" jdbcType="INTEGER" property="occupyStockShare" />
    <result column="occupy_stock_private" jdbcType="INTEGER" property="occupyStockPrivate" />
    <result column="occupy_stock" jdbcType="INTEGER" property="occupyStock" />
    <result column="occupy_activity" jdbcType="INTEGER" property="occupyActivity" />
    <result column="occupy_order_private" jdbcType="INTEGER" property="occupyOrderPrivate" />
    <result column="occupy_order_share" jdbcType="INTEGER" property="occupyOrderShare" />
    <result column="occupy_order" jdbcType="INTEGER" property="occupyOrder" />
    <result column="gmt_create" jdbcType="TIMESTAMP" property="gmtCreate" />
    <result column="gmt_modified" jdbcType="TIMESTAMP" property="gmtModified" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
  </resultMap>
  <sql id="Example_Where_Clause">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <where>
      <foreach collection="oredCriteria" item="criteria" separator="or">
        <if test="criteria.valid">
          <trim prefix="(" prefixOverrides="and" suffix=")">
            <foreach collection="criteria.criteria" item="criterion">
              <choose>
                <when test="criterion.noValue">
                  and ${criterion.condition}
                </when>
                <when test="criterion.singleValue">
                  and ${criterion.condition} #{criterion.value}
                </when>
                <when test="criterion.betweenValue">
                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
                </when>
                <when test="criterion.listValue">
                  and ${criterion.condition}
                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
                    #{listItem}
                  </foreach>
                </when>
              </choose>
            </foreach>
          </trim>
        </if>
      </foreach>
    </where>
  </sql>
  <sql id="Update_By_Example_Where_Clause">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <where>
      <foreach collection="example.oredCriteria" item="criteria" separator="or">
        <if test="criteria.valid">
          <trim prefix="(" prefixOverrides="and" suffix=")">
            <foreach collection="criteria.criteria" item="criterion">
              <choose>
                <when test="criterion.noValue">
                  and ${criterion.condition}
                </when>
                <when test="criterion.singleValue">
                  and ${criterion.condition} #{criterion.value}
                </when>
                <when test="criterion.betweenValue">
                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
                </when>
                <when test="criterion.listValue">
                  and ${criterion.condition}
                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
                    #{listItem}
                  </foreach>
                </when>
              </choose>
            </foreach>
          </trim>
        </if>
      </foreach>
    </where>
  </sql>
  <sql id="Base_Column_List">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    id, bailun_sku, warehouse_code, owner_code, quantity_reservation, quantity_transport, 
    quantity_transfer, quantity_freeze, quantity_supplier, quantity_presell, quantity_defective, 
    quantity_transit, wait_check, wait_putaway, usable_stock, usable_sales, usable_sales_private, 
    usable_sales_share, in_warehouse_share, in_warehouse_private, in_warehouse, occupy_stock_share, 
    occupy_stock_private, occupy_stock, occupy_activity, occupy_order_private, occupy_order_share, 
    occupy_order, gmt_create, gmt_modified, create_time, update_time
  </sql>
  <select id="selectByExample" parameterType="com.bailuntec.domain.example.DcBaseStockExample" 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_stock
    <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_stock
    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_stock
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <delete id="deleteByExample" parameterType="com.bailuntec.domain.example.DcBaseStockExample">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    delete from dc_base_stock
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.bailuntec.domain.entity.DcBaseStock">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into dc_base_stock (id, bailun_sku, warehouse_code, 
      owner_code, quantity_reservation, quantity_transport, 
      quantity_transfer, quantity_freeze, quantity_supplier, 
      quantity_presell, quantity_defective, quantity_transit, 
      wait_check, wait_putaway, usable_stock, 
      usable_sales, usable_sales_private, usable_sales_share, 
      in_warehouse_share, in_warehouse_private, in_warehouse, 
      occupy_stock_share, occupy_stock_private, occupy_stock, 
      occupy_activity, occupy_order_private, occupy_order_share, 
      occupy_order, gmt_create, gmt_modified, 
      create_time, update_time)
    values (#{id,jdbcType=INTEGER}, #{bailunSku,jdbcType=VARCHAR}, #{warehouseCode,jdbcType=VARCHAR}, 
      #{ownerCode,jdbcType=VARCHAR}, #{quantityReservation,jdbcType=INTEGER}, #{quantityTransport,jdbcType=INTEGER}, 
      #{quantityTransfer,jdbcType=INTEGER}, #{quantityFreeze,jdbcType=INTEGER}, #{quantitySupplier,jdbcType=INTEGER}, 
      #{quantityPresell,jdbcType=INTEGER}, #{quantityDefective,jdbcType=INTEGER}, #{quantityTransit,jdbcType=INTEGER}, 
      #{waitCheck,jdbcType=INTEGER}, #{waitPutaway,jdbcType=INTEGER}, #{usableStock,jdbcType=INTEGER}, 
      #{usableSales,jdbcType=INTEGER}, #{usableSalesPrivate,jdbcType=INTEGER}, #{usableSalesShare,jdbcType=INTEGER}, 
      #{inWarehouseShare,jdbcType=INTEGER}, #{inWarehousePrivate,jdbcType=INTEGER}, #{inWarehouse,jdbcType=INTEGER}, 
      #{occupyStockShare,jdbcType=INTEGER}, #{occupyStockPrivate,jdbcType=INTEGER}, #{occupyStock,jdbcType=INTEGER}, 
      #{occupyActivity,jdbcType=INTEGER}, #{occupyOrderPrivate,jdbcType=INTEGER}, #{occupyOrderShare,jdbcType=INTEGER}, 
      #{occupyOrder,jdbcType=INTEGER}, #{gmtCreate,jdbcType=TIMESTAMP}, #{gmtModified,jdbcType=TIMESTAMP},
      #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})
  </insert>
  <insert id="insertSelective" parameterType="com.bailuntec.domain.entity.DcBaseStock">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into dc_base_stock
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="bailunSku != null">
        bailun_sku,
      </if>
      <if test="warehouseCode != null">
        warehouse_code,
      </if>
      <if test="ownerCode != null">
        owner_code,
      </if>
      <if test="quantityReservation != null">
        quantity_reservation,
      </if>
      <if test="quantityTransport != null">
        quantity_transport,
      </if>
      <if test="quantityTransfer != null">
        quantity_transfer,
      </if>
      <if test="quantityFreeze != null">
        quantity_freeze,
      </if>
      <if test="quantitySupplier != null">
        quantity_supplier,
      </if>
      <if test="quantityPresell != null">
        quantity_presell,
      </if>
      <if test="quantityDefective != null">
        quantity_defective,
      </if>
      <if test="quantityTransit != null">
        quantity_transit,
      </if>
      <if test="waitCheck != null">
        wait_check,
      </if>
      <if test="waitPutaway != null">
        wait_putaway,
      </if>
      <if test="usableStock != null">
        usable_stock,
      </if>
      <if test="usableSales != null">
        usable_sales,
      </if>
      <if test="usableSalesPrivate != null">
        usable_sales_private,
      </if>
      <if test="usableSalesShare != null">
        usable_sales_share,
      </if>
      <if test="inWarehouseShare != null">
        in_warehouse_share,
      </if>
      <if test="inWarehousePrivate != null">
        in_warehouse_private,
      </if>
      <if test="inWarehouse != null">
        in_warehouse,
      </if>
      <if test="occupyStockShare != null">
        occupy_stock_share,
      </if>
      <if test="occupyStockPrivate != null">
        occupy_stock_private,
      </if>
      <if test="occupyStock != null">
        occupy_stock,
      </if>
      <if test="occupyActivity != null">
        occupy_activity,
      </if>
      <if test="occupyOrderPrivate != null">
        occupy_order_private,
      </if>
      <if test="occupyOrderShare != null">
        occupy_order_share,
      </if>
      <if test="occupyOrder != null">
        occupy_order,
      </if>
      <if test="gmtCreate != null">
        gmt_create,
      </if>
      <if test="gmtModified != null">
        gmt_modified,
      </if>
      <if test="createTime != null">
        create_time,
      </if>
      <if test="updateTime != null">
        update_time,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=INTEGER},
      </if>
      <if test="bailunSku != null">
        #{bailunSku,jdbcType=VARCHAR},
      </if>
      <if test="warehouseCode != null">
        #{warehouseCode,jdbcType=VARCHAR},
      </if>
      <if test="ownerCode != null">
        #{ownerCode,jdbcType=VARCHAR},
      </if>
      <if test="quantityReservation != null">
        #{quantityReservation,jdbcType=INTEGER},
      </if>
      <if test="quantityTransport != null">
        #{quantityTransport,jdbcType=INTEGER},
      </if>
      <if test="quantityTransfer != null">
        #{quantityTransfer,jdbcType=INTEGER},
      </if>
      <if test="quantityFreeze != null">
        #{quantityFreeze,jdbcType=INTEGER},
      </if>
      <if test="quantitySupplier != null">
        #{quantitySupplier,jdbcType=INTEGER},
      </if>
      <if test="quantityPresell != null">
        #{quantityPresell,jdbcType=INTEGER},
      </if>
      <if test="quantityDefective != null">
        #{quantityDefective,jdbcType=INTEGER},
      </if>
      <if test="quantityTransit != null">
        #{quantityTransit,jdbcType=INTEGER},
      </if>
      <if test="waitCheck != null">
        #{waitCheck,jdbcType=INTEGER},
      </if>
      <if test="waitPutaway != null">
        #{waitPutaway,jdbcType=INTEGER},
      </if>
      <if test="usableStock != null">
        #{usableStock,jdbcType=INTEGER},
      </if>
      <if test="usableSales != null">
        #{usableSales,jdbcType=INTEGER},
      </if>
      <if test="usableSalesPrivate != null">
        #{usableSalesPrivate,jdbcType=INTEGER},
      </if>
      <if test="usableSalesShare != null">
        #{usableSalesShare,jdbcType=INTEGER},
      </if>
      <if test="inWarehouseShare != null">
        #{inWarehouseShare,jdbcType=INTEGER},
      </if>
      <if test="inWarehousePrivate != null">
        #{inWarehousePrivate,jdbcType=INTEGER},
      </if>
      <if test="inWarehouse != null">
        #{inWarehouse,jdbcType=INTEGER},
      </if>
      <if test="occupyStockShare != null">
        #{occupyStockShare,jdbcType=INTEGER},
      </if>
      <if test="occupyStockPrivate != null">
        #{occupyStockPrivate,jdbcType=INTEGER},
      </if>
      <if test="occupyStock != null">
        #{occupyStock,jdbcType=INTEGER},
      </if>
      <if test="occupyActivity != null">
        #{occupyActivity,jdbcType=INTEGER},
      </if>
      <if test="occupyOrderPrivate != null">
        #{occupyOrderPrivate,jdbcType=INTEGER},
      </if>
      <if test="occupyOrderShare != null">
        #{occupyOrderShare,jdbcType=INTEGER},
      </if>
      <if test="occupyOrder != null">
        #{occupyOrder,jdbcType=INTEGER},
      </if>
      <if test="gmtCreate != null">
        #{gmtCreate,jdbcType=TIMESTAMP},
      </if>
      <if test="gmtModified != null">
        #{gmtModified,jdbcType=TIMESTAMP},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateTime != null">
        #{updateTime,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.bailuntec.domain.example.DcBaseStockExample" resultType="java.lang.Long">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select count(*) from dc_base_stock
    <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_stock
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=INTEGER},
      </if>
      <if test="record.bailunSku != null">
        bailun_sku = #{record.bailunSku,jdbcType=VARCHAR},
      </if>
      <if test="record.warehouseCode != null">
        warehouse_code = #{record.warehouseCode,jdbcType=VARCHAR},
      </if>
      <if test="record.ownerCode != null">
        owner_code = #{record.ownerCode,jdbcType=VARCHAR},
      </if>
      <if test="record.quantityReservation != null">
        quantity_reservation = #{record.quantityReservation,jdbcType=INTEGER},
      </if>
      <if test="record.quantityTransport != null">
        quantity_transport = #{record.quantityTransport,jdbcType=INTEGER},
      </if>
      <if test="record.quantityTransfer != null">
        quantity_transfer = #{record.quantityTransfer,jdbcType=INTEGER},
      </if>
      <if test="record.quantityFreeze != null">
        quantity_freeze = #{record.quantityFreeze,jdbcType=INTEGER},
      </if>
      <if test="record.quantitySupplier != null">
        quantity_supplier = #{record.quantitySupplier,jdbcType=INTEGER},
      </if>
      <if test="record.quantityPresell != null">
        quantity_presell = #{record.quantityPresell,jdbcType=INTEGER},
      </if>
      <if test="record.quantityDefective != null">
        quantity_defective = #{record.quantityDefective,jdbcType=INTEGER},
      </if>
      <if test="record.quantityTransit != null">
        quantity_transit = #{record.quantityTransit,jdbcType=INTEGER},
      </if>
      <if test="record.waitCheck != null">
        wait_check = #{record.waitCheck,jdbcType=INTEGER},
      </if>
      <if test="record.waitPutaway != null">
        wait_putaway = #{record.waitPutaway,jdbcType=INTEGER},
      </if>
      <if test="record.usableStock != null">
        usable_stock = #{record.usableStock,jdbcType=INTEGER},
      </if>
      <if test="record.usableSales != null">
        usable_sales = #{record.usableSales,jdbcType=INTEGER},
      </if>
      <if test="record.usableSalesPrivate != null">
        usable_sales_private = #{record.usableSalesPrivate,jdbcType=INTEGER},
      </if>
      <if test="record.usableSalesShare != null">
        usable_sales_share = #{record.usableSalesShare,jdbcType=INTEGER},
      </if>
      <if test="record.inWarehouseShare != null">
        in_warehouse_share = #{record.inWarehouseShare,jdbcType=INTEGER},
      </if>
      <if test="record.inWarehousePrivate != null">
        in_warehouse_private = #{record.inWarehousePrivate,jdbcType=INTEGER},
      </if>
      <if test="record.inWarehouse != null">
        in_warehouse = #{record.inWarehouse,jdbcType=INTEGER},
      </if>
      <if test="record.occupyStockShare != null">
        occupy_stock_share = #{record.occupyStockShare,jdbcType=INTEGER},
      </if>
      <if test="record.occupyStockPrivate != null">
        occupy_stock_private = #{record.occupyStockPrivate,jdbcType=INTEGER},
      </if>
      <if test="record.occupyStock != null">
        occupy_stock = #{record.occupyStock,jdbcType=INTEGER},
      </if>
      <if test="record.occupyActivity != null">
        occupy_activity = #{record.occupyActivity,jdbcType=INTEGER},
      </if>
      <if test="record.occupyOrderPrivate != null">
        occupy_order_private = #{record.occupyOrderPrivate,jdbcType=INTEGER},
      </if>
      <if test="record.occupyOrderShare != null">
        occupy_order_share = #{record.occupyOrderShare,jdbcType=INTEGER},
      </if>
      <if test="record.occupyOrder != null">
        occupy_order = #{record.occupyOrder,jdbcType=INTEGER},
      </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.createTime != null">
        create_time = #{record.createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.updateTime != null">
        update_time = #{record.updateTime,jdbcType=TIMESTAMP},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update dc_base_stock
    set id = #{record.id,jdbcType=INTEGER},
      bailun_sku = #{record.bailunSku,jdbcType=VARCHAR},
      warehouse_code = #{record.warehouseCode,jdbcType=VARCHAR},
      owner_code = #{record.ownerCode,jdbcType=VARCHAR},
      quantity_reservation = #{record.quantityReservation,jdbcType=INTEGER},
      quantity_transport = #{record.quantityTransport,jdbcType=INTEGER},
      quantity_transfer = #{record.quantityTransfer,jdbcType=INTEGER},
      quantity_freeze = #{record.quantityFreeze,jdbcType=INTEGER},
      quantity_supplier = #{record.quantitySupplier,jdbcType=INTEGER},
      quantity_presell = #{record.quantityPresell,jdbcType=INTEGER},
      quantity_defective = #{record.quantityDefective,jdbcType=INTEGER},
      quantity_transit = #{record.quantityTransit,jdbcType=INTEGER},
      wait_check = #{record.waitCheck,jdbcType=INTEGER},
      wait_putaway = #{record.waitPutaway,jdbcType=INTEGER},
      usable_stock = #{record.usableStock,jdbcType=INTEGER},
      usable_sales = #{record.usableSales,jdbcType=INTEGER},
      usable_sales_private = #{record.usableSalesPrivate,jdbcType=INTEGER},
      usable_sales_share = #{record.usableSalesShare,jdbcType=INTEGER},
      in_warehouse_share = #{record.inWarehouseShare,jdbcType=INTEGER},
      in_warehouse_private = #{record.inWarehousePrivate,jdbcType=INTEGER},
      in_warehouse = #{record.inWarehouse,jdbcType=INTEGER},
      occupy_stock_share = #{record.occupyStockShare,jdbcType=INTEGER},
      occupy_stock_private = #{record.occupyStockPrivate,jdbcType=INTEGER},
      occupy_stock = #{record.occupyStock,jdbcType=INTEGER},
      occupy_activity = #{record.occupyActivity,jdbcType=INTEGER},
      occupy_order_private = #{record.occupyOrderPrivate,jdbcType=INTEGER},
      occupy_order_share = #{record.occupyOrderShare,jdbcType=INTEGER},
      occupy_order = #{record.occupyOrder,jdbcType=INTEGER},
      gmt_create = #{record.gmtCreate,jdbcType=TIMESTAMP},
      gmt_modified = #{record.gmtModified,jdbcType=TIMESTAMP},
      create_time = #{record.createTime,jdbcType=TIMESTAMP},
      update_time = #{record.updateTime,jdbcType=TIMESTAMP}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.bailuntec.domain.entity.DcBaseStock">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update dc_base_stock
    <set>
      <if test="bailunSku != null">
        bailun_sku = #{bailunSku,jdbcType=VARCHAR},
      </if>
      <if test="warehouseCode != null">
        warehouse_code = #{warehouseCode,jdbcType=VARCHAR},
      </if>
      <if test="ownerCode != null">
        owner_code = #{ownerCode,jdbcType=VARCHAR},
      </if>
      <if test="quantityReservation != null">
        quantity_reservation = #{quantityReservation,jdbcType=INTEGER},
      </if>
      <if test="quantityTransport != null">
        quantity_transport = #{quantityTransport,jdbcType=INTEGER},
      </if>
      <if test="quantityTransfer != null">
        quantity_transfer = #{quantityTransfer,jdbcType=INTEGER},
      </if>
      <if test="quantityFreeze != null">
        quantity_freeze = #{quantityFreeze,jdbcType=INTEGER},
      </if>
      <if test="quantitySupplier != null">
        quantity_supplier = #{quantitySupplier,jdbcType=INTEGER},
      </if>
      <if test="quantityPresell != null">
        quantity_presell = #{quantityPresell,jdbcType=INTEGER},
      </if>
      <if test="quantityDefective != null">
        quantity_defective = #{quantityDefective,jdbcType=INTEGER},
      </if>
      <if test="quantityTransit != null">
        quantity_transit = #{quantityTransit,jdbcType=INTEGER},
      </if>
      <if test="waitCheck != null">
        wait_check = #{waitCheck,jdbcType=INTEGER},
      </if>
      <if test="waitPutaway != null">
        wait_putaway = #{waitPutaway,jdbcType=INTEGER},
      </if>
      <if test="usableStock != null">
        usable_stock = #{usableStock,jdbcType=INTEGER},
      </if>
      <if test="usableSales != null">
        usable_sales = #{usableSales,jdbcType=INTEGER},
      </if>
      <if test="usableSalesPrivate != null">
        usable_sales_private = #{usableSalesPrivate,jdbcType=INTEGER},
      </if>
      <if test="usableSalesShare != null">
        usable_sales_share = #{usableSalesShare,jdbcType=INTEGER},
      </if>
      <if test="inWarehouseShare != null">
        in_warehouse_share = #{inWarehouseShare,jdbcType=INTEGER},
      </if>
      <if test="inWarehousePrivate != null">
        in_warehouse_private = #{inWarehousePrivate,jdbcType=INTEGER},
      </if>
      <if test="inWarehouse != null">
        in_warehouse = #{inWarehouse,jdbcType=INTEGER},
      </if>
      <if test="occupyStockShare != null">
        occupy_stock_share = #{occupyStockShare,jdbcType=INTEGER},
      </if>
      <if test="occupyStockPrivate != null">
        occupy_stock_private = #{occupyStockPrivate,jdbcType=INTEGER},
      </if>
      <if test="occupyStock != null">
        occupy_stock = #{occupyStock,jdbcType=INTEGER},
      </if>
      <if test="occupyActivity != null">
        occupy_activity = #{occupyActivity,jdbcType=INTEGER},
      </if>
      <if test="occupyOrderPrivate != null">
        occupy_order_private = #{occupyOrderPrivate,jdbcType=INTEGER},
      </if>
      <if test="occupyOrderShare != null">
        occupy_order_share = #{occupyOrderShare,jdbcType=INTEGER},
      </if>
      <if test="occupyOrder != null">
        occupy_order = #{occupyOrder,jdbcType=INTEGER},
      </if>
      <if test="gmtCreate != null">
        gmt_create = #{gmtCreate,jdbcType=TIMESTAMP},
      </if>
      <if test="gmtModified != null">
        gmt_modified = #{gmtModified,jdbcType=TIMESTAMP},
      </if>
      <if test="createTime != null">
        create_time = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateTime != null">
        update_time = #{updateTime,jdbcType=TIMESTAMP},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.bailuntec.domain.entity.DcBaseStock">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update dc_base_stock
    set bailun_sku = #{bailunSku,jdbcType=VARCHAR},
      warehouse_code = #{warehouseCode,jdbcType=VARCHAR},
      owner_code = #{ownerCode,jdbcType=VARCHAR},
      quantity_reservation = #{quantityReservation,jdbcType=INTEGER},
      quantity_transport = #{quantityTransport,jdbcType=INTEGER},
      quantity_transfer = #{quantityTransfer,jdbcType=INTEGER},
      quantity_freeze = #{quantityFreeze,jdbcType=INTEGER},
      quantity_supplier = #{quantitySupplier,jdbcType=INTEGER},
      quantity_presell = #{quantityPresell,jdbcType=INTEGER},
      quantity_defective = #{quantityDefective,jdbcType=INTEGER},
      quantity_transit = #{quantityTransit,jdbcType=INTEGER},
      wait_check = #{waitCheck,jdbcType=INTEGER},
      wait_putaway = #{waitPutaway,jdbcType=INTEGER},
      usable_stock = #{usableStock,jdbcType=INTEGER},
      usable_sales = #{usableSales,jdbcType=INTEGER},
      usable_sales_private = #{usableSalesPrivate,jdbcType=INTEGER},
      usable_sales_share = #{usableSalesShare,jdbcType=INTEGER},
      in_warehouse_share = #{inWarehouseShare,jdbcType=INTEGER},
      in_warehouse_private = #{inWarehousePrivate,jdbcType=INTEGER},
      in_warehouse = #{inWarehouse,jdbcType=INTEGER},
      occupy_stock_share = #{occupyStockShare,jdbcType=INTEGER},
      occupy_stock_private = #{occupyStockPrivate,jdbcType=INTEGER},
      occupy_stock = #{occupyStock,jdbcType=INTEGER},
      occupy_activity = #{occupyActivity,jdbcType=INTEGER},
      occupy_order_private = #{occupyOrderPrivate,jdbcType=INTEGER},
      occupy_order_share = #{occupyOrderShare,jdbcType=INTEGER},
      occupy_order = #{occupyOrder,jdbcType=INTEGER},
      gmt_create = #{gmtCreate,jdbcType=TIMESTAMP},
      gmt_modified = #{gmtModified,jdbcType=TIMESTAMP},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      update_time = #{updateTime,jdbcType=TIMESTAMP}
    where id = #{id,jdbcType=INTEGER}
  </update>
  <insert id="upsertSelective" parameterType="com.bailuntec.domain.entity.DcBaseStock">
    <!--
      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_stock
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="bailunSku != null">
        bailun_sku,
      </if>
      <if test="warehouseCode != null">
        warehouse_code,
      </if>
      <if test="ownerCode != null">
        owner_code,
      </if>
      <if test="quantityReservation != null">
        quantity_reservation,
      </if>
      <if test="quantityTransport != null">
        quantity_transport,
      </if>
      <if test="quantityTransfer != null">
        quantity_transfer,
      </if>
      <if test="quantityFreeze != null">
        quantity_freeze,
      </if>
      <if test="quantitySupplier != null">
        quantity_supplier,
      </if>
      <if test="quantityPresell != null">
        quantity_presell,
      </if>
      <if test="quantityDefective != null">
        quantity_defective,
      </if>
      <if test="quantityTransit != null">
        quantity_transit,
      </if>
      <if test="waitCheck != null">
        wait_check,
      </if>
      <if test="waitPutaway != null">
        wait_putaway,
      </if>
      <if test="usableStock != null">
        usable_stock,
      </if>
      <if test="usableSales != null">
        usable_sales,
      </if>
      <if test="usableSalesPrivate != null">
        usable_sales_private,
      </if>
      <if test="usableSalesShare != null">
        usable_sales_share,
      </if>
      <if test="inWarehouseShare != null">
        in_warehouse_share,
      </if>
      <if test="inWarehousePrivate != null">
        in_warehouse_private,
      </if>
      <if test="inWarehouse != null">
        in_warehouse,
      </if>
      <if test="occupyStockShare != null">
        occupy_stock_share,
      </if>
      <if test="occupyStockPrivate != null">
        occupy_stock_private,
      </if>
      <if test="occupyStock != null">
        occupy_stock,
      </if>
      <if test="occupyActivity != null">
        occupy_activity,
      </if>
      <if test="occupyOrderPrivate != null">
        occupy_order_private,
      </if>
      <if test="occupyOrderShare != null">
        occupy_order_share,
      </if>
      <if test="occupyOrder != null">
        occupy_order,
      </if>
      <if test="gmtCreate != null">
        gmt_create,
      </if>
      <if test="gmtModified != null">
        gmt_modified,
      </if>
      <if test="createTime != null">
        create_time,
      </if>
      <if test="updateTime != null">
        update_time,
      </if>
    </trim>
    values
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=INTEGER},
      </if>
      <if test="bailunSku != null">
        #{bailunSku,jdbcType=VARCHAR},
      </if>
      <if test="warehouseCode != null">
        #{warehouseCode,jdbcType=VARCHAR},
      </if>
      <if test="ownerCode != null">
        #{ownerCode,jdbcType=VARCHAR},
      </if>
      <if test="quantityReservation != null">
        #{quantityReservation,jdbcType=INTEGER},
      </if>
      <if test="quantityTransport != null">
        #{quantityTransport,jdbcType=INTEGER},
      </if>
      <if test="quantityTransfer != null">
        #{quantityTransfer,jdbcType=INTEGER},
      </if>
      <if test="quantityFreeze != null">
        #{quantityFreeze,jdbcType=INTEGER},
      </if>
      <if test="quantitySupplier != null">
        #{quantitySupplier,jdbcType=INTEGER},
      </if>
      <if test="quantityPresell != null">
        #{quantityPresell,jdbcType=INTEGER},
      </if>
      <if test="quantityDefective != null">
        #{quantityDefective,jdbcType=INTEGER},
      </if>
      <if test="quantityTransit != null">
        #{quantityTransit,jdbcType=INTEGER},
      </if>
      <if test="waitCheck != null">
        #{waitCheck,jdbcType=INTEGER},
      </if>
      <if test="waitPutaway != null">
        #{waitPutaway,jdbcType=INTEGER},
      </if>
      <if test="usableStock != null">
        #{usableStock,jdbcType=INTEGER},
      </if>
      <if test="usableSales != null">
        #{usableSales,jdbcType=INTEGER},
      </if>
      <if test="usableSalesPrivate != null">
        #{usableSalesPrivate,jdbcType=INTEGER},
      </if>
      <if test="usableSalesShare != null">
        #{usableSalesShare,jdbcType=INTEGER},
      </if>
      <if test="inWarehouseShare != null">
        #{inWarehouseShare,jdbcType=INTEGER},
      </if>
      <if test="inWarehousePrivate != null">
        #{inWarehousePrivate,jdbcType=INTEGER},
      </if>
      <if test="inWarehouse != null">
        #{inWarehouse,jdbcType=INTEGER},
      </if>
      <if test="occupyStockShare != null">
        #{occupyStockShare,jdbcType=INTEGER},
      </if>
      <if test="occupyStockPrivate != null">
        #{occupyStockPrivate,jdbcType=INTEGER},
      </if>
      <if test="occupyStock != null">
        #{occupyStock,jdbcType=INTEGER},
      </if>
      <if test="occupyActivity != null">
        #{occupyActivity,jdbcType=INTEGER},
      </if>
      <if test="occupyOrderPrivate != null">
        #{occupyOrderPrivate,jdbcType=INTEGER},
      </if>
      <if test="occupyOrderShare != null">
        #{occupyOrderShare,jdbcType=INTEGER},
      </if>
      <if test="occupyOrder != null">
        #{occupyOrder,jdbcType=INTEGER},
      </if>
      <if test="gmtCreate != null">
        #{gmtCreate,jdbcType=TIMESTAMP},
      </if>
      <if test="gmtModified != null">
        #{gmtModified,jdbcType=TIMESTAMP},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateTime != null">
        #{updateTime,jdbcType=TIMESTAMP},
      </if>
    </trim>
    on duplicate key update 
    <trim suffixOverrides=",">
      <if test="id != null">
        id = #{id,jdbcType=INTEGER},
      </if>
      <if test="bailunSku != null">
        bailun_sku = #{bailunSku,jdbcType=VARCHAR},
      </if>
      <if test="warehouseCode != null">
        warehouse_code = #{warehouseCode,jdbcType=VARCHAR},
      </if>
      <if test="ownerCode != null">
        owner_code = #{ownerCode,jdbcType=VARCHAR},
      </if>
      <if test="quantityReservation != null">
        quantity_reservation = #{quantityReservation,jdbcType=INTEGER},
      </if>
      <if test="quantityTransport != null">
        quantity_transport = #{quantityTransport,jdbcType=INTEGER},
      </if>
      <if test="quantityTransfer != null">
        quantity_transfer = #{quantityTransfer,jdbcType=INTEGER},
      </if>
      <if test="quantityFreeze != null">
        quantity_freeze = #{quantityFreeze,jdbcType=INTEGER},
      </if>
      <if test="quantitySupplier != null">
        quantity_supplier = #{quantitySupplier,jdbcType=INTEGER},
      </if>
      <if test="quantityPresell != null">
        quantity_presell = #{quantityPresell,jdbcType=INTEGER},
      </if>
      <if test="quantityDefective != null">
        quantity_defective = #{quantityDefective,jdbcType=INTEGER},
      </if>
      <if test="quantityTransit != null">
        quantity_transit = #{quantityTransit,jdbcType=INTEGER},
      </if>
      <if test="waitCheck != null">
        wait_check = #{waitCheck,jdbcType=INTEGER},
      </if>
      <if test="waitPutaway != null">
        wait_putaway = #{waitPutaway,jdbcType=INTEGER},
      </if>
      <if test="usableStock != null">
        usable_stock = #{usableStock,jdbcType=INTEGER},
      </if>
      <if test="usableSales != null">
        usable_sales = #{usableSales,jdbcType=INTEGER},
      </if>
      <if test="usableSalesPrivate != null">
        usable_sales_private = #{usableSalesPrivate,jdbcType=INTEGER},
      </if>
      <if test="usableSalesShare != null">
        usable_sales_share = #{usableSalesShare,jdbcType=INTEGER},
      </if>
      <if test="inWarehouseShare != null">
        in_warehouse_share = #{inWarehouseShare,jdbcType=INTEGER},
      </if>
      <if test="inWarehousePrivate != null">
        in_warehouse_private = #{inWarehousePrivate,jdbcType=INTEGER},
      </if>
      <if test="inWarehouse != null">
        in_warehouse = #{inWarehouse,jdbcType=INTEGER},
      </if>
      <if test="occupyStockShare != null">
        occupy_stock_share = #{occupyStockShare,jdbcType=INTEGER},
      </if>
      <if test="occupyStockPrivate != null">
        occupy_stock_private = #{occupyStockPrivate,jdbcType=INTEGER},
      </if>
      <if test="occupyStock != null">
        occupy_stock = #{occupyStock,jdbcType=INTEGER},
      </if>
      <if test="occupyActivity != null">
        occupy_activity = #{occupyActivity,jdbcType=INTEGER},
      </if>
      <if test="occupyOrderPrivate != null">
        occupy_order_private = #{occupyOrderPrivate,jdbcType=INTEGER},
      </if>
      <if test="occupyOrderShare != null">
        occupy_order_share = #{occupyOrderShare,jdbcType=INTEGER},
      </if>
      <if test="occupyOrder != null">
        occupy_order = #{occupyOrder,jdbcType=INTEGER},
      </if>
      <if test="gmtCreate != null">
        gmt_create = #{gmtCreate,jdbcType=TIMESTAMP},
      </if>
      <if test="gmtModified != null">
        gmt_modified = #{gmtModified,jdbcType=TIMESTAMP},
      </if>
      <if test="createTime != null">
        create_time = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateTime != null">
        update_time = #{updateTime,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
  <insert id="upsert" parameterType="com.bailuntec.domain.entity.DcBaseStock">
    <!--
      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_stock
    (id, bailun_sku, warehouse_code, owner_code, quantity_reservation, quantity_transport, 
      quantity_transfer, quantity_freeze, quantity_supplier, quantity_presell, quantity_defective, 
      quantity_transit, wait_check, wait_putaway, usable_stock, usable_sales, usable_sales_private, 
      usable_sales_share, in_warehouse_share, in_warehouse_private, in_warehouse, occupy_stock_share, 
      occupy_stock_private, occupy_stock, occupy_activity, occupy_order_private, occupy_order_share, 
      occupy_order, gmt_create, gmt_modified, create_time, update_time)
    values
    (#{id,jdbcType=INTEGER}, #{bailunSku,jdbcType=VARCHAR}, #{warehouseCode,jdbcType=VARCHAR}, 
      #{ownerCode,jdbcType=VARCHAR}, #{quantityReservation,jdbcType=INTEGER}, #{quantityTransport,jdbcType=INTEGER}, 
      #{quantityTransfer,jdbcType=INTEGER}, #{quantityFreeze,jdbcType=INTEGER}, #{quantitySupplier,jdbcType=INTEGER}, 
      #{quantityPresell,jdbcType=INTEGER}, #{quantityDefective,jdbcType=INTEGER}, #{quantityTransit,jdbcType=INTEGER}, 
      #{waitCheck,jdbcType=INTEGER}, #{waitPutaway,jdbcType=INTEGER}, #{usableStock,jdbcType=INTEGER}, 
      #{usableSales,jdbcType=INTEGER}, #{usableSalesPrivate,jdbcType=INTEGER}, #{usableSalesShare,jdbcType=INTEGER}, 
      #{inWarehouseShare,jdbcType=INTEGER}, #{inWarehousePrivate,jdbcType=INTEGER}, #{inWarehouse,jdbcType=INTEGER}, 
      #{occupyStockShare,jdbcType=INTEGER}, #{occupyStockPrivate,jdbcType=INTEGER}, #{occupyStock,jdbcType=INTEGER}, 
      #{occupyActivity,jdbcType=INTEGER}, #{occupyOrderPrivate,jdbcType=INTEGER}, #{occupyOrderShare,jdbcType=INTEGER}, 
      #{occupyOrder,jdbcType=INTEGER}, #{gmtCreate,jdbcType=TIMESTAMP}, #{gmtModified,jdbcType=TIMESTAMP},
      #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})
    on duplicate key update 
    id = #{id,jdbcType=INTEGER}, 
    bailun_sku = #{bailunSku,jdbcType=VARCHAR}, 
    warehouse_code = #{warehouseCode,jdbcType=VARCHAR}, 
    owner_code = #{ownerCode,jdbcType=VARCHAR}, 
    quantity_reservation = #{quantityReservation,jdbcType=INTEGER}, 
    quantity_transport = #{quantityTransport,jdbcType=INTEGER}, 
    quantity_transfer = #{quantityTransfer,jdbcType=INTEGER}, 
    quantity_freeze = #{quantityFreeze,jdbcType=INTEGER}, 
    quantity_supplier = #{quantitySupplier,jdbcType=INTEGER}, 
    quantity_presell = #{quantityPresell,jdbcType=INTEGER}, 
    quantity_defective = #{quantityDefective,jdbcType=INTEGER}, 
    quantity_transit = #{quantityTransit,jdbcType=INTEGER}, 
    wait_check = #{waitCheck,jdbcType=INTEGER}, 
    wait_putaway = #{waitPutaway,jdbcType=INTEGER}, 
    usable_stock = #{usableStock,jdbcType=INTEGER}, 
    usable_sales = #{usableSales,jdbcType=INTEGER}, 
    usable_sales_private = #{usableSalesPrivate,jdbcType=INTEGER}, 
    usable_sales_share = #{usableSalesShare,jdbcType=INTEGER}, 
    in_warehouse_share = #{inWarehouseShare,jdbcType=INTEGER}, 
    in_warehouse_private = #{inWarehousePrivate,jdbcType=INTEGER}, 
    in_warehouse = #{inWarehouse,jdbcType=INTEGER}, 
    occupy_stock_share = #{occupyStockShare,jdbcType=INTEGER}, 
    occupy_stock_private = #{occupyStockPrivate,jdbcType=INTEGER}, 
    occupy_stock = #{occupyStock,jdbcType=INTEGER}, 
    occupy_activity = #{occupyActivity,jdbcType=INTEGER}, 
    occupy_order_private = #{occupyOrderPrivate,jdbcType=INTEGER}, 
    occupy_order_share = #{occupyOrderShare,jdbcType=INTEGER}, 
    occupy_order = #{occupyOrder,jdbcType=INTEGER}, 
    gmt_create = #{gmtCreate,jdbcType=TIMESTAMP},
    gmt_modified = #{gmtModified,jdbcType=TIMESTAMP},
    create_time = #{createTime,jdbcType=TIMESTAMP},
    update_time = #{updateTime,jdbcType=TIMESTAMP}
  </insert>
  <select id="selectOneByExample" parameterType="com.bailuntec.domain.example.DcBaseStockExample" 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_stock
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
    limit 1
  </select>

  <insert id="insertDailyStock">
    INSERT INTO dc_daily_stock (
            `bailun_sku`,
            `warehouse_code`,
            `owner_code`,
            `quantity_reservation`,
            `quantity_transport`,
            `quantity_transfer`,
            `quantity_freeze`,
            `quantity_supplier`,
            `quantity_presell`,
            `quantity_defective`,
            `quantity_transit`,
            `wait_check`,
            `wait_putaway`,
            `usable_stock`,
            `usable_sales`,
            `usable_sales_private`,
            `usable_sales_share`,
            `in_warehouse_share`,
            `in_warehouse_private`,
            `in_warehouse`,
            `occupy_stock_share`,
            `occupy_stock_private`,
            `occupy_stock`,
            `occupy_activity`,
            `occupy_order_private`,
            `occupy_order_share`,
            `occupy_order`,
            `gmt_create`,
            `gmt_modified`,
            `record_time`,
            `create_time`,
            `update_time`
        ) SELECT
        `bailun_sku`,
        `warehouse_code`,
        `owner_code`,
        `quantity_reservation`,
        `quantity_transport`,
        `quantity_transfer`,
        `quantity_freeze`,
        `quantity_supplier`,
        `quantity_presell`,
        `quantity_defective`,
        `quantity_transit`,
        `wait_check`,
        `wait_putaway`,
        `usable_stock`,
        `usable_sales`,
        `usable_sales_private`,
        `usable_sales_share`,
        `in_warehouse_share`,
        `in_warehouse_private`,
        `in_warehouse`,
        `occupy_stock_share`,
        `occupy_stock_private`,
        `occupy_stock`,
        `occupy_activity`,
        `occupy_order_private`,
        `occupy_order_share`,
        `occupy_order`,
        `gmt_create`,
        `gmt_modified`,
         DATE_SUB( CURDATE( ), INTERVAL 1 DAY ),
        `create_time`,
        `update_time`
        FROM
	    dc_base_stock
  </insert>
</mapper>