<?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.DcSemiOrderMapper">
  <resultMap id="BaseResultMap" type="com.bailuntec.domain.entity.DcSemiOrder">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="order_no" jdbcType="VARCHAR" property="orderNo" />
    <result column="purchase_no" jdbcType="VARCHAR" property="purchaseNo" />
    <result column="source" jdbcType="INTEGER" property="source" />
    <result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
    <result column="create_user_name" jdbcType="VARCHAR" property="createUserName" />
    <result column="deliver_date" jdbcType="TIMESTAMP" property="deliverDate" />
    <result column="sale_user" jdbcType="VARCHAR" property="saleUser" />
    <result column="purchase_user" jdbcType="VARCHAR" property="purchaseUser" />
    <result column="type" jdbcType="INTEGER" property="type" />
    <result column="company_id" jdbcType="INTEGER" property="companyId" />
    <result column="state" jdbcType="INTEGER" property="state" />
    <result column="delivery_state" jdbcType="INTEGER" property="deliveryState" />
    <result column="total" jdbcType="INTEGER" property="total" />
    <result column="init_deliver_date" jdbcType="TIMESTAMP" property="initDeliverDate" />
    <result column="order_type" jdbcType="INTEGER" property="orderType" />
    <result column="delivery_remarks" jdbcType="VARCHAR" property="deliveryRemarks" />
    <result column="packRemarks" jdbcType="VARCHAR" property="packremarks" />
    <result column="pay_type" jdbcType="INTEGER" property="payType" />
    <result column="original_quantity" jdbcType="INTEGER" property="originalQuantity" />
    <result column="toal_cost_record" jdbcType="DECIMAL" property="toalCostRecord" />
    <result column="toal_price_record" jdbcType="DECIMAL" property="toalPriceRecord" />
    <result column="warehouse_id" jdbcType="INTEGER" property="warehouseId" />
    <result column="last_update_date" jdbcType="TIMESTAMP" property="lastUpdateDate" />
    <result column="sku_quantity" jdbcType="DECIMAL" property="skuQuantity" />
    <result column="sku_unit_cost" jdbcType="DECIMAL" property="skuUnitCost" />
    <result column="sku_unit_price" jdbcType="DECIMAL" property="skuUnitPrice" />
    <result column="sku" jdbcType="VARCHAR" property="sku" />
    <result column="warehouse_name" jdbcType="VARCHAR" property="warehouseName" />
    <result column="semi_order_id" jdbcType="INTEGER" property="semiOrderId" />
  </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, order_no, purchase_no, source, create_date, create_user_name, deliver_date, sale_user, 
    purchase_user, type, company_id, state, delivery_state, total, init_deliver_date, 
    order_type, delivery_remarks, packRemarks, pay_type, original_quantity, toal_cost_record, 
    toal_price_record, warehouse_id, last_update_date, sku_quantity, sku_unit_cost, sku_unit_price, 
    sku, warehouse_name, semi_order_id
  </sql>
  <select id="selectByExample" parameterType="com.bailuntec.domain.example.DcSemiOrderExample" 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_semi_order
    <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_semi_order
    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_semi_order
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <delete id="deleteByExample" parameterType="com.bailuntec.domain.example.DcSemiOrderExample">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    delete from dc_semi_order
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.bailuntec.domain.entity.DcSemiOrder">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into dc_semi_order (id, order_no, purchase_no, 
      source, create_date, create_user_name, 
      deliver_date, sale_user, purchase_user, 
      type, company_id, state, 
      delivery_state, total, init_deliver_date, 
      order_type, delivery_remarks, packRemarks, 
      pay_type, original_quantity, toal_cost_record, 
      toal_price_record, warehouse_id, last_update_date, 
      sku_quantity, sku_unit_cost, sku_unit_price, 
      sku, warehouse_name, semi_order_id
      )
    values (#{id,jdbcType=INTEGER}, #{orderNo,jdbcType=VARCHAR}, #{purchaseNo,jdbcType=VARCHAR}, 
      #{source,jdbcType=INTEGER}, #{createDate,jdbcType=TIMESTAMP}, #{createUserName,jdbcType=VARCHAR}, 
      #{deliverDate,jdbcType=TIMESTAMP}, #{saleUser,jdbcType=VARCHAR}, #{purchaseUser,jdbcType=VARCHAR}, 
      #{type,jdbcType=INTEGER}, #{companyId,jdbcType=INTEGER}, #{state,jdbcType=INTEGER}, 
      #{deliveryState,jdbcType=INTEGER}, #{total,jdbcType=INTEGER}, #{initDeliverDate,jdbcType=TIMESTAMP}, 
      #{orderType,jdbcType=INTEGER}, #{deliveryRemarks,jdbcType=VARCHAR}, #{packremarks,jdbcType=VARCHAR}, 
      #{payType,jdbcType=INTEGER}, #{originalQuantity,jdbcType=INTEGER}, #{toalCostRecord,jdbcType=DECIMAL}, 
      #{toalPriceRecord,jdbcType=DECIMAL}, #{warehouseId,jdbcType=INTEGER}, #{lastUpdateDate,jdbcType=TIMESTAMP}, 
      #{skuQuantity,jdbcType=DECIMAL}, #{skuUnitCost,jdbcType=DECIMAL}, #{skuUnitPrice,jdbcType=DECIMAL}, 
      #{sku,jdbcType=VARCHAR}, #{warehouseName,jdbcType=VARCHAR}, #{semiOrderId,jdbcType=INTEGER}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.bailuntec.domain.entity.DcSemiOrder">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into dc_semi_order
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="orderNo != null">
        order_no,
      </if>
      <if test="purchaseNo != null">
        purchase_no,
      </if>
      <if test="source != null">
        source,
      </if>
      <if test="createDate != null">
        create_date,
      </if>
      <if test="createUserName != null">
        create_user_name,
      </if>
      <if test="deliverDate != null">
        deliver_date,
      </if>
      <if test="saleUser != null">
        sale_user,
      </if>
      <if test="purchaseUser != null">
        purchase_user,
      </if>
      <if test="type != null">
        type,
      </if>
      <if test="companyId != null">
        company_id,
      </if>
      <if test="state != null">
        state,
      </if>
      <if test="deliveryState != null">
        delivery_state,
      </if>
      <if test="total != null">
        total,
      </if>
      <if test="initDeliverDate != null">
        init_deliver_date,
      </if>
      <if test="orderType != null">
        order_type,
      </if>
      <if test="deliveryRemarks != null">
        delivery_remarks,
      </if>
      <if test="packremarks != null">
        packRemarks,
      </if>
      <if test="payType != null">
        pay_type,
      </if>
      <if test="originalQuantity != null">
        original_quantity,
      </if>
      <if test="toalCostRecord != null">
        toal_cost_record,
      </if>
      <if test="toalPriceRecord != null">
        toal_price_record,
      </if>
      <if test="warehouseId != null">
        warehouse_id,
      </if>
      <if test="lastUpdateDate != null">
        last_update_date,
      </if>
      <if test="skuQuantity != null">
        sku_quantity,
      </if>
      <if test="skuUnitCost != null">
        sku_unit_cost,
      </if>
      <if test="skuUnitPrice != null">
        sku_unit_price,
      </if>
      <if test="sku != null">
        sku,
      </if>
      <if test="warehouseName != null">
        warehouse_name,
      </if>
      <if test="semiOrderId != null">
        semi_order_id,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=INTEGER},
      </if>
      <if test="orderNo != null">
        #{orderNo,jdbcType=VARCHAR},
      </if>
      <if test="purchaseNo != null">
        #{purchaseNo,jdbcType=VARCHAR},
      </if>
      <if test="source != null">
        #{source,jdbcType=INTEGER},
      </if>
      <if test="createDate != null">
        #{createDate,jdbcType=TIMESTAMP},
      </if>
      <if test="createUserName != null">
        #{createUserName,jdbcType=VARCHAR},
      </if>
      <if test="deliverDate != null">
        #{deliverDate,jdbcType=TIMESTAMP},
      </if>
      <if test="saleUser != null">
        #{saleUser,jdbcType=VARCHAR},
      </if>
      <if test="purchaseUser != null">
        #{purchaseUser,jdbcType=VARCHAR},
      </if>
      <if test="type != null">
        #{type,jdbcType=INTEGER},
      </if>
      <if test="companyId != null">
        #{companyId,jdbcType=INTEGER},
      </if>
      <if test="state != null">
        #{state,jdbcType=INTEGER},
      </if>
      <if test="deliveryState != null">
        #{deliveryState,jdbcType=INTEGER},
      </if>
      <if test="total != null">
        #{total,jdbcType=INTEGER},
      </if>
      <if test="initDeliverDate != null">
        #{initDeliverDate,jdbcType=TIMESTAMP},
      </if>
      <if test="orderType != null">
        #{orderType,jdbcType=INTEGER},
      </if>
      <if test="deliveryRemarks != null">
        #{deliveryRemarks,jdbcType=VARCHAR},
      </if>
      <if test="packremarks != null">
        #{packremarks,jdbcType=VARCHAR},
      </if>
      <if test="payType != null">
        #{payType,jdbcType=INTEGER},
      </if>
      <if test="originalQuantity != null">
        #{originalQuantity,jdbcType=INTEGER},
      </if>
      <if test="toalCostRecord != null">
        #{toalCostRecord,jdbcType=DECIMAL},
      </if>
      <if test="toalPriceRecord != null">
        #{toalPriceRecord,jdbcType=DECIMAL},
      </if>
      <if test="warehouseId != null">
        #{warehouseId,jdbcType=INTEGER},
      </if>
      <if test="lastUpdateDate != null">
        #{lastUpdateDate,jdbcType=TIMESTAMP},
      </if>
      <if test="skuQuantity != null">
        #{skuQuantity,jdbcType=DECIMAL},
      </if>
      <if test="skuUnitCost != null">
        #{skuUnitCost,jdbcType=DECIMAL},
      </if>
      <if test="skuUnitPrice != null">
        #{skuUnitPrice,jdbcType=DECIMAL},
      </if>
      <if test="sku != null">
        #{sku,jdbcType=VARCHAR},
      </if>
      <if test="warehouseName != null">
        #{warehouseName,jdbcType=VARCHAR},
      </if>
      <if test="semiOrderId != null">
        #{semiOrderId,jdbcType=INTEGER},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.bailuntec.domain.example.DcSemiOrderExample" resultType="java.lang.Long">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select count(*) from dc_semi_order
    <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_semi_order
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=INTEGER},
      </if>
      <if test="record.orderNo != null">
        order_no = #{record.orderNo,jdbcType=VARCHAR},
      </if>
      <if test="record.purchaseNo != null">
        purchase_no = #{record.purchaseNo,jdbcType=VARCHAR},
      </if>
      <if test="record.source != null">
        source = #{record.source,jdbcType=INTEGER},
      </if>
      <if test="record.createDate != null">
        create_date = #{record.createDate,jdbcType=TIMESTAMP},
      </if>
      <if test="record.createUserName != null">
        create_user_name = #{record.createUserName,jdbcType=VARCHAR},
      </if>
      <if test="record.deliverDate != null">
        deliver_date = #{record.deliverDate,jdbcType=TIMESTAMP},
      </if>
      <if test="record.saleUser != null">
        sale_user = #{record.saleUser,jdbcType=VARCHAR},
      </if>
      <if test="record.purchaseUser != null">
        purchase_user = #{record.purchaseUser,jdbcType=VARCHAR},
      </if>
      <if test="record.type != null">
        type = #{record.type,jdbcType=INTEGER},
      </if>
      <if test="record.companyId != null">
        company_id = #{record.companyId,jdbcType=INTEGER},
      </if>
      <if test="record.state != null">
        state = #{record.state,jdbcType=INTEGER},
      </if>
      <if test="record.deliveryState != null">
        delivery_state = #{record.deliveryState,jdbcType=INTEGER},
      </if>
      <if test="record.total != null">
        total = #{record.total,jdbcType=INTEGER},
      </if>
      <if test="record.initDeliverDate != null">
        init_deliver_date = #{record.initDeliverDate,jdbcType=TIMESTAMP},
      </if>
      <if test="record.orderType != null">
        order_type = #{record.orderType,jdbcType=INTEGER},
      </if>
      <if test="record.deliveryRemarks != null">
        delivery_remarks = #{record.deliveryRemarks,jdbcType=VARCHAR},
      </if>
      <if test="record.packremarks != null">
        packRemarks = #{record.packremarks,jdbcType=VARCHAR},
      </if>
      <if test="record.payType != null">
        pay_type = #{record.payType,jdbcType=INTEGER},
      </if>
      <if test="record.originalQuantity != null">
        original_quantity = #{record.originalQuantity,jdbcType=INTEGER},
      </if>
      <if test="record.toalCostRecord != null">
        toal_cost_record = #{record.toalCostRecord,jdbcType=DECIMAL},
      </if>
      <if test="record.toalPriceRecord != null">
        toal_price_record = #{record.toalPriceRecord,jdbcType=DECIMAL},
      </if>
      <if test="record.warehouseId != null">
        warehouse_id = #{record.warehouseId,jdbcType=INTEGER},
      </if>
      <if test="record.lastUpdateDate != null">
        last_update_date = #{record.lastUpdateDate,jdbcType=TIMESTAMP},
      </if>
      <if test="record.skuQuantity != null">
        sku_quantity = #{record.skuQuantity,jdbcType=DECIMAL},
      </if>
      <if test="record.skuUnitCost != null">
        sku_unit_cost = #{record.skuUnitCost,jdbcType=DECIMAL},
      </if>
      <if test="record.skuUnitPrice != null">
        sku_unit_price = #{record.skuUnitPrice,jdbcType=DECIMAL},
      </if>
      <if test="record.sku != null">
        sku = #{record.sku,jdbcType=VARCHAR},
      </if>
      <if test="record.warehouseName != null">
        warehouse_name = #{record.warehouseName,jdbcType=VARCHAR},
      </if>
      <if test="record.semiOrderId != null">
        semi_order_id = #{record.semiOrderId,jdbcType=INTEGER},
      </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_semi_order
    set id = #{record.id,jdbcType=INTEGER},
      order_no = #{record.orderNo,jdbcType=VARCHAR},
      purchase_no = #{record.purchaseNo,jdbcType=VARCHAR},
      source = #{record.source,jdbcType=INTEGER},
      create_date = #{record.createDate,jdbcType=TIMESTAMP},
      create_user_name = #{record.createUserName,jdbcType=VARCHAR},
      deliver_date = #{record.deliverDate,jdbcType=TIMESTAMP},
      sale_user = #{record.saleUser,jdbcType=VARCHAR},
      purchase_user = #{record.purchaseUser,jdbcType=VARCHAR},
      type = #{record.type,jdbcType=INTEGER},
      company_id = #{record.companyId,jdbcType=INTEGER},
      state = #{record.state,jdbcType=INTEGER},
      delivery_state = #{record.deliveryState,jdbcType=INTEGER},
      total = #{record.total,jdbcType=INTEGER},
      init_deliver_date = #{record.initDeliverDate,jdbcType=TIMESTAMP},
      order_type = #{record.orderType,jdbcType=INTEGER},
      delivery_remarks = #{record.deliveryRemarks,jdbcType=VARCHAR},
      packRemarks = #{record.packremarks,jdbcType=VARCHAR},
      pay_type = #{record.payType,jdbcType=INTEGER},
      original_quantity = #{record.originalQuantity,jdbcType=INTEGER},
      toal_cost_record = #{record.toalCostRecord,jdbcType=DECIMAL},
      toal_price_record = #{record.toalPriceRecord,jdbcType=DECIMAL},
      warehouse_id = #{record.warehouseId,jdbcType=INTEGER},
      last_update_date = #{record.lastUpdateDate,jdbcType=TIMESTAMP},
      sku_quantity = #{record.skuQuantity,jdbcType=DECIMAL},
      sku_unit_cost = #{record.skuUnitCost,jdbcType=DECIMAL},
      sku_unit_price = #{record.skuUnitPrice,jdbcType=DECIMAL},
      sku = #{record.sku,jdbcType=VARCHAR},
      warehouse_name = #{record.warehouseName,jdbcType=VARCHAR},
      semi_order_id = #{record.semiOrderId,jdbcType=INTEGER}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.bailuntec.domain.entity.DcSemiOrder">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update dc_semi_order
    <set>
      <if test="orderNo != null">
        order_no = #{orderNo,jdbcType=VARCHAR},
      </if>
      <if test="purchaseNo != null">
        purchase_no = #{purchaseNo,jdbcType=VARCHAR},
      </if>
      <if test="source != null">
        source = #{source,jdbcType=INTEGER},
      </if>
      <if test="createDate != null">
        create_date = #{createDate,jdbcType=TIMESTAMP},
      </if>
      <if test="createUserName != null">
        create_user_name = #{createUserName,jdbcType=VARCHAR},
      </if>
      <if test="deliverDate != null">
        deliver_date = #{deliverDate,jdbcType=TIMESTAMP},
      </if>
      <if test="saleUser != null">
        sale_user = #{saleUser,jdbcType=VARCHAR},
      </if>
      <if test="purchaseUser != null">
        purchase_user = #{purchaseUser,jdbcType=VARCHAR},
      </if>
      <if test="type != null">
        type = #{type,jdbcType=INTEGER},
      </if>
      <if test="companyId != null">
        company_id = #{companyId,jdbcType=INTEGER},
      </if>
      <if test="state != null">
        state = #{state,jdbcType=INTEGER},
      </if>
      <if test="deliveryState != null">
        delivery_state = #{deliveryState,jdbcType=INTEGER},
      </if>
      <if test="total != null">
        total = #{total,jdbcType=INTEGER},
      </if>
      <if test="initDeliverDate != null">
        init_deliver_date = #{initDeliverDate,jdbcType=TIMESTAMP},
      </if>
      <if test="orderType != null">
        order_type = #{orderType,jdbcType=INTEGER},
      </if>
      <if test="deliveryRemarks != null">
        delivery_remarks = #{deliveryRemarks,jdbcType=VARCHAR},
      </if>
      <if test="packremarks != null">
        packRemarks = #{packremarks,jdbcType=VARCHAR},
      </if>
      <if test="payType != null">
        pay_type = #{payType,jdbcType=INTEGER},
      </if>
      <if test="originalQuantity != null">
        original_quantity = #{originalQuantity,jdbcType=INTEGER},
      </if>
      <if test="toalCostRecord != null">
        toal_cost_record = #{toalCostRecord,jdbcType=DECIMAL},
      </if>
      <if test="toalPriceRecord != null">
        toal_price_record = #{toalPriceRecord,jdbcType=DECIMAL},
      </if>
      <if test="warehouseId != null">
        warehouse_id = #{warehouseId,jdbcType=INTEGER},
      </if>
      <if test="lastUpdateDate != null">
        last_update_date = #{lastUpdateDate,jdbcType=TIMESTAMP},
      </if>
      <if test="skuQuantity != null">
        sku_quantity = #{skuQuantity,jdbcType=DECIMAL},
      </if>
      <if test="skuUnitCost != null">
        sku_unit_cost = #{skuUnitCost,jdbcType=DECIMAL},
      </if>
      <if test="skuUnitPrice != null">
        sku_unit_price = #{skuUnitPrice,jdbcType=DECIMAL},
      </if>
      <if test="sku != null">
        sku = #{sku,jdbcType=VARCHAR},
      </if>
      <if test="warehouseName != null">
        warehouse_name = #{warehouseName,jdbcType=VARCHAR},
      </if>
      <if test="semiOrderId != null">
        semi_order_id = #{semiOrderId,jdbcType=INTEGER},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.bailuntec.domain.entity.DcSemiOrder">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update dc_semi_order
    set order_no = #{orderNo,jdbcType=VARCHAR},
      purchase_no = #{purchaseNo,jdbcType=VARCHAR},
      source = #{source,jdbcType=INTEGER},
      create_date = #{createDate,jdbcType=TIMESTAMP},
      create_user_name = #{createUserName,jdbcType=VARCHAR},
      deliver_date = #{deliverDate,jdbcType=TIMESTAMP},
      sale_user = #{saleUser,jdbcType=VARCHAR},
      purchase_user = #{purchaseUser,jdbcType=VARCHAR},
      type = #{type,jdbcType=INTEGER},
      company_id = #{companyId,jdbcType=INTEGER},
      state = #{state,jdbcType=INTEGER},
      delivery_state = #{deliveryState,jdbcType=INTEGER},
      total = #{total,jdbcType=INTEGER},
      init_deliver_date = #{initDeliverDate,jdbcType=TIMESTAMP},
      order_type = #{orderType,jdbcType=INTEGER},
      delivery_remarks = #{deliveryRemarks,jdbcType=VARCHAR},
      packRemarks = #{packremarks,jdbcType=VARCHAR},
      pay_type = #{payType,jdbcType=INTEGER},
      original_quantity = #{originalQuantity,jdbcType=INTEGER},
      toal_cost_record = #{toalCostRecord,jdbcType=DECIMAL},
      toal_price_record = #{toalPriceRecord,jdbcType=DECIMAL},
      warehouse_id = #{warehouseId,jdbcType=INTEGER},
      last_update_date = #{lastUpdateDate,jdbcType=TIMESTAMP},
      sku_quantity = #{skuQuantity,jdbcType=DECIMAL},
      sku_unit_cost = #{skuUnitCost,jdbcType=DECIMAL},
      sku_unit_price = #{skuUnitPrice,jdbcType=DECIMAL},
      sku = #{sku,jdbcType=VARCHAR},
      warehouse_name = #{warehouseName,jdbcType=VARCHAR},
      semi_order_id = #{semiOrderId,jdbcType=INTEGER}
    where id = #{id,jdbcType=INTEGER}
  </update>
  <insert id="upsertSelective" parameterType="com.bailuntec.domain.entity.DcSemiOrder">
    <!--
      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_semi_order
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="orderNo != null">
        order_no,
      </if>
      <if test="purchaseNo != null">
        purchase_no,
      </if>
      <if test="source != null">
        source,
      </if>
      <if test="createDate != null">
        create_date,
      </if>
      <if test="createUserName != null">
        create_user_name,
      </if>
      <if test="deliverDate != null">
        deliver_date,
      </if>
      <if test="saleUser != null">
        sale_user,
      </if>
      <if test="purchaseUser != null">
        purchase_user,
      </if>
      <if test="type != null">
        type,
      </if>
      <if test="companyId != null">
        company_id,
      </if>
      <if test="state != null">
        state,
      </if>
      <if test="deliveryState != null">
        delivery_state,
      </if>
      <if test="total != null">
        total,
      </if>
      <if test="initDeliverDate != null">
        init_deliver_date,
      </if>
      <if test="orderType != null">
        order_type,
      </if>
      <if test="deliveryRemarks != null">
        delivery_remarks,
      </if>
      <if test="packremarks != null">
        packRemarks,
      </if>
      <if test="payType != null">
        pay_type,
      </if>
      <if test="originalQuantity != null">
        original_quantity,
      </if>
      <if test="toalCostRecord != null">
        toal_cost_record,
      </if>
      <if test="toalPriceRecord != null">
        toal_price_record,
      </if>
      <if test="warehouseId != null">
        warehouse_id,
      </if>
      <if test="lastUpdateDate != null">
        last_update_date,
      </if>
      <if test="skuQuantity != null">
        sku_quantity,
      </if>
      <if test="skuUnitCost != null">
        sku_unit_cost,
      </if>
      <if test="skuUnitPrice != null">
        sku_unit_price,
      </if>
      <if test="sku != null">
        sku,
      </if>
      <if test="warehouseName != null">
        warehouse_name,
      </if>
      <if test="semiOrderId != null">
        semi_order_id,
      </if>
    </trim>
    values
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=INTEGER},
      </if>
      <if test="orderNo != null">
        #{orderNo,jdbcType=VARCHAR},
      </if>
      <if test="purchaseNo != null">
        #{purchaseNo,jdbcType=VARCHAR},
      </if>
      <if test="source != null">
        #{source,jdbcType=INTEGER},
      </if>
      <if test="createDate != null">
        #{createDate,jdbcType=TIMESTAMP},
      </if>
      <if test="createUserName != null">
        #{createUserName,jdbcType=VARCHAR},
      </if>
      <if test="deliverDate != null">
        #{deliverDate,jdbcType=TIMESTAMP},
      </if>
      <if test="saleUser != null">
        #{saleUser,jdbcType=VARCHAR},
      </if>
      <if test="purchaseUser != null">
        #{purchaseUser,jdbcType=VARCHAR},
      </if>
      <if test="type != null">
        #{type,jdbcType=INTEGER},
      </if>
      <if test="companyId != null">
        #{companyId,jdbcType=INTEGER},
      </if>
      <if test="state != null">
        #{state,jdbcType=INTEGER},
      </if>
      <if test="deliveryState != null">
        #{deliveryState,jdbcType=INTEGER},
      </if>
      <if test="total != null">
        #{total,jdbcType=INTEGER},
      </if>
      <if test="initDeliverDate != null">
        #{initDeliverDate,jdbcType=TIMESTAMP},
      </if>
      <if test="orderType != null">
        #{orderType,jdbcType=INTEGER},
      </if>
      <if test="deliveryRemarks != null">
        #{deliveryRemarks,jdbcType=VARCHAR},
      </if>
      <if test="packremarks != null">
        #{packremarks,jdbcType=VARCHAR},
      </if>
      <if test="payType != null">
        #{payType,jdbcType=INTEGER},
      </if>
      <if test="originalQuantity != null">
        #{originalQuantity,jdbcType=INTEGER},
      </if>
      <if test="toalCostRecord != null">
        #{toalCostRecord,jdbcType=DECIMAL},
      </if>
      <if test="toalPriceRecord != null">
        #{toalPriceRecord,jdbcType=DECIMAL},
      </if>
      <if test="warehouseId != null">
        #{warehouseId,jdbcType=INTEGER},
      </if>
      <if test="lastUpdateDate != null">
        #{lastUpdateDate,jdbcType=TIMESTAMP},
      </if>
      <if test="skuQuantity != null">
        #{skuQuantity,jdbcType=DECIMAL},
      </if>
      <if test="skuUnitCost != null">
        #{skuUnitCost,jdbcType=DECIMAL},
      </if>
      <if test="skuUnitPrice != null">
        #{skuUnitPrice,jdbcType=DECIMAL},
      </if>
      <if test="sku != null">
        #{sku,jdbcType=VARCHAR},
      </if>
      <if test="warehouseName != null">
        #{warehouseName,jdbcType=VARCHAR},
      </if>
      <if test="semiOrderId != null">
        #{semiOrderId,jdbcType=INTEGER},
      </if>
    </trim>
    on duplicate key update 
    <trim suffixOverrides=",">
      <if test="id != null">
        id = #{id,jdbcType=INTEGER},
      </if>
      <if test="orderNo != null">
        order_no = #{orderNo,jdbcType=VARCHAR},
      </if>
      <if test="purchaseNo != null">
        purchase_no = #{purchaseNo,jdbcType=VARCHAR},
      </if>
      <if test="source != null">
        source = #{source,jdbcType=INTEGER},
      </if>
      <if test="createDate != null">
        create_date = #{createDate,jdbcType=TIMESTAMP},
      </if>
      <if test="createUserName != null">
        create_user_name = #{createUserName,jdbcType=VARCHAR},
      </if>
      <if test="deliverDate != null">
        deliver_date = #{deliverDate,jdbcType=TIMESTAMP},
      </if>
      <if test="saleUser != null">
        sale_user = #{saleUser,jdbcType=VARCHAR},
      </if>
      <if test="purchaseUser != null">
        purchase_user = #{purchaseUser,jdbcType=VARCHAR},
      </if>
      <if test="type != null">
        type = #{type,jdbcType=INTEGER},
      </if>
      <if test="companyId != null">
        company_id = #{companyId,jdbcType=INTEGER},
      </if>
      <if test="state != null">
        state = #{state,jdbcType=INTEGER},
      </if>
      <if test="deliveryState != null">
        delivery_state = #{deliveryState,jdbcType=INTEGER},
      </if>
      <if test="total != null">
        total = #{total,jdbcType=INTEGER},
      </if>
      <if test="initDeliverDate != null">
        init_deliver_date = #{initDeliverDate,jdbcType=TIMESTAMP},
      </if>
      <if test="orderType != null">
        order_type = #{orderType,jdbcType=INTEGER},
      </if>
      <if test="deliveryRemarks != null">
        delivery_remarks = #{deliveryRemarks,jdbcType=VARCHAR},
      </if>
      <if test="packremarks != null">
        packRemarks = #{packremarks,jdbcType=VARCHAR},
      </if>
      <if test="payType != null">
        pay_type = #{payType,jdbcType=INTEGER},
      </if>
      <if test="originalQuantity != null">
        original_quantity = #{originalQuantity,jdbcType=INTEGER},
      </if>
      <if test="toalCostRecord != null">
        toal_cost_record = #{toalCostRecord,jdbcType=DECIMAL},
      </if>
      <if test="toalPriceRecord != null">
        toal_price_record = #{toalPriceRecord,jdbcType=DECIMAL},
      </if>
      <if test="warehouseId != null">
        warehouse_id = #{warehouseId,jdbcType=INTEGER},
      </if>
      <if test="lastUpdateDate != null">
        last_update_date = #{lastUpdateDate,jdbcType=TIMESTAMP},
      </if>
      <if test="skuQuantity != null">
        sku_quantity = #{skuQuantity,jdbcType=DECIMAL},
      </if>
      <if test="skuUnitCost != null">
        sku_unit_cost = #{skuUnitCost,jdbcType=DECIMAL},
      </if>
      <if test="skuUnitPrice != null">
        sku_unit_price = #{skuUnitPrice,jdbcType=DECIMAL},
      </if>
      <if test="sku != null">
        sku = #{sku,jdbcType=VARCHAR},
      </if>
      <if test="warehouseName != null">
        warehouse_name = #{warehouseName,jdbcType=VARCHAR},
      </if>
      <if test="semiOrderId != null">
        semi_order_id = #{semiOrderId,jdbcType=INTEGER},
      </if>
    </trim>
  </insert>
  <insert id="upsert" parameterType="com.bailuntec.domain.entity.DcSemiOrder">
    <!--
      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_semi_order
    (id, order_no, purchase_no, source, create_date, create_user_name, deliver_date, 
      sale_user, purchase_user, type, company_id, state, delivery_state, total, init_deliver_date, 
      order_type, delivery_remarks, packRemarks, pay_type, original_quantity, toal_cost_record, 
      toal_price_record, warehouse_id, last_update_date, sku_quantity, sku_unit_cost, 
      sku_unit_price, sku, warehouse_name, semi_order_id)
    values
    (#{id,jdbcType=INTEGER}, #{orderNo,jdbcType=VARCHAR}, #{purchaseNo,jdbcType=VARCHAR}, 
      #{source,jdbcType=INTEGER}, #{createDate,jdbcType=TIMESTAMP}, #{createUserName,jdbcType=VARCHAR}, 
      #{deliverDate,jdbcType=TIMESTAMP}, #{saleUser,jdbcType=VARCHAR}, #{purchaseUser,jdbcType=VARCHAR}, 
      #{type,jdbcType=INTEGER}, #{companyId,jdbcType=INTEGER}, #{state,jdbcType=INTEGER}, 
      #{deliveryState,jdbcType=INTEGER}, #{total,jdbcType=INTEGER}, #{initDeliverDate,jdbcType=TIMESTAMP}, 
      #{orderType,jdbcType=INTEGER}, #{deliveryRemarks,jdbcType=VARCHAR}, #{packremarks,jdbcType=VARCHAR}, 
      #{payType,jdbcType=INTEGER}, #{originalQuantity,jdbcType=INTEGER}, #{toalCostRecord,jdbcType=DECIMAL}, 
      #{toalPriceRecord,jdbcType=DECIMAL}, #{warehouseId,jdbcType=INTEGER}, #{lastUpdateDate,jdbcType=TIMESTAMP}, 
      #{skuQuantity,jdbcType=DECIMAL}, #{skuUnitCost,jdbcType=DECIMAL}, #{skuUnitPrice,jdbcType=DECIMAL}, 
      #{sku,jdbcType=VARCHAR}, #{warehouseName,jdbcType=VARCHAR}, #{semiOrderId,jdbcType=INTEGER}
      )
    on duplicate key update 
    id = #{id,jdbcType=INTEGER}, 
    order_no = #{orderNo,jdbcType=VARCHAR}, 
    purchase_no = #{purchaseNo,jdbcType=VARCHAR}, 
    source = #{source,jdbcType=INTEGER}, 
    create_date = #{createDate,jdbcType=TIMESTAMP}, 
    create_user_name = #{createUserName,jdbcType=VARCHAR}, 
    deliver_date = #{deliverDate,jdbcType=TIMESTAMP}, 
    sale_user = #{saleUser,jdbcType=VARCHAR}, 
    purchase_user = #{purchaseUser,jdbcType=VARCHAR}, 
    type = #{type,jdbcType=INTEGER}, 
    company_id = #{companyId,jdbcType=INTEGER}, 
    state = #{state,jdbcType=INTEGER}, 
    delivery_state = #{deliveryState,jdbcType=INTEGER}, 
    total = #{total,jdbcType=INTEGER}, 
    init_deliver_date = #{initDeliverDate,jdbcType=TIMESTAMP}, 
    order_type = #{orderType,jdbcType=INTEGER}, 
    delivery_remarks = #{deliveryRemarks,jdbcType=VARCHAR}, 
    packRemarks = #{packremarks,jdbcType=VARCHAR}, 
    pay_type = #{payType,jdbcType=INTEGER}, 
    original_quantity = #{originalQuantity,jdbcType=INTEGER}, 
    toal_cost_record = #{toalCostRecord,jdbcType=DECIMAL}, 
    toal_price_record = #{toalPriceRecord,jdbcType=DECIMAL}, 
    warehouse_id = #{warehouseId,jdbcType=INTEGER}, 
    last_update_date = #{lastUpdateDate,jdbcType=TIMESTAMP}, 
    sku_quantity = #{skuQuantity,jdbcType=DECIMAL}, 
    sku_unit_cost = #{skuUnitCost,jdbcType=DECIMAL}, 
    sku_unit_price = #{skuUnitPrice,jdbcType=DECIMAL}, 
    sku = #{sku,jdbcType=VARCHAR}, 
    warehouse_name = #{warehouseName,jdbcType=VARCHAR}, 
    semi_order_id = #{semiOrderId,jdbcType=INTEGER}
  </insert>
  <select id="selectOneByExample" parameterType="com.bailuntec.domain.example.DcSemiOrderExample" 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_semi_order
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
    limit 1
  </select>
</mapper>