<?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="cn.superdesk.uniorder.dao.mapper.thirdpart.qchjc.accounting.QchjcOrderEntityMapper">
  <resultMap id="BaseResultMap" type="cn.superdesk.uniorder.dao.entity.thirdpart.qchjc.accounting.QchjcOrderEntity">
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="unified_id" jdbcType="BIGINT" property="unifiedId" />
    <result column="accounting_order_sn" jdbcType="VARCHAR" property="accountingOrderSn" />
    <result column="customer_accounting_order_sn" jdbcType="VARCHAR" property="customerAccountingOrderSn" />
    <result column="supplier_accounting_order_sn" jdbcType="VARCHAR" property="supplierAccountingOrderSn" />
    <result column="order_sn" jdbcType="VARCHAR" property="orderSn" />
    <result column="order_sn_out_trade" jdbcType="VARCHAR" property="orderSnOutTrade" />
    <result column="out_snapshot_order_id" jdbcType="VARCHAR" property="outSnapshotOrderId" />
    <result column="service_name" jdbcType="VARCHAR" property="serviceName" />
    <result column="service_no" jdbcType="VARCHAR" property="serviceNo" />
    <result column="project_id" jdbcType="BIGINT" property="projectId" />
    <result column="project_name" jdbcType="VARCHAR" property="projectName" />
    <result column="purchase_virt_id" jdbcType="VARCHAR" property="purchaseVirtId" />
    <result column="purchase_virt_name" jdbcType="VARCHAR" property="purchaseVirtName" />
    <result column="purchase_department_name" jdbcType="VARCHAR" property="purchaseDepartmentName" />
    <result column="purchase_user_id" jdbcType="VARCHAR" property="purchaseUserId" />
    <result column="purchase_user_name" jdbcType="VARCHAR" property="purchaseUserName" />
    <result column="purchase_phone" jdbcType="VARCHAR" property="purchasePhone" />
    <result column="sale_id" jdbcType="VARCHAR" property="saleId" />
    <result column="sale_name" jdbcType="VARCHAR" property="saleName" />
    <result column="amount" jdbcType="DECIMAL" property="amount" />
    <result column="cost_amount" jdbcType="DECIMAL" property="costAmount" />
    <result column="transport_amount" jdbcType="DECIMAL" property="transportAmount" />
    <result column="transport_merchant_assume_amount" jdbcType="DECIMAL" property="transportMerchantAssumeAmount" />
    <result column="goods_amount" jdbcType="DECIMAL" property="goodsAmount" />
    <result column="goods_cost_amount" jdbcType="DECIMAL" property="goodsCostAmount" />
    <result column="refund_goods_amount" jdbcType="DECIMAL" property="refundGoodsAmount" />
    <result column="refund_goods_cost_amount" jdbcType="DECIMAL" property="refundGoodsCostAmount" />
    <result column="complet_state" jdbcType="TINYINT" property="completState" />
    <result column="order_locking_customer" jdbcType="TINYINT" property="orderLockingCustomer" />
    <result column="order_locking_supplier" jdbcType="TINYINT" property="orderLockingSupplier" />
    <result column="pay_type" jdbcType="TINYINT" property="payType" />
    <result column="pay_type_name" jdbcType="VARCHAR" property="payTypeName" />
    <result column="pay_state" jdbcType="TINYINT" property="payState" />
    <result column="pay_state_name" jdbcType="VARCHAR" property="payStateName" />
    <result column="order_state" jdbcType="TINYINT" property="orderState" />
    <result column="order_state_name" jdbcType="VARCHAR" property="orderStateName" />
    <result column="settlement_type" jdbcType="TINYINT" property="settlementType" />
    <result column="appraise_state" jdbcType="TINYINT" property="appraiseState" />
    <result column="source_channel" jdbcType="TINYINT" property="sourceChannel" />
    <result column="other_params" jdbcType="VARCHAR" property="otherParams" />
    <result column="user_type" jdbcType="VARCHAR" property="userType" />
    <result column="user_name" jdbcType="VARCHAR" property="userName" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="create_user_id" jdbcType="VARCHAR" property="createUserId" />
    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
    <result column="update_user_id" jdbcType="VARCHAR" property="updateUserId" />
    <result column="order_type" jdbcType="TINYINT" property="orderType" />
    <result column="refund_order_sn" jdbcType="VARCHAR" property="refundOrderSn" />
    <result column="rec_user_name" jdbcType="VARCHAR" property="recUserName" />
    <result column="rec_user_id" jdbcType="VARCHAR" property="recUserId" />
    <result column="rec_user_phone" jdbcType="VARCHAR" property="recUserPhone" />
    <result column="rec_address" jdbcType="VARCHAR" property="recAddress" />
    <result column="express_sn" jdbcType="VARCHAR" property="expressSn" />
    <result column="express" jdbcType="VARCHAR" property="express" />
    <result column="express_company" jdbcType="VARCHAR" property="expressCompany" />
    <result column="remarks" jdbcType="VARCHAR" property="remarks" />
    <result column="accounting_state_supplier" jdbcType="TINYINT" property="accountingStateSupplier" />
    <result column="accounting_state_customer" jdbcType="TINYINT" property="accountingStateCustomer" />
    <result column="invoice_status" jdbcType="TINYINT" property="invoiceStatus" />
    <result column="invoice_apply_sn" jdbcType="VARCHAR" property="invoiceApplySn" />
    <result column="invoice_number" jdbcType="VARCHAR" property="invoiceNumber" />
    <result column="oper_account" jdbcType="VARCHAR" property="operAccount" />
    <result column="oper_name" jdbcType="VARCHAR" property="operName" />
    <result column="pay_time" jdbcType="TIMESTAMP" property="payTime" />
    <result column="send_time" jdbcType="TIMESTAMP" property="sendTime" />
    <result column="finish_time" jdbcType="TIMESTAMP" property="finishTime" />
    <result column="accounting_time" jdbcType="TIMESTAMP" property="accountingTime" />
    <result column="back_account_status" jdbcType="TINYINT" property="backAccountStatus" />
    <result column="sync_time" jdbcType="TIMESTAMP" property="syncTime" />
    <result column="storage_status" jdbcType="TINYINT" property="storageStatus" />
    <result column="storage_time" jdbcType="TIMESTAMP" property="storageTime" />
  </resultMap>
  <sql id="Example_Where_Clause">
    <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">
    <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">
    id, unified_id, accounting_order_sn, customer_accounting_order_sn, supplier_accounting_order_sn, 
    order_sn, order_sn_out_trade, out_snapshot_order_id, service_name, service_no, project_id, 
    project_name, purchase_virt_id, purchase_virt_name, purchase_department_name, purchase_user_id, 
    purchase_user_name, purchase_phone, sale_id, sale_name, amount, cost_amount, transport_amount, 
    transport_merchant_assume_amount, goods_amount, goods_cost_amount, refund_goods_amount, 
    refund_goods_cost_amount, complet_state, order_locking_customer, order_locking_supplier, 
    pay_type, pay_type_name, pay_state, pay_state_name, order_state, order_state_name, 
    settlement_type, appraise_state, source_channel, other_params, user_type, user_name, 
    create_time, create_user_id, update_time, update_user_id, order_type, refund_order_sn, 
    rec_user_name, rec_user_id, rec_user_phone, rec_address, express_sn, express, express_company, 
    remarks, accounting_state_supplier, accounting_state_customer, invoice_status, invoice_apply_sn, 
    invoice_number, oper_account, oper_name, pay_time, send_time, finish_time, accounting_time, 
    back_account_status, sync_time, storage_status, storage_time
  </sql>
  <select id="selectByExample" parameterType="cn.superdesk.uniorder.dao.entity.thirdpart.qchjc.accounting.QchjcOrderEntityExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from qchjc_order
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from qchjc_order
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    delete from qchjc_order
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <delete id="deleteByExample" parameterType="cn.superdesk.uniorder.dao.entity.thirdpart.qchjc.accounting.QchjcOrderEntityExample">
    delete from qchjc_order
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="cn.superdesk.uniorder.dao.entity.thirdpart.qchjc.accounting.QchjcOrderEntity">
    insert into qchjc_order (id, unified_id, accounting_order_sn, 
      customer_accounting_order_sn, supplier_accounting_order_sn, 
      order_sn, order_sn_out_trade, out_snapshot_order_id, 
      service_name, service_no, project_id, 
      project_name, purchase_virt_id, purchase_virt_name, 
      purchase_department_name, purchase_user_id, 
      purchase_user_name, purchase_phone, sale_id, 
      sale_name, amount, cost_amount, 
      transport_amount, transport_merchant_assume_amount, 
      goods_amount, goods_cost_amount, refund_goods_amount, 
      refund_goods_cost_amount, complet_state, order_locking_customer, 
      order_locking_supplier, pay_type, pay_type_name, 
      pay_state, pay_state_name, order_state, 
      order_state_name, settlement_type, appraise_state, 
      source_channel, other_params, user_type, 
      user_name, create_time, create_user_id, 
      update_time, update_user_id, order_type, 
      refund_order_sn, rec_user_name, rec_user_id, 
      rec_user_phone, rec_address, express_sn, 
      express, express_company, remarks, 
      accounting_state_supplier, accounting_state_customer, 
      invoice_status, invoice_apply_sn, invoice_number, 
      oper_account, oper_name, pay_time, 
      send_time, finish_time, accounting_time, 
      back_account_status, sync_time, storage_status, 
      storage_time)
    values (#{id,jdbcType=BIGINT}, #{unifiedId,jdbcType=BIGINT}, #{accountingOrderSn,jdbcType=VARCHAR}, 
      #{customerAccountingOrderSn,jdbcType=VARCHAR}, #{supplierAccountingOrderSn,jdbcType=VARCHAR}, 
      #{orderSn,jdbcType=VARCHAR}, #{orderSnOutTrade,jdbcType=VARCHAR}, #{outSnapshotOrderId,jdbcType=VARCHAR}, 
      #{serviceName,jdbcType=VARCHAR}, #{serviceNo,jdbcType=VARCHAR}, #{projectId,jdbcType=BIGINT}, 
      #{projectName,jdbcType=VARCHAR}, #{purchaseVirtId,jdbcType=VARCHAR}, #{purchaseVirtName,jdbcType=VARCHAR}, 
      #{purchaseDepartmentName,jdbcType=VARCHAR}, #{purchaseUserId,jdbcType=VARCHAR}, 
      #{purchaseUserName,jdbcType=VARCHAR}, #{purchasePhone,jdbcType=VARCHAR}, #{saleId,jdbcType=VARCHAR}, 
      #{saleName,jdbcType=VARCHAR}, #{amount,jdbcType=DECIMAL}, #{costAmount,jdbcType=DECIMAL}, 
      #{transportAmount,jdbcType=DECIMAL}, #{transportMerchantAssumeAmount,jdbcType=DECIMAL}, 
      #{goodsAmount,jdbcType=DECIMAL}, #{goodsCostAmount,jdbcType=DECIMAL}, #{refundGoodsAmount,jdbcType=DECIMAL}, 
      #{refundGoodsCostAmount,jdbcType=DECIMAL}, #{completState,jdbcType=TINYINT}, #{orderLockingCustomer,jdbcType=TINYINT}, 
      #{orderLockingSupplier,jdbcType=TINYINT}, #{payType,jdbcType=TINYINT}, #{payTypeName,jdbcType=VARCHAR}, 
      #{payState,jdbcType=TINYINT}, #{payStateName,jdbcType=VARCHAR}, #{orderState,jdbcType=TINYINT}, 
      #{orderStateName,jdbcType=VARCHAR}, #{settlementType,jdbcType=TINYINT}, #{appraiseState,jdbcType=TINYINT}, 
      #{sourceChannel,jdbcType=TINYINT}, #{otherParams,jdbcType=VARCHAR}, #{userType,jdbcType=VARCHAR}, 
      #{userName,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{createUserId,jdbcType=VARCHAR}, 
      #{updateTime,jdbcType=TIMESTAMP}, #{updateUserId,jdbcType=VARCHAR}, #{orderType,jdbcType=TINYINT}, 
      #{refundOrderSn,jdbcType=VARCHAR}, #{recUserName,jdbcType=VARCHAR}, #{recUserId,jdbcType=VARCHAR}, 
      #{recUserPhone,jdbcType=VARCHAR}, #{recAddress,jdbcType=VARCHAR}, #{expressSn,jdbcType=VARCHAR}, 
      #{express,jdbcType=VARCHAR}, #{expressCompany,jdbcType=VARCHAR}, #{remarks,jdbcType=VARCHAR}, 
      #{accountingStateSupplier,jdbcType=TINYINT}, #{accountingStateCustomer,jdbcType=TINYINT}, 
      #{invoiceStatus,jdbcType=TINYINT}, #{invoiceApplySn,jdbcType=VARCHAR}, #{invoiceNumber,jdbcType=VARCHAR}, 
      #{operAccount,jdbcType=VARCHAR}, #{operName,jdbcType=VARCHAR}, #{payTime,jdbcType=TIMESTAMP}, 
      #{sendTime,jdbcType=TIMESTAMP}, #{finishTime,jdbcType=TIMESTAMP}, #{accountingTime,jdbcType=TIMESTAMP}, 
      #{backAccountStatus,jdbcType=TINYINT}, #{syncTime,jdbcType=TIMESTAMP}, #{storageStatus,jdbcType=TINYINT}, 
      #{storageTime,jdbcType=TIMESTAMP})
  </insert>
  <insert id="insertSelective" parameterType="cn.superdesk.uniorder.dao.entity.thirdpart.qchjc.accounting.QchjcOrderEntity">
    <selectKey resultType="java.lang.Long" keyProperty="id" order="AFTER">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into qchjc_order
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="unifiedId != null">
        unified_id,
      </if>
      <if test="accountingOrderSn != null">
        accounting_order_sn,
      </if>
      <if test="customerAccountingOrderSn != null">
        customer_accounting_order_sn,
      </if>
      <if test="supplierAccountingOrderSn != null">
        supplier_accounting_order_sn,
      </if>
      <if test="orderSn != null">
        order_sn,
      </if>
      <if test="orderSnOutTrade != null">
        order_sn_out_trade,
      </if>
      <if test="outSnapshotOrderId != null">
        out_snapshot_order_id,
      </if>
      <if test="serviceName != null">
        service_name,
      </if>
      <if test="serviceNo != null">
        service_no,
      </if>
      <if test="projectId != null">
        project_id,
      </if>
      <if test="projectName != null">
        project_name,
      </if>
      <if test="purchaseVirtId != null">
        purchase_virt_id,
      </if>
      <if test="purchaseVirtName != null">
        purchase_virt_name,
      </if>
      <if test="purchaseDepartmentName != null">
        purchase_department_name,
      </if>
      <if test="purchaseUserId != null">
        purchase_user_id,
      </if>
      <if test="purchaseUserName != null">
        purchase_user_name,
      </if>
      <if test="purchasePhone != null">
        purchase_phone,
      </if>
      <if test="saleId != null">
        sale_id,
      </if>
      <if test="saleName != null">
        sale_name,
      </if>
      <if test="amount != null">
        amount,
      </if>
      <if test="costAmount != null">
        cost_amount,
      </if>
      <if test="transportAmount != null">
        transport_amount,
      </if>
      <if test="transportMerchantAssumeAmount != null">
        transport_merchant_assume_amount,
      </if>
      <if test="goodsAmount != null">
        goods_amount,
      </if>
      <if test="goodsCostAmount != null">
        goods_cost_amount,
      </if>
      <if test="refundGoodsAmount != null">
        refund_goods_amount,
      </if>
      <if test="refundGoodsCostAmount != null">
        refund_goods_cost_amount,
      </if>
      <if test="completState != null">
        complet_state,
      </if>
      <if test="orderLockingCustomer != null">
        order_locking_customer,
      </if>
      <if test="orderLockingSupplier != null">
        order_locking_supplier,
      </if>
      <if test="payType != null">
        pay_type,
      </if>
      <if test="payTypeName != null">
        pay_type_name,
      </if>
      <if test="payState != null">
        pay_state,
      </if>
      <if test="payStateName != null">
        pay_state_name,
      </if>
      <if test="orderState != null">
        order_state,
      </if>
      <if test="orderStateName != null">
        order_state_name,
      </if>
      <if test="settlementType != null">
        settlement_type,
      </if>
      <if test="appraiseState != null">
        appraise_state,
      </if>
      <if test="sourceChannel != null">
        source_channel,
      </if>
      <if test="otherParams != null">
        other_params,
      </if>
      <if test="userType != null">
        user_type,
      </if>
      <if test="userName != null">
        user_name,
      </if>
      <if test="createTime != null">
        create_time,
      </if>
      <if test="createUserId != null">
        create_user_id,
      </if>
      <if test="updateTime != null">
        update_time,
      </if>
      <if test="updateUserId != null">
        update_user_id,
      </if>
      <if test="orderType != null">
        order_type,
      </if>
      <if test="refundOrderSn != null">
        refund_order_sn,
      </if>
      <if test="recUserName != null">
        rec_user_name,
      </if>
      <if test="recUserId != null">
        rec_user_id,
      </if>
      <if test="recUserPhone != null">
        rec_user_phone,
      </if>
      <if test="recAddress != null">
        rec_address,
      </if>
      <if test="expressSn != null">
        express_sn,
      </if>
      <if test="express != null">
        express,
      </if>
      <if test="expressCompany != null">
        express_company,
      </if>
      <if test="remarks != null">
        remarks,
      </if>
      <if test="accountingStateSupplier != null">
        accounting_state_supplier,
      </if>
      <if test="accountingStateCustomer != null">
        accounting_state_customer,
      </if>
      <if test="invoiceStatus != null">
        invoice_status,
      </if>
      <if test="invoiceApplySn != null">
        invoice_apply_sn,
      </if>
      <if test="invoiceNumber != null">
        invoice_number,
      </if>
      <if test="operAccount != null">
        oper_account,
      </if>
      <if test="operName != null">
        oper_name,
      </if>
      <if test="payTime != null">
        pay_time,
      </if>
      <if test="sendTime != null">
        send_time,
      </if>
      <if test="finishTime != null">
        finish_time,
      </if>
      <if test="accountingTime != null">
        accounting_time,
      </if>
      <if test="backAccountStatus != null">
        back_account_status,
      </if>
      <if test="syncTime != null">
        sync_time,
      </if>
      <if test="storageStatus != null">
        storage_status,
      </if>
      <if test="storageTime != null">
        storage_time,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=BIGINT},
      </if>
      <if test="unifiedId != null">
        #{unifiedId,jdbcType=BIGINT},
      </if>
      <if test="accountingOrderSn != null">
        #{accountingOrderSn,jdbcType=VARCHAR},
      </if>
      <if test="customerAccountingOrderSn != null">
        #{customerAccountingOrderSn,jdbcType=VARCHAR},
      </if>
      <if test="supplierAccountingOrderSn != null">
        #{supplierAccountingOrderSn,jdbcType=VARCHAR},
      </if>
      <if test="orderSn != null">
        #{orderSn,jdbcType=VARCHAR},
      </if>
      <if test="orderSnOutTrade != null">
        #{orderSnOutTrade,jdbcType=VARCHAR},
      </if>
      <if test="outSnapshotOrderId != null">
        #{outSnapshotOrderId,jdbcType=VARCHAR},
      </if>
      <if test="serviceName != null">
        #{serviceName,jdbcType=VARCHAR},
      </if>
      <if test="serviceNo != null">
        #{serviceNo,jdbcType=VARCHAR},
      </if>
      <if test="projectId != null">
        #{projectId,jdbcType=BIGINT},
      </if>
      <if test="projectName != null">
        #{projectName,jdbcType=VARCHAR},
      </if>
      <if test="purchaseVirtId != null">
        #{purchaseVirtId,jdbcType=VARCHAR},
      </if>
      <if test="purchaseVirtName != null">
        #{purchaseVirtName,jdbcType=VARCHAR},
      </if>
      <if test="purchaseDepartmentName != null">
        #{purchaseDepartmentName,jdbcType=VARCHAR},
      </if>
      <if test="purchaseUserId != null">
        #{purchaseUserId,jdbcType=VARCHAR},
      </if>
      <if test="purchaseUserName != null">
        #{purchaseUserName,jdbcType=VARCHAR},
      </if>
      <if test="purchasePhone != null">
        #{purchasePhone,jdbcType=VARCHAR},
      </if>
      <if test="saleId != null">
        #{saleId,jdbcType=VARCHAR},
      </if>
      <if test="saleName != null">
        #{saleName,jdbcType=VARCHAR},
      </if>
      <if test="amount != null">
        #{amount,jdbcType=DECIMAL},
      </if>
      <if test="costAmount != null">
        #{costAmount,jdbcType=DECIMAL},
      </if>
      <if test="transportAmount != null">
        #{transportAmount,jdbcType=DECIMAL},
      </if>
      <if test="transportMerchantAssumeAmount != null">
        #{transportMerchantAssumeAmount,jdbcType=DECIMAL},
      </if>
      <if test="goodsAmount != null">
        #{goodsAmount,jdbcType=DECIMAL},
      </if>
      <if test="goodsCostAmount != null">
        #{goodsCostAmount,jdbcType=DECIMAL},
      </if>
      <if test="refundGoodsAmount != null">
        #{refundGoodsAmount,jdbcType=DECIMAL},
      </if>
      <if test="refundGoodsCostAmount != null">
        #{refundGoodsCostAmount,jdbcType=DECIMAL},
      </if>
      <if test="completState != null">
        #{completState,jdbcType=TINYINT},
      </if>
      <if test="orderLockingCustomer != null">
        #{orderLockingCustomer,jdbcType=TINYINT},
      </if>
      <if test="orderLockingSupplier != null">
        #{orderLockingSupplier,jdbcType=TINYINT},
      </if>
      <if test="payType != null">
        #{payType,jdbcType=TINYINT},
      </if>
      <if test="payTypeName != null">
        #{payTypeName,jdbcType=VARCHAR},
      </if>
      <if test="payState != null">
        #{payState,jdbcType=TINYINT},
      </if>
      <if test="payStateName != null">
        #{payStateName,jdbcType=VARCHAR},
      </if>
      <if test="orderState != null">
        #{orderState,jdbcType=TINYINT},
      </if>
      <if test="orderStateName != null">
        #{orderStateName,jdbcType=VARCHAR},
      </if>
      <if test="settlementType != null">
        #{settlementType,jdbcType=TINYINT},
      </if>
      <if test="appraiseState != null">
        #{appraiseState,jdbcType=TINYINT},
      </if>
      <if test="sourceChannel != null">
        #{sourceChannel,jdbcType=TINYINT},
      </if>
      <if test="otherParams != null">
        #{otherParams,jdbcType=VARCHAR},
      </if>
      <if test="userType != null">
        #{userType,jdbcType=VARCHAR},
      </if>
      <if test="userName != null">
        #{userName,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="createUserId != null">
        #{createUserId,jdbcType=VARCHAR},
      </if>
      <if test="updateTime != null">
        #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateUserId != null">
        #{updateUserId,jdbcType=VARCHAR},
      </if>
      <if test="orderType != null">
        #{orderType,jdbcType=TINYINT},
      </if>
      <if test="refundOrderSn != null">
        #{refundOrderSn,jdbcType=VARCHAR},
      </if>
      <if test="recUserName != null">
        #{recUserName,jdbcType=VARCHAR},
      </if>
      <if test="recUserId != null">
        #{recUserId,jdbcType=VARCHAR},
      </if>
      <if test="recUserPhone != null">
        #{recUserPhone,jdbcType=VARCHAR},
      </if>
      <if test="recAddress != null">
        #{recAddress,jdbcType=VARCHAR},
      </if>
      <if test="expressSn != null">
        #{expressSn,jdbcType=VARCHAR},
      </if>
      <if test="express != null">
        #{express,jdbcType=VARCHAR},
      </if>
      <if test="expressCompany != null">
        #{expressCompany,jdbcType=VARCHAR},
      </if>
      <if test="remarks != null">
        #{remarks,jdbcType=VARCHAR},
      </if>
      <if test="accountingStateSupplier != null">
        #{accountingStateSupplier,jdbcType=TINYINT},
      </if>
      <if test="accountingStateCustomer != null">
        #{accountingStateCustomer,jdbcType=TINYINT},
      </if>
      <if test="invoiceStatus != null">
        #{invoiceStatus,jdbcType=TINYINT},
      </if>
      <if test="invoiceApplySn != null">
        #{invoiceApplySn,jdbcType=VARCHAR},
      </if>
      <if test="invoiceNumber != null">
        #{invoiceNumber,jdbcType=VARCHAR},
      </if>
      <if test="operAccount != null">
        #{operAccount,jdbcType=VARCHAR},
      </if>
      <if test="operName != null">
        #{operName,jdbcType=VARCHAR},
      </if>
      <if test="payTime != null">
        #{payTime,jdbcType=TIMESTAMP},
      </if>
      <if test="sendTime != null">
        #{sendTime,jdbcType=TIMESTAMP},
      </if>
      <if test="finishTime != null">
        #{finishTime,jdbcType=TIMESTAMP},
      </if>
      <if test="accountingTime != null">
        #{accountingTime,jdbcType=TIMESTAMP},
      </if>
      <if test="backAccountStatus != null">
        #{backAccountStatus,jdbcType=TINYINT},
      </if>
      <if test="syncTime != null">
        #{syncTime,jdbcType=TIMESTAMP},
      </if>
      <if test="storageStatus != null">
        #{storageStatus,jdbcType=TINYINT},
      </if>
      <if test="storageTime != null">
        #{storageTime,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="cn.superdesk.uniorder.dao.entity.thirdpart.qchjc.accounting.QchjcOrderEntityExample" resultType="java.lang.Long">
    select count(*) from qchjc_order
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
    <select id="selectByIdForUpdate" resultMap="BaseResultMap">
      select
      <include refid="Base_Column_List" />
      from qchjc_order
      where id = #{id} for update
    </select>
    <update id="updateByExampleSelective" parameterType="map">
    update qchjc_order
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=BIGINT},
      </if>
      <if test="record.unifiedId != null">
        unified_id = #{record.unifiedId,jdbcType=BIGINT},
      </if>
      <if test="record.accountingOrderSn != null">
        accounting_order_sn = #{record.accountingOrderSn,jdbcType=VARCHAR},
      </if>
      <if test="record.customerAccountingOrderSn != null">
        customer_accounting_order_sn = #{record.customerAccountingOrderSn,jdbcType=VARCHAR},
      </if>
      <if test="record.supplierAccountingOrderSn != null">
        supplier_accounting_order_sn = #{record.supplierAccountingOrderSn,jdbcType=VARCHAR},
      </if>
      <if test="record.orderSn != null">
        order_sn = #{record.orderSn,jdbcType=VARCHAR},
      </if>
      <if test="record.orderSnOutTrade != null">
        order_sn_out_trade = #{record.orderSnOutTrade,jdbcType=VARCHAR},
      </if>
      <if test="record.outSnapshotOrderId != null">
        out_snapshot_order_id = #{record.outSnapshotOrderId,jdbcType=VARCHAR},
      </if>
      <if test="record.serviceName != null">
        service_name = #{record.serviceName,jdbcType=VARCHAR},
      </if>
      <if test="record.serviceNo != null">
        service_no = #{record.serviceNo,jdbcType=VARCHAR},
      </if>
      <if test="record.projectId != null">
        project_id = #{record.projectId,jdbcType=BIGINT},
      </if>
      <if test="record.projectName != null">
        project_name = #{record.projectName,jdbcType=VARCHAR},
      </if>
      <if test="record.purchaseVirtId != null">
        purchase_virt_id = #{record.purchaseVirtId,jdbcType=VARCHAR},
      </if>
      <if test="record.purchaseVirtName != null">
        purchase_virt_name = #{record.purchaseVirtName,jdbcType=VARCHAR},
      </if>
      <if test="record.purchaseDepartmentName != null">
        purchase_department_name = #{record.purchaseDepartmentName,jdbcType=VARCHAR},
      </if>
      <if test="record.purchaseUserId != null">
        purchase_user_id = #{record.purchaseUserId,jdbcType=VARCHAR},
      </if>
      <if test="record.purchaseUserName != null">
        purchase_user_name = #{record.purchaseUserName,jdbcType=VARCHAR},
      </if>
      <if test="record.purchasePhone != null">
        purchase_phone = #{record.purchasePhone,jdbcType=VARCHAR},
      </if>
      <if test="record.saleId != null">
        sale_id = #{record.saleId,jdbcType=VARCHAR},
      </if>
      <if test="record.saleName != null">
        sale_name = #{record.saleName,jdbcType=VARCHAR},
      </if>
      <if test="record.amount != null">
        amount = #{record.amount,jdbcType=DECIMAL},
      </if>
      <if test="record.costAmount != null">
        cost_amount = #{record.costAmount,jdbcType=DECIMAL},
      </if>
      <if test="record.transportAmount != null">
        transport_amount = #{record.transportAmount,jdbcType=DECIMAL},
      </if>
      <if test="record.transportMerchantAssumeAmount != null">
        transport_merchant_assume_amount = #{record.transportMerchantAssumeAmount,jdbcType=DECIMAL},
      </if>
      <if test="record.goodsAmount != null">
        goods_amount = #{record.goodsAmount,jdbcType=DECIMAL},
      </if>
      <if test="record.goodsCostAmount != null">
        goods_cost_amount = #{record.goodsCostAmount,jdbcType=DECIMAL},
      </if>
      <if test="record.refundGoodsAmount != null">
        refund_goods_amount = #{record.refundGoodsAmount,jdbcType=DECIMAL},
      </if>
      <if test="record.refundGoodsCostAmount != null">
        refund_goods_cost_amount = #{record.refundGoodsCostAmount,jdbcType=DECIMAL},
      </if>
      <if test="record.completState != null">
        complet_state = #{record.completState,jdbcType=TINYINT},
      </if>
      <if test="record.orderLockingCustomer != null">
        order_locking_customer = #{record.orderLockingCustomer,jdbcType=TINYINT},
      </if>
      <if test="record.orderLockingSupplier != null">
        order_locking_supplier = #{record.orderLockingSupplier,jdbcType=TINYINT},
      </if>
      <if test="record.payType != null">
        pay_type = #{record.payType,jdbcType=TINYINT},
      </if>
      <if test="record.payTypeName != null">
        pay_type_name = #{record.payTypeName,jdbcType=VARCHAR},
      </if>
      <if test="record.payState != null">
        pay_state = #{record.payState,jdbcType=TINYINT},
      </if>
      <if test="record.payStateName != null">
        pay_state_name = #{record.payStateName,jdbcType=VARCHAR},
      </if>
      <if test="record.orderState != null">
        order_state = #{record.orderState,jdbcType=TINYINT},
      </if>
      <if test="record.orderStateName != null">
        order_state_name = #{record.orderStateName,jdbcType=VARCHAR},
      </if>
      <if test="record.settlementType != null">
        settlement_type = #{record.settlementType,jdbcType=TINYINT},
      </if>
      <if test="record.appraiseState != null">
        appraise_state = #{record.appraiseState,jdbcType=TINYINT},
      </if>
      <if test="record.sourceChannel != null">
        source_channel = #{record.sourceChannel,jdbcType=TINYINT},
      </if>
      <if test="record.otherParams != null">
        other_params = #{record.otherParams,jdbcType=VARCHAR},
      </if>
      <if test="record.userType != null">
        user_type = #{record.userType,jdbcType=VARCHAR},
      </if>
      <if test="record.userName != null">
        user_name = #{record.userName,jdbcType=VARCHAR},
      </if>
      <if test="record.createTime != null">
        create_time = #{record.createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.createUserId != null">
        create_user_id = #{record.createUserId,jdbcType=VARCHAR},
      </if>
      <if test="record.updateTime != null">
        update_time = #{record.updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.updateUserId != null">
        update_user_id = #{record.updateUserId,jdbcType=VARCHAR},
      </if>
      <if test="record.orderType != null">
        order_type = #{record.orderType,jdbcType=TINYINT},
      </if>
      <if test="record.refundOrderSn != null">
        refund_order_sn = #{record.refundOrderSn,jdbcType=VARCHAR},
      </if>
      <if test="record.recUserName != null">
        rec_user_name = #{record.recUserName,jdbcType=VARCHAR},
      </if>
      <if test="record.recUserId != null">
        rec_user_id = #{record.recUserId,jdbcType=VARCHAR},
      </if>
      <if test="record.recUserPhone != null">
        rec_user_phone = #{record.recUserPhone,jdbcType=VARCHAR},
      </if>
      <if test="record.recAddress != null">
        rec_address = #{record.recAddress,jdbcType=VARCHAR},
      </if>
      <if test="record.expressSn != null">
        express_sn = #{record.expressSn,jdbcType=VARCHAR},
      </if>
      <if test="record.express != null">
        express = #{record.express,jdbcType=VARCHAR},
      </if>
      <if test="record.expressCompany != null">
        express_company = #{record.expressCompany,jdbcType=VARCHAR},
      </if>
      <if test="record.remarks != null">
        remarks = #{record.remarks,jdbcType=VARCHAR},
      </if>
      <if test="record.accountingStateSupplier != null">
        accounting_state_supplier = #{record.accountingStateSupplier,jdbcType=TINYINT},
      </if>
      <if test="record.accountingStateCustomer != null">
        accounting_state_customer = #{record.accountingStateCustomer,jdbcType=TINYINT},
      </if>
      <if test="record.invoiceStatus != null">
        invoice_status = #{record.invoiceStatus,jdbcType=TINYINT},
      </if>
      <if test="record.invoiceApplySn != null">
        invoice_apply_sn = #{record.invoiceApplySn,jdbcType=VARCHAR},
      </if>
      <if test="record.invoiceNumber != null">
        invoice_number = #{record.invoiceNumber,jdbcType=VARCHAR},
      </if>
      <if test="record.operAccount != null">
        oper_account = #{record.operAccount,jdbcType=VARCHAR},
      </if>
      <if test="record.operName != null">
        oper_name = #{record.operName,jdbcType=VARCHAR},
      </if>
      <if test="record.payTime != null">
        pay_time = #{record.payTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.sendTime != null">
        send_time = #{record.sendTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.finishTime != null">
        finish_time = #{record.finishTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.accountingTime != null">
        accounting_time = #{record.accountingTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.backAccountStatus != null">
        back_account_status = #{record.backAccountStatus,jdbcType=TINYINT},
      </if>
      <if test="record.syncTime != null">
        sync_time = #{record.syncTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.storageStatus != null">
        storage_status = #{record.storageStatus,jdbcType=TINYINT},
      </if>
      <if test="record.storageTime != null">
        storage_time = #{record.storageTime,jdbcType=TIMESTAMP},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    update qchjc_order
    set id = #{record.id,jdbcType=BIGINT},
      unified_id = #{record.unifiedId,jdbcType=BIGINT},
      accounting_order_sn = #{record.accountingOrderSn,jdbcType=VARCHAR},
      customer_accounting_order_sn = #{record.customerAccountingOrderSn,jdbcType=VARCHAR},
      supplier_accounting_order_sn = #{record.supplierAccountingOrderSn,jdbcType=VARCHAR},
      order_sn = #{record.orderSn,jdbcType=VARCHAR},
      order_sn_out_trade = #{record.orderSnOutTrade,jdbcType=VARCHAR},
      out_snapshot_order_id = #{record.outSnapshotOrderId,jdbcType=VARCHAR},
      service_name = #{record.serviceName,jdbcType=VARCHAR},
      service_no = #{record.serviceNo,jdbcType=VARCHAR},
      project_id = #{record.projectId,jdbcType=BIGINT},
      project_name = #{record.projectName,jdbcType=VARCHAR},
      purchase_virt_id = #{record.purchaseVirtId,jdbcType=VARCHAR},
      purchase_virt_name = #{record.purchaseVirtName,jdbcType=VARCHAR},
      purchase_department_name = #{record.purchaseDepartmentName,jdbcType=VARCHAR},
      purchase_user_id = #{record.purchaseUserId,jdbcType=VARCHAR},
      purchase_user_name = #{record.purchaseUserName,jdbcType=VARCHAR},
      purchase_phone = #{record.purchasePhone,jdbcType=VARCHAR},
      sale_id = #{record.saleId,jdbcType=VARCHAR},
      sale_name = #{record.saleName,jdbcType=VARCHAR},
      amount = #{record.amount,jdbcType=DECIMAL},
      cost_amount = #{record.costAmount,jdbcType=DECIMAL},
      transport_amount = #{record.transportAmount,jdbcType=DECIMAL},
      transport_merchant_assume_amount = #{record.transportMerchantAssumeAmount,jdbcType=DECIMAL},
      goods_amount = #{record.goodsAmount,jdbcType=DECIMAL},
      goods_cost_amount = #{record.goodsCostAmount,jdbcType=DECIMAL},
      refund_goods_amount = #{record.refundGoodsAmount,jdbcType=DECIMAL},
      refund_goods_cost_amount = #{record.refundGoodsCostAmount,jdbcType=DECIMAL},
      complet_state = #{record.completState,jdbcType=TINYINT},
      order_locking_customer = #{record.orderLockingCustomer,jdbcType=TINYINT},
      order_locking_supplier = #{record.orderLockingSupplier,jdbcType=TINYINT},
      pay_type = #{record.payType,jdbcType=TINYINT},
      pay_type_name = #{record.payTypeName,jdbcType=VARCHAR},
      pay_state = #{record.payState,jdbcType=TINYINT},
      pay_state_name = #{record.payStateName,jdbcType=VARCHAR},
      order_state = #{record.orderState,jdbcType=TINYINT},
      order_state_name = #{record.orderStateName,jdbcType=VARCHAR},
      settlement_type = #{record.settlementType,jdbcType=TINYINT},
      appraise_state = #{record.appraiseState,jdbcType=TINYINT},
      source_channel = #{record.sourceChannel,jdbcType=TINYINT},
      other_params = #{record.otherParams,jdbcType=VARCHAR},
      user_type = #{record.userType,jdbcType=VARCHAR},
      user_name = #{record.userName,jdbcType=VARCHAR},
      create_time = #{record.createTime,jdbcType=TIMESTAMP},
      create_user_id = #{record.createUserId,jdbcType=VARCHAR},
      update_time = #{record.updateTime,jdbcType=TIMESTAMP},
      update_user_id = #{record.updateUserId,jdbcType=VARCHAR},
      order_type = #{record.orderType,jdbcType=TINYINT},
      refund_order_sn = #{record.refundOrderSn,jdbcType=VARCHAR},
      rec_user_name = #{record.recUserName,jdbcType=VARCHAR},
      rec_user_id = #{record.recUserId,jdbcType=VARCHAR},
      rec_user_phone = #{record.recUserPhone,jdbcType=VARCHAR},
      rec_address = #{record.recAddress,jdbcType=VARCHAR},
      express_sn = #{record.expressSn,jdbcType=VARCHAR},
      express = #{record.express,jdbcType=VARCHAR},
      express_company = #{record.expressCompany,jdbcType=VARCHAR},
      remarks = #{record.remarks,jdbcType=VARCHAR},
      accounting_state_supplier = #{record.accountingStateSupplier,jdbcType=TINYINT},
      accounting_state_customer = #{record.accountingStateCustomer,jdbcType=TINYINT},
      invoice_status = #{record.invoiceStatus,jdbcType=TINYINT},
      invoice_apply_sn = #{record.invoiceApplySn,jdbcType=VARCHAR},
      invoice_number = #{record.invoiceNumber,jdbcType=VARCHAR},
      oper_account = #{record.operAccount,jdbcType=VARCHAR},
      oper_name = #{record.operName,jdbcType=VARCHAR},
      pay_time = #{record.payTime,jdbcType=TIMESTAMP},
      send_time = #{record.sendTime,jdbcType=TIMESTAMP},
      finish_time = #{record.finishTime,jdbcType=TIMESTAMP},
      accounting_time = #{record.accountingTime,jdbcType=TIMESTAMP},
      back_account_status = #{record.backAccountStatus,jdbcType=TINYINT},
      sync_time = #{record.syncTime,jdbcType=TIMESTAMP},
      storage_status = #{record.storageStatus,jdbcType=TINYINT},
      storage_time = #{record.storageTime,jdbcType=TIMESTAMP}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="cn.superdesk.uniorder.dao.entity.thirdpart.qchjc.accounting.QchjcOrderEntity">
    update qchjc_order
    <set>
      <if test="unifiedId != null">
        unified_id = #{unifiedId,jdbcType=BIGINT},
      </if>
      <if test="accountingOrderSn != null">
        accounting_order_sn = #{accountingOrderSn,jdbcType=VARCHAR},
      </if>
      <if test="customerAccountingOrderSn != null">
        customer_accounting_order_sn = #{customerAccountingOrderSn,jdbcType=VARCHAR},
      </if>
      <if test="supplierAccountingOrderSn != null">
        supplier_accounting_order_sn = #{supplierAccountingOrderSn,jdbcType=VARCHAR},
      </if>
      <if test="orderSn != null">
        order_sn = #{orderSn,jdbcType=VARCHAR},
      </if>
      <if test="orderSnOutTrade != null">
        order_sn_out_trade = #{orderSnOutTrade,jdbcType=VARCHAR},
      </if>
      <if test="outSnapshotOrderId != null">
        out_snapshot_order_id = #{outSnapshotOrderId,jdbcType=VARCHAR},
      </if>
      <if test="serviceName != null">
        service_name = #{serviceName,jdbcType=VARCHAR},
      </if>
      <if test="serviceNo != null">
        service_no = #{serviceNo,jdbcType=VARCHAR},
      </if>
      <if test="projectId != null">
        project_id = #{projectId,jdbcType=BIGINT},
      </if>
      <if test="projectName != null">
        project_name = #{projectName,jdbcType=VARCHAR},
      </if>
      <if test="purchaseVirtId != null">
        purchase_virt_id = #{purchaseVirtId,jdbcType=VARCHAR},
      </if>
      <if test="purchaseVirtName != null">
        purchase_virt_name = #{purchaseVirtName,jdbcType=VARCHAR},
      </if>
      <if test="purchaseDepartmentName != null">
        purchase_department_name = #{purchaseDepartmentName,jdbcType=VARCHAR},
      </if>
      <if test="purchaseUserId != null">
        purchase_user_id = #{purchaseUserId,jdbcType=VARCHAR},
      </if>
      <if test="purchaseUserName != null">
        purchase_user_name = #{purchaseUserName,jdbcType=VARCHAR},
      </if>
      <if test="purchasePhone != null">
        purchase_phone = #{purchasePhone,jdbcType=VARCHAR},
      </if>
      <if test="saleId != null">
        sale_id = #{saleId,jdbcType=VARCHAR},
      </if>
      <if test="saleName != null">
        sale_name = #{saleName,jdbcType=VARCHAR},
      </if>
      <if test="amount != null">
        amount = #{amount,jdbcType=DECIMAL},
      </if>
      <if test="costAmount != null">
        cost_amount = #{costAmount,jdbcType=DECIMAL},
      </if>
      <if test="transportAmount != null">
        transport_amount = #{transportAmount,jdbcType=DECIMAL},
      </if>
      <if test="transportMerchantAssumeAmount != null">
        transport_merchant_assume_amount = #{transportMerchantAssumeAmount,jdbcType=DECIMAL},
      </if>
      <if test="goodsAmount != null">
        goods_amount = #{goodsAmount,jdbcType=DECIMAL},
      </if>
      <if test="goodsCostAmount != null">
        goods_cost_amount = #{goodsCostAmount,jdbcType=DECIMAL},
      </if>
      <if test="refundGoodsAmount != null">
        refund_goods_amount = #{refundGoodsAmount,jdbcType=DECIMAL},
      </if>
      <if test="refundGoodsCostAmount != null">
        refund_goods_cost_amount = #{refundGoodsCostAmount,jdbcType=DECIMAL},
      </if>
      <if test="completState != null">
        complet_state = #{completState,jdbcType=TINYINT},
      </if>
      <if test="orderLockingCustomer != null">
        order_locking_customer = #{orderLockingCustomer,jdbcType=TINYINT},
      </if>
      <if test="orderLockingSupplier != null">
        order_locking_supplier = #{orderLockingSupplier,jdbcType=TINYINT},
      </if>
      <if test="payType != null">
        pay_type = #{payType,jdbcType=TINYINT},
      </if>
      <if test="payTypeName != null">
        pay_type_name = #{payTypeName,jdbcType=VARCHAR},
      </if>
      <if test="payState != null">
        pay_state = #{payState,jdbcType=TINYINT},
      </if>
      <if test="payStateName != null">
        pay_state_name = #{payStateName,jdbcType=VARCHAR},
      </if>
      <if test="orderState != null">
        order_state = #{orderState,jdbcType=TINYINT},
      </if>
      <if test="orderStateName != null">
        order_state_name = #{orderStateName,jdbcType=VARCHAR},
      </if>
      <if test="settlementType != null">
        settlement_type = #{settlementType,jdbcType=TINYINT},
      </if>
      <if test="appraiseState != null">
        appraise_state = #{appraiseState,jdbcType=TINYINT},
      </if>
      <if test="sourceChannel != null">
        source_channel = #{sourceChannel,jdbcType=TINYINT},
      </if>
      <if test="otherParams != null">
        other_params = #{otherParams,jdbcType=VARCHAR},
      </if>
      <if test="userType != null">
        user_type = #{userType,jdbcType=VARCHAR},
      </if>
      <if test="userName != null">
        user_name = #{userName,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        create_time = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="createUserId != null">
        create_user_id = #{createUserId,jdbcType=VARCHAR},
      </if>
      <if test="updateTime != null">
        update_time = #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateUserId != null">
        update_user_id = #{updateUserId,jdbcType=VARCHAR},
      </if>
      <if test="orderType != null">
        order_type = #{orderType,jdbcType=TINYINT},
      </if>
      <if test="refundOrderSn != null">
        refund_order_sn = #{refundOrderSn,jdbcType=VARCHAR},
      </if>
      <if test="recUserName != null">
        rec_user_name = #{recUserName,jdbcType=VARCHAR},
      </if>
      <if test="recUserId != null">
        rec_user_id = #{recUserId,jdbcType=VARCHAR},
      </if>
      <if test="recUserPhone != null">
        rec_user_phone = #{recUserPhone,jdbcType=VARCHAR},
      </if>
      <if test="recAddress != null">
        rec_address = #{recAddress,jdbcType=VARCHAR},
      </if>
      <if test="expressSn != null">
        express_sn = #{expressSn,jdbcType=VARCHAR},
      </if>
      <if test="express != null">
        express = #{express,jdbcType=VARCHAR},
      </if>
      <if test="expressCompany != null">
        express_company = #{expressCompany,jdbcType=VARCHAR},
      </if>
      <if test="remarks != null">
        remarks = #{remarks,jdbcType=VARCHAR},
      </if>
      <if test="accountingStateSupplier != null">
        accounting_state_supplier = #{accountingStateSupplier,jdbcType=TINYINT},
      </if>
      <if test="accountingStateCustomer != null">
        accounting_state_customer = #{accountingStateCustomer,jdbcType=TINYINT},
      </if>
      <if test="invoiceStatus != null">
        invoice_status = #{invoiceStatus,jdbcType=TINYINT},
      </if>
      <if test="invoiceApplySn != null">
        invoice_apply_sn = #{invoiceApplySn,jdbcType=VARCHAR},
      </if>
      <if test="invoiceNumber != null">
        invoice_number = #{invoiceNumber,jdbcType=VARCHAR},
      </if>
      <if test="operAccount != null">
        oper_account = #{operAccount,jdbcType=VARCHAR},
      </if>
      <if test="operName != null">
        oper_name = #{operName,jdbcType=VARCHAR},
      </if>
      <if test="payTime != null">
        pay_time = #{payTime,jdbcType=TIMESTAMP},
      </if>
      <if test="sendTime != null">
        send_time = #{sendTime,jdbcType=TIMESTAMP},
      </if>
      <if test="finishTime != null">
        finish_time = #{finishTime,jdbcType=TIMESTAMP},
      </if>
      <if test="accountingTime != null">
        accounting_time = #{accountingTime,jdbcType=TIMESTAMP},
      </if>
      <if test="backAccountStatus != null">
        back_account_status = #{backAccountStatus,jdbcType=TINYINT},
      </if>
      <if test="syncTime != null">
        sync_time = #{syncTime,jdbcType=TIMESTAMP},
      </if>
      <if test="storageStatus != null">
        storage_status = #{storageStatus,jdbcType=TINYINT},
      </if>
      <if test="storageTime != null">
        storage_time = #{storageTime,jdbcType=TIMESTAMP},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="cn.superdesk.uniorder.dao.entity.thirdpart.qchjc.accounting.QchjcOrderEntity">
    update qchjc_order
    set unified_id = #{unifiedId,jdbcType=BIGINT},
      accounting_order_sn = #{accountingOrderSn,jdbcType=VARCHAR},
      customer_accounting_order_sn = #{customerAccountingOrderSn,jdbcType=VARCHAR},
      supplier_accounting_order_sn = #{supplierAccountingOrderSn,jdbcType=VARCHAR},
      order_sn = #{orderSn,jdbcType=VARCHAR},
      order_sn_out_trade = #{orderSnOutTrade,jdbcType=VARCHAR},
      out_snapshot_order_id = #{outSnapshotOrderId,jdbcType=VARCHAR},
      service_name = #{serviceName,jdbcType=VARCHAR},
      service_no = #{serviceNo,jdbcType=VARCHAR},
      project_id = #{projectId,jdbcType=BIGINT},
      project_name = #{projectName,jdbcType=VARCHAR},
      purchase_virt_id = #{purchaseVirtId,jdbcType=VARCHAR},
      purchase_virt_name = #{purchaseVirtName,jdbcType=VARCHAR},
      purchase_department_name = #{purchaseDepartmentName,jdbcType=VARCHAR},
      purchase_user_id = #{purchaseUserId,jdbcType=VARCHAR},
      purchase_user_name = #{purchaseUserName,jdbcType=VARCHAR},
      purchase_phone = #{purchasePhone,jdbcType=VARCHAR},
      sale_id = #{saleId,jdbcType=VARCHAR},
      sale_name = #{saleName,jdbcType=VARCHAR},
      amount = #{amount,jdbcType=DECIMAL},
      cost_amount = #{costAmount,jdbcType=DECIMAL},
      transport_amount = #{transportAmount,jdbcType=DECIMAL},
      transport_merchant_assume_amount = #{transportMerchantAssumeAmount,jdbcType=DECIMAL},
      goods_amount = #{goodsAmount,jdbcType=DECIMAL},
      goods_cost_amount = #{goodsCostAmount,jdbcType=DECIMAL},
      refund_goods_amount = #{refundGoodsAmount,jdbcType=DECIMAL},
      refund_goods_cost_amount = #{refundGoodsCostAmount,jdbcType=DECIMAL},
      complet_state = #{completState,jdbcType=TINYINT},
      order_locking_customer = #{orderLockingCustomer,jdbcType=TINYINT},
      order_locking_supplier = #{orderLockingSupplier,jdbcType=TINYINT},
      pay_type = #{payType,jdbcType=TINYINT},
      pay_type_name = #{payTypeName,jdbcType=VARCHAR},
      pay_state = #{payState,jdbcType=TINYINT},
      pay_state_name = #{payStateName,jdbcType=VARCHAR},
      order_state = #{orderState,jdbcType=TINYINT},
      order_state_name = #{orderStateName,jdbcType=VARCHAR},
      settlement_type = #{settlementType,jdbcType=TINYINT},
      appraise_state = #{appraiseState,jdbcType=TINYINT},
      source_channel = #{sourceChannel,jdbcType=TINYINT},
      other_params = #{otherParams,jdbcType=VARCHAR},
      user_type = #{userType,jdbcType=VARCHAR},
      user_name = #{userName,jdbcType=VARCHAR},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      create_user_id = #{createUserId,jdbcType=VARCHAR},
      update_time = #{updateTime,jdbcType=TIMESTAMP},
      update_user_id = #{updateUserId,jdbcType=VARCHAR},
      order_type = #{orderType,jdbcType=TINYINT},
      refund_order_sn = #{refundOrderSn,jdbcType=VARCHAR},
      rec_user_name = #{recUserName,jdbcType=VARCHAR},
      rec_user_id = #{recUserId,jdbcType=VARCHAR},
      rec_user_phone = #{recUserPhone,jdbcType=VARCHAR},
      rec_address = #{recAddress,jdbcType=VARCHAR},
      express_sn = #{expressSn,jdbcType=VARCHAR},
      express = #{express,jdbcType=VARCHAR},
      express_company = #{expressCompany,jdbcType=VARCHAR},
      remarks = #{remarks,jdbcType=VARCHAR},
      accounting_state_supplier = #{accountingStateSupplier,jdbcType=TINYINT},
      accounting_state_customer = #{accountingStateCustomer,jdbcType=TINYINT},
      invoice_status = #{invoiceStatus,jdbcType=TINYINT},
      invoice_apply_sn = #{invoiceApplySn,jdbcType=VARCHAR},
      invoice_number = #{invoiceNumber,jdbcType=VARCHAR},
      oper_account = #{operAccount,jdbcType=VARCHAR},
      oper_name = #{operName,jdbcType=VARCHAR},
      pay_time = #{payTime,jdbcType=TIMESTAMP},
      send_time = #{sendTime,jdbcType=TIMESTAMP},
      finish_time = #{finishTime,jdbcType=TIMESTAMP},
      accounting_time = #{accountingTime,jdbcType=TIMESTAMP},
      back_account_status = #{backAccountStatus,jdbcType=TINYINT},
      sync_time = #{syncTime,jdbcType=TIMESTAMP},
      storage_status = #{storageStatus,jdbcType=TINYINT},
      storage_time = #{storageTime,jdbcType=TIMESTAMP}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>