<?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.invoice.QchjcInvoiceApplySupplierEntityMapper">
  <resultMap id="BaseResultMap" type="cn.superdesk.uniorder.dao.entity.thirdpart.qchjc.invoice.QchjcInvoiceApplySupplierEntity">
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="accounting_order_type" jdbcType="TINYINT" property="accountingOrderType" />
    <result column="accounting_order_id" jdbcType="BIGINT" property="accountingOrderId" />
    <result column="accounting_order_sn" jdbcType="VARCHAR" property="accountingOrderSn" />
    <result column="dim_create_by" jdbcType="TINYINT" property="dimCreateBy" />
    <result column="invoice_sn" jdbcType="VARCHAR" property="invoiceSn" />
    <result column="invoice_apply_sn" jdbcType="VARCHAR" property="invoiceApplySn" />
    <result column="invoice_apply_amount" jdbcType="DECIMAL" property="invoiceApplyAmount" />
    <result column="free_amount" jdbcType="DECIMAL" property="freeAmount" />
    <result column="un_accounting_amount" jdbcType="DECIMAL" property="unAccountingAmount" />
    <result column="jc_un_accounting_amount" jdbcType="DECIMAL" property="jcUnAccountingAmount" />
    <result column="real_amount" jdbcType="DECIMAL" property="realAmount" />
    <result column="rebate_amount" jdbcType="DECIMAL" property="rebateAmount" />
    <result column="invoice_type" jdbcType="TINYINT" property="invoiceType" />
    <result column="invoice_mode" jdbcType="VARCHAR" property="invoiceMode" />
    <result column="sys_platform_ext_invoice_id" jdbcType="BIGINT" property="sysPlatformExtInvoiceId" />
    <result column="tax_rate" jdbcType="VARCHAR" property="taxRate" />
    <result column="invoice_number" jdbcType="VARCHAR" property="invoiceNumber" />
    <result column="sale_id" jdbcType="VARCHAR" property="saleId" />
    <result column="sale_name" jdbcType="VARCHAR" property="saleName" />
    <result column="sale_is_export" jdbcType="INTEGER" property="saleIsExport" />
    <result column="apply_user_id" jdbcType="VARCHAR" property="applyUserId" />
    <result column="apply_user_name" jdbcType="VARCHAR" property="applyUserName" />
    <result column="apply_time" jdbcType="TIMESTAMP" property="applyTime" />
    <result column="update_user_id" jdbcType="VARCHAR" property="updateUserId" />
    <result column="update_user_name" jdbcType="VARCHAR" property="updateUserName" />
    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
    <result column="make_invoice_user_id" jdbcType="VARCHAR" property="makeInvoiceUserId" />
    <result column="make_invoice_user_name" jdbcType="VARCHAR" property="makeInvoiceUserName" />
    <result column="make_invoice_status" jdbcType="TINYINT" property="makeInvoiceStatus" />
    <result column="make_invoice_time" jdbcType="TIMESTAMP" property="makeInvoiceTime" />
    <result column="express_company_id" jdbcType="BIGINT" property="expressCompanyId" />
    <result column="express_company_name" jdbcType="VARCHAR" property="expressCompanyName" />
    <result column="express_no" jdbcType="VARCHAR" property="expressNo" />
    <result column="remark" jdbcType="VARCHAR" property="remark" />
    <result column="mail_tick_time" jdbcType="TIMESTAMP" property="mailTickTime" />
    <result column="mail_tick_user_id" jdbcType="VARCHAR" property="mailTickUserId" />
    <result column="mail_tick_status" jdbcType="TINYINT" property="mailTickStatus" />
    <result column="sync_time" jdbcType="TIMESTAMP" property="syncTime" />
    <result column="storage_status" jdbcType="TINYINT" property="storageStatus" />
    <result column="storage_time" jdbcType="TIMESTAMP" property="storageTime" />
    <result column="jc_order_count" jdbcType="INTEGER" property="jcOrderCount" />
    <result column="unified_order_count" jdbcType="INTEGER" property="unifiedOrderCount" />
    <result column="unified_apply_amount" jdbcType="DECIMAL" property="unifiedApplyAmount" />
    <result column="unified_rebate_amount" jdbcType="DECIMAL" property="unifiedRebateAmount" />
  </resultMap>
  <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="cn.superdesk.uniorder.dao.entity.thirdpart.qchjc.invoice.QchjcInvoiceApplySupplierEntity">
    <result column="sys_platform_ext_invoice_snapshot" jdbcType="LONGVARCHAR" property="sysPlatformExtInvoiceSnapshot" />
  </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, accounting_order_type, accounting_order_id, accounting_order_sn, dim_create_by, 
    invoice_sn, invoice_apply_sn, invoice_apply_amount, free_amount, un_accounting_amount, 
    jc_un_accounting_amount, real_amount, rebate_amount, invoice_type, invoice_mode, 
    sys_platform_ext_invoice_id, tax_rate, invoice_number, sale_id, sale_name, sale_is_export, 
    apply_user_id, apply_user_name, apply_time, update_user_id, update_user_name, update_time, 
    make_invoice_user_id, make_invoice_user_name, make_invoice_status, make_invoice_time, 
    express_company_id, express_company_name, express_no, remark, mail_tick_time, mail_tick_user_id, 
    mail_tick_status, sync_time, storage_status, storage_time, jc_order_count, unified_order_count, 
    unified_apply_amount, unified_rebate_amount
  </sql>
  <sql id="Blob_Column_List">
    sys_platform_ext_invoice_snapshot
  </sql>
  <select id="selectByExampleWithBLOBs" parameterType="cn.superdesk.uniorder.dao.entity.thirdpart.qchjc.invoice.QchjcInvoiceApplySupplierEntityExample" resultMap="ResultMapWithBLOBs">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    ,
    <include refid="Blob_Column_List" />
    from qchjc_invoice_apply_supplier
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
  <select id="selectByExample" parameterType="cn.superdesk.uniorder.dao.entity.thirdpart.qchjc.invoice.QchjcInvoiceApplySupplierEntityExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from qchjc_invoice_apply_supplier
    <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="ResultMapWithBLOBs">
    select 
    <include refid="Base_Column_List" />
    ,
    <include refid="Blob_Column_List" />
    from qchjc_invoice_apply_supplier
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    delete from qchjc_invoice_apply_supplier
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <delete id="deleteByExample" parameterType="cn.superdesk.uniorder.dao.entity.thirdpart.qchjc.invoice.QchjcInvoiceApplySupplierEntityExample">
    delete from qchjc_invoice_apply_supplier
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="cn.superdesk.uniorder.dao.entity.thirdpart.qchjc.invoice.QchjcInvoiceApplySupplierEntity">
    insert into qchjc_invoice_apply_supplier (id, accounting_order_type, accounting_order_id, 
      accounting_order_sn, dim_create_by, invoice_sn, 
      invoice_apply_sn, invoice_apply_amount, free_amount, 
      un_accounting_amount, jc_un_accounting_amount, 
      real_amount, rebate_amount, invoice_type, 
      invoice_mode, sys_platform_ext_invoice_id, tax_rate, 
      invoice_number, sale_id, sale_name, 
      sale_is_export, apply_user_id, apply_user_name, 
      apply_time, update_user_id, update_user_name, 
      update_time, make_invoice_user_id, make_invoice_user_name, 
      make_invoice_status, make_invoice_time, express_company_id, 
      express_company_name, express_no, remark, 
      mail_tick_time, mail_tick_user_id, mail_tick_status, 
      sync_time, storage_status, storage_time, 
      jc_order_count, unified_order_count, unified_apply_amount, 
      unified_rebate_amount, sys_platform_ext_invoice_snapshot
      )
    values (#{id,jdbcType=BIGINT}, #{accountingOrderType,jdbcType=TINYINT}, #{accountingOrderId,jdbcType=BIGINT}, 
      #{accountingOrderSn,jdbcType=VARCHAR}, #{dimCreateBy,jdbcType=TINYINT}, #{invoiceSn,jdbcType=VARCHAR}, 
      #{invoiceApplySn,jdbcType=VARCHAR}, #{invoiceApplyAmount,jdbcType=DECIMAL}, #{freeAmount,jdbcType=DECIMAL}, 
      #{unAccountingAmount,jdbcType=DECIMAL}, #{jcUnAccountingAmount,jdbcType=DECIMAL}, 
      #{realAmount,jdbcType=DECIMAL}, #{rebateAmount,jdbcType=DECIMAL}, #{invoiceType,jdbcType=TINYINT}, 
      #{invoiceMode,jdbcType=VARCHAR}, #{sysPlatformExtInvoiceId,jdbcType=BIGINT}, #{taxRate,jdbcType=VARCHAR}, 
      #{invoiceNumber,jdbcType=VARCHAR}, #{saleId,jdbcType=VARCHAR}, #{saleName,jdbcType=VARCHAR}, 
      #{saleIsExport,jdbcType=INTEGER}, #{applyUserId,jdbcType=VARCHAR}, #{applyUserName,jdbcType=VARCHAR}, 
      #{applyTime,jdbcType=TIMESTAMP}, #{updateUserId,jdbcType=VARCHAR}, #{updateUserName,jdbcType=VARCHAR}, 
      #{updateTime,jdbcType=TIMESTAMP}, #{makeInvoiceUserId,jdbcType=VARCHAR}, #{makeInvoiceUserName,jdbcType=VARCHAR}, 
      #{makeInvoiceStatus,jdbcType=TINYINT}, #{makeInvoiceTime,jdbcType=TIMESTAMP}, #{expressCompanyId,jdbcType=BIGINT}, 
      #{expressCompanyName,jdbcType=VARCHAR}, #{expressNo,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, 
      #{mailTickTime,jdbcType=TIMESTAMP}, #{mailTickUserId,jdbcType=VARCHAR}, #{mailTickStatus,jdbcType=TINYINT}, 
      #{syncTime,jdbcType=TIMESTAMP}, #{storageStatus,jdbcType=TINYINT}, #{storageTime,jdbcType=TIMESTAMP}, 
      #{jcOrderCount,jdbcType=INTEGER}, #{unifiedOrderCount,jdbcType=INTEGER}, #{unifiedApplyAmount,jdbcType=DECIMAL}, 
      #{unifiedRebateAmount,jdbcType=DECIMAL}, #{sysPlatformExtInvoiceSnapshot,jdbcType=LONGVARCHAR}
      )
  </insert>
  <insert id="insertSelective" parameterType="cn.superdesk.uniorder.dao.entity.thirdpart.qchjc.invoice.QchjcInvoiceApplySupplierEntity">
    <selectKey resultType="java.lang.Long" keyProperty="id" order="AFTER">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into qchjc_invoice_apply_supplier
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="accountingOrderType != null">
        accounting_order_type,
      </if>
      <if test="accountingOrderId != null">
        accounting_order_id,
      </if>
      <if test="accountingOrderSn != null">
        accounting_order_sn,
      </if>
      <if test="dimCreateBy != null">
        dim_create_by,
      </if>
      <if test="invoiceSn != null">
        invoice_sn,
      </if>
      <if test="invoiceApplySn != null">
        invoice_apply_sn,
      </if>
      <if test="invoiceApplyAmount != null">
        invoice_apply_amount,
      </if>
      <if test="freeAmount != null">
        free_amount,
      </if>
      <if test="unAccountingAmount != null">
        un_accounting_amount,
      </if>
      <if test="jcUnAccountingAmount != null">
        jc_un_accounting_amount,
      </if>
      <if test="realAmount != null">
        real_amount,
      </if>
      <if test="rebateAmount != null">
        rebate_amount,
      </if>
      <if test="invoiceType != null">
        invoice_type,
      </if>
      <if test="invoiceMode != null">
        invoice_mode,
      </if>
      <if test="sysPlatformExtInvoiceId != null">
        sys_platform_ext_invoice_id,
      </if>
      <if test="taxRate != null">
        tax_rate,
      </if>
      <if test="invoiceNumber != null">
        invoice_number,
      </if>
      <if test="saleId != null">
        sale_id,
      </if>
      <if test="saleName != null">
        sale_name,
      </if>
      <if test="saleIsExport != null">
        sale_is_export,
      </if>
      <if test="applyUserId != null">
        apply_user_id,
      </if>
      <if test="applyUserName != null">
        apply_user_name,
      </if>
      <if test="applyTime != null">
        apply_time,
      </if>
      <if test="updateUserId != null">
        update_user_id,
      </if>
      <if test="updateUserName != null">
        update_user_name,
      </if>
      <if test="updateTime != null">
        update_time,
      </if>
      <if test="makeInvoiceUserId != null">
        make_invoice_user_id,
      </if>
      <if test="makeInvoiceUserName != null">
        make_invoice_user_name,
      </if>
      <if test="makeInvoiceStatus != null">
        make_invoice_status,
      </if>
      <if test="makeInvoiceTime != null">
        make_invoice_time,
      </if>
      <if test="expressCompanyId != null">
        express_company_id,
      </if>
      <if test="expressCompanyName != null">
        express_company_name,
      </if>
      <if test="expressNo != null">
        express_no,
      </if>
      <if test="remark != null">
        remark,
      </if>
      <if test="mailTickTime != null">
        mail_tick_time,
      </if>
      <if test="mailTickUserId != null">
        mail_tick_user_id,
      </if>
      <if test="mailTickStatus != null">
        mail_tick_status,
      </if>
      <if test="syncTime != null">
        sync_time,
      </if>
      <if test="storageStatus != null">
        storage_status,
      </if>
      <if test="storageTime != null">
        storage_time,
      </if>
      <if test="jcOrderCount != null">
        jc_order_count,
      </if>
      <if test="unifiedOrderCount != null">
        unified_order_count,
      </if>
      <if test="unifiedApplyAmount != null">
        unified_apply_amount,
      </if>
      <if test="unifiedRebateAmount != null">
        unified_rebate_amount,
      </if>
      <if test="sysPlatformExtInvoiceSnapshot != null">
        sys_platform_ext_invoice_snapshot,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=BIGINT},
      </if>
      <if test="accountingOrderType != null">
        #{accountingOrderType,jdbcType=TINYINT},
      </if>
      <if test="accountingOrderId != null">
        #{accountingOrderId,jdbcType=BIGINT},
      </if>
      <if test="accountingOrderSn != null">
        #{accountingOrderSn,jdbcType=VARCHAR},
      </if>
      <if test="dimCreateBy != null">
        #{dimCreateBy,jdbcType=TINYINT},
      </if>
      <if test="invoiceSn != null">
        #{invoiceSn,jdbcType=VARCHAR},
      </if>
      <if test="invoiceApplySn != null">
        #{invoiceApplySn,jdbcType=VARCHAR},
      </if>
      <if test="invoiceApplyAmount != null">
        #{invoiceApplyAmount,jdbcType=DECIMAL},
      </if>
      <if test="freeAmount != null">
        #{freeAmount,jdbcType=DECIMAL},
      </if>
      <if test="unAccountingAmount != null">
        #{unAccountingAmount,jdbcType=DECIMAL},
      </if>
      <if test="jcUnAccountingAmount != null">
        #{jcUnAccountingAmount,jdbcType=DECIMAL},
      </if>
      <if test="realAmount != null">
        #{realAmount,jdbcType=DECIMAL},
      </if>
      <if test="rebateAmount != null">
        #{rebateAmount,jdbcType=DECIMAL},
      </if>
      <if test="invoiceType != null">
        #{invoiceType,jdbcType=TINYINT},
      </if>
      <if test="invoiceMode != null">
        #{invoiceMode,jdbcType=VARCHAR},
      </if>
      <if test="sysPlatformExtInvoiceId != null">
        #{sysPlatformExtInvoiceId,jdbcType=BIGINT},
      </if>
      <if test="taxRate != null">
        #{taxRate,jdbcType=VARCHAR},
      </if>
      <if test="invoiceNumber != null">
        #{invoiceNumber,jdbcType=VARCHAR},
      </if>
      <if test="saleId != null">
        #{saleId,jdbcType=VARCHAR},
      </if>
      <if test="saleName != null">
        #{saleName,jdbcType=VARCHAR},
      </if>
      <if test="saleIsExport != null">
        #{saleIsExport,jdbcType=INTEGER},
      </if>
      <if test="applyUserId != null">
        #{applyUserId,jdbcType=VARCHAR},
      </if>
      <if test="applyUserName != null">
        #{applyUserName,jdbcType=VARCHAR},
      </if>
      <if test="applyTime != null">
        #{applyTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateUserId != null">
        #{updateUserId,jdbcType=VARCHAR},
      </if>
      <if test="updateUserName != null">
        #{updateUserName,jdbcType=VARCHAR},
      </if>
      <if test="updateTime != null">
        #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="makeInvoiceUserId != null">
        #{makeInvoiceUserId,jdbcType=VARCHAR},
      </if>
      <if test="makeInvoiceUserName != null">
        #{makeInvoiceUserName,jdbcType=VARCHAR},
      </if>
      <if test="makeInvoiceStatus != null">
        #{makeInvoiceStatus,jdbcType=TINYINT},
      </if>
      <if test="makeInvoiceTime != null">
        #{makeInvoiceTime,jdbcType=TIMESTAMP},
      </if>
      <if test="expressCompanyId != null">
        #{expressCompanyId,jdbcType=BIGINT},
      </if>
      <if test="expressCompanyName != null">
        #{expressCompanyName,jdbcType=VARCHAR},
      </if>
      <if test="expressNo != null">
        #{expressNo,jdbcType=VARCHAR},
      </if>
      <if test="remark != null">
        #{remark,jdbcType=VARCHAR},
      </if>
      <if test="mailTickTime != null">
        #{mailTickTime,jdbcType=TIMESTAMP},
      </if>
      <if test="mailTickUserId != null">
        #{mailTickUserId,jdbcType=VARCHAR},
      </if>
      <if test="mailTickStatus != null">
        #{mailTickStatus,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>
      <if test="jcOrderCount != null">
        #{jcOrderCount,jdbcType=INTEGER},
      </if>
      <if test="unifiedOrderCount != null">
        #{unifiedOrderCount,jdbcType=INTEGER},
      </if>
      <if test="unifiedApplyAmount != null">
        #{unifiedApplyAmount,jdbcType=DECIMAL},
      </if>
      <if test="unifiedRebateAmount != null">
        #{unifiedRebateAmount,jdbcType=DECIMAL},
      </if>
      <if test="sysPlatformExtInvoiceSnapshot != null">
        #{sysPlatformExtInvoiceSnapshot,jdbcType=LONGVARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="cn.superdesk.uniorder.dao.entity.thirdpart.qchjc.invoice.QchjcInvoiceApplySupplierEntityExample" resultType="java.lang.Long">
    select count(*) from qchjc_invoice_apply_supplier
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update qchjc_invoice_apply_supplier
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=BIGINT},
      </if>
      <if test="record.accountingOrderType != null">
        accounting_order_type = #{record.accountingOrderType,jdbcType=TINYINT},
      </if>
      <if test="record.accountingOrderId != null">
        accounting_order_id = #{record.accountingOrderId,jdbcType=BIGINT},
      </if>
      <if test="record.accountingOrderSn != null">
        accounting_order_sn = #{record.accountingOrderSn,jdbcType=VARCHAR},
      </if>
      <if test="record.dimCreateBy != null">
        dim_create_by = #{record.dimCreateBy,jdbcType=TINYINT},
      </if>
      <if test="record.invoiceSn != null">
        invoice_sn = #{record.invoiceSn,jdbcType=VARCHAR},
      </if>
      <if test="record.invoiceApplySn != null">
        invoice_apply_sn = #{record.invoiceApplySn,jdbcType=VARCHAR},
      </if>
      <if test="record.invoiceApplyAmount != null">
        invoice_apply_amount = #{record.invoiceApplyAmount,jdbcType=DECIMAL},
      </if>
      <if test="record.freeAmount != null">
        free_amount = #{record.freeAmount,jdbcType=DECIMAL},
      </if>
      <if test="record.unAccountingAmount != null">
        un_accounting_amount = #{record.unAccountingAmount,jdbcType=DECIMAL},
      </if>
      <if test="record.jcUnAccountingAmount != null">
        jc_un_accounting_amount = #{record.jcUnAccountingAmount,jdbcType=DECIMAL},
      </if>
      <if test="record.realAmount != null">
        real_amount = #{record.realAmount,jdbcType=DECIMAL},
      </if>
      <if test="record.rebateAmount != null">
        rebate_amount = #{record.rebateAmount,jdbcType=DECIMAL},
      </if>
      <if test="record.invoiceType != null">
        invoice_type = #{record.invoiceType,jdbcType=TINYINT},
      </if>
      <if test="record.invoiceMode != null">
        invoice_mode = #{record.invoiceMode,jdbcType=VARCHAR},
      </if>
      <if test="record.sysPlatformExtInvoiceId != null">
        sys_platform_ext_invoice_id = #{record.sysPlatformExtInvoiceId,jdbcType=BIGINT},
      </if>
      <if test="record.taxRate != null">
        tax_rate = #{record.taxRate,jdbcType=VARCHAR},
      </if>
      <if test="record.invoiceNumber != null">
        invoice_number = #{record.invoiceNumber,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.saleIsExport != null">
        sale_is_export = #{record.saleIsExport,jdbcType=INTEGER},
      </if>
      <if test="record.applyUserId != null">
        apply_user_id = #{record.applyUserId,jdbcType=VARCHAR},
      </if>
      <if test="record.applyUserName != null">
        apply_user_name = #{record.applyUserName,jdbcType=VARCHAR},
      </if>
      <if test="record.applyTime != null">
        apply_time = #{record.applyTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.updateUserId != null">
        update_user_id = #{record.updateUserId,jdbcType=VARCHAR},
      </if>
      <if test="record.updateUserName != null">
        update_user_name = #{record.updateUserName,jdbcType=VARCHAR},
      </if>
      <if test="record.updateTime != null">
        update_time = #{record.updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.makeInvoiceUserId != null">
        make_invoice_user_id = #{record.makeInvoiceUserId,jdbcType=VARCHAR},
      </if>
      <if test="record.makeInvoiceUserName != null">
        make_invoice_user_name = #{record.makeInvoiceUserName,jdbcType=VARCHAR},
      </if>
      <if test="record.makeInvoiceStatus != null">
        make_invoice_status = #{record.makeInvoiceStatus,jdbcType=TINYINT},
      </if>
      <if test="record.makeInvoiceTime != null">
        make_invoice_time = #{record.makeInvoiceTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.expressCompanyId != null">
        express_company_id = #{record.expressCompanyId,jdbcType=BIGINT},
      </if>
      <if test="record.expressCompanyName != null">
        express_company_name = #{record.expressCompanyName,jdbcType=VARCHAR},
      </if>
      <if test="record.expressNo != null">
        express_no = #{record.expressNo,jdbcType=VARCHAR},
      </if>
      <if test="record.remark != null">
        remark = #{record.remark,jdbcType=VARCHAR},
      </if>
      <if test="record.mailTickTime != null">
        mail_tick_time = #{record.mailTickTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.mailTickUserId != null">
        mail_tick_user_id = #{record.mailTickUserId,jdbcType=VARCHAR},
      </if>
      <if test="record.mailTickStatus != null">
        mail_tick_status = #{record.mailTickStatus,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>
      <if test="record.jcOrderCount != null">
        jc_order_count = #{record.jcOrderCount,jdbcType=INTEGER},
      </if>
      <if test="record.unifiedOrderCount != null">
        unified_order_count = #{record.unifiedOrderCount,jdbcType=INTEGER},
      </if>
      <if test="record.unifiedApplyAmount != null">
        unified_apply_amount = #{record.unifiedApplyAmount,jdbcType=DECIMAL},
      </if>
      <if test="record.unifiedRebateAmount != null">
        unified_rebate_amount = #{record.unifiedRebateAmount,jdbcType=DECIMAL},
      </if>
      <if test="record.sysPlatformExtInvoiceSnapshot != null">
        sys_platform_ext_invoice_snapshot = #{record.sysPlatformExtInvoiceSnapshot,jdbcType=LONGVARCHAR},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExampleWithBLOBs" parameterType="map">
    update qchjc_invoice_apply_supplier
    set id = #{record.id,jdbcType=BIGINT},
      accounting_order_type = #{record.accountingOrderType,jdbcType=TINYINT},
      accounting_order_id = #{record.accountingOrderId,jdbcType=BIGINT},
      accounting_order_sn = #{record.accountingOrderSn,jdbcType=VARCHAR},
      dim_create_by = #{record.dimCreateBy,jdbcType=TINYINT},
      invoice_sn = #{record.invoiceSn,jdbcType=VARCHAR},
      invoice_apply_sn = #{record.invoiceApplySn,jdbcType=VARCHAR},
      invoice_apply_amount = #{record.invoiceApplyAmount,jdbcType=DECIMAL},
      free_amount = #{record.freeAmount,jdbcType=DECIMAL},
      un_accounting_amount = #{record.unAccountingAmount,jdbcType=DECIMAL},
      jc_un_accounting_amount = #{record.jcUnAccountingAmount,jdbcType=DECIMAL},
      real_amount = #{record.realAmount,jdbcType=DECIMAL},
      rebate_amount = #{record.rebateAmount,jdbcType=DECIMAL},
      invoice_type = #{record.invoiceType,jdbcType=TINYINT},
      invoice_mode = #{record.invoiceMode,jdbcType=VARCHAR},
      sys_platform_ext_invoice_id = #{record.sysPlatformExtInvoiceId,jdbcType=BIGINT},
      tax_rate = #{record.taxRate,jdbcType=VARCHAR},
      invoice_number = #{record.invoiceNumber,jdbcType=VARCHAR},
      sale_id = #{record.saleId,jdbcType=VARCHAR},
      sale_name = #{record.saleName,jdbcType=VARCHAR},
      sale_is_export = #{record.saleIsExport,jdbcType=INTEGER},
      apply_user_id = #{record.applyUserId,jdbcType=VARCHAR},
      apply_user_name = #{record.applyUserName,jdbcType=VARCHAR},
      apply_time = #{record.applyTime,jdbcType=TIMESTAMP},
      update_user_id = #{record.updateUserId,jdbcType=VARCHAR},
      update_user_name = #{record.updateUserName,jdbcType=VARCHAR},
      update_time = #{record.updateTime,jdbcType=TIMESTAMP},
      make_invoice_user_id = #{record.makeInvoiceUserId,jdbcType=VARCHAR},
      make_invoice_user_name = #{record.makeInvoiceUserName,jdbcType=VARCHAR},
      make_invoice_status = #{record.makeInvoiceStatus,jdbcType=TINYINT},
      make_invoice_time = #{record.makeInvoiceTime,jdbcType=TIMESTAMP},
      express_company_id = #{record.expressCompanyId,jdbcType=BIGINT},
      express_company_name = #{record.expressCompanyName,jdbcType=VARCHAR},
      express_no = #{record.expressNo,jdbcType=VARCHAR},
      remark = #{record.remark,jdbcType=VARCHAR},
      mail_tick_time = #{record.mailTickTime,jdbcType=TIMESTAMP},
      mail_tick_user_id = #{record.mailTickUserId,jdbcType=VARCHAR},
      mail_tick_status = #{record.mailTickStatus,jdbcType=TINYINT},
      sync_time = #{record.syncTime,jdbcType=TIMESTAMP},
      storage_status = #{record.storageStatus,jdbcType=TINYINT},
      storage_time = #{record.storageTime,jdbcType=TIMESTAMP},
      jc_order_count = #{record.jcOrderCount,jdbcType=INTEGER},
      unified_order_count = #{record.unifiedOrderCount,jdbcType=INTEGER},
      unified_apply_amount = #{record.unifiedApplyAmount,jdbcType=DECIMAL},
      unified_rebate_amount = #{record.unifiedRebateAmount,jdbcType=DECIMAL},
      sys_platform_ext_invoice_snapshot = #{record.sysPlatformExtInvoiceSnapshot,jdbcType=LONGVARCHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    update qchjc_invoice_apply_supplier
    set id = #{record.id,jdbcType=BIGINT},
      accounting_order_type = #{record.accountingOrderType,jdbcType=TINYINT},
      accounting_order_id = #{record.accountingOrderId,jdbcType=BIGINT},
      accounting_order_sn = #{record.accountingOrderSn,jdbcType=VARCHAR},
      dim_create_by = #{record.dimCreateBy,jdbcType=TINYINT},
      invoice_sn = #{record.invoiceSn,jdbcType=VARCHAR},
      invoice_apply_sn = #{record.invoiceApplySn,jdbcType=VARCHAR},
      invoice_apply_amount = #{record.invoiceApplyAmount,jdbcType=DECIMAL},
      free_amount = #{record.freeAmount,jdbcType=DECIMAL},
      un_accounting_amount = #{record.unAccountingAmount,jdbcType=DECIMAL},
      jc_un_accounting_amount = #{record.jcUnAccountingAmount,jdbcType=DECIMAL},
      real_amount = #{record.realAmount,jdbcType=DECIMAL},
      rebate_amount = #{record.rebateAmount,jdbcType=DECIMAL},
      invoice_type = #{record.invoiceType,jdbcType=TINYINT},
      invoice_mode = #{record.invoiceMode,jdbcType=VARCHAR},
      sys_platform_ext_invoice_id = #{record.sysPlatformExtInvoiceId,jdbcType=BIGINT},
      tax_rate = #{record.taxRate,jdbcType=VARCHAR},
      invoice_number = #{record.invoiceNumber,jdbcType=VARCHAR},
      sale_id = #{record.saleId,jdbcType=VARCHAR},
      sale_name = #{record.saleName,jdbcType=VARCHAR},
      sale_is_export = #{record.saleIsExport,jdbcType=INTEGER},
      apply_user_id = #{record.applyUserId,jdbcType=VARCHAR},
      apply_user_name = #{record.applyUserName,jdbcType=VARCHAR},
      apply_time = #{record.applyTime,jdbcType=TIMESTAMP},
      update_user_id = #{record.updateUserId,jdbcType=VARCHAR},
      update_user_name = #{record.updateUserName,jdbcType=VARCHAR},
      update_time = #{record.updateTime,jdbcType=TIMESTAMP},
      make_invoice_user_id = #{record.makeInvoiceUserId,jdbcType=VARCHAR},
      make_invoice_user_name = #{record.makeInvoiceUserName,jdbcType=VARCHAR},
      make_invoice_status = #{record.makeInvoiceStatus,jdbcType=TINYINT},
      make_invoice_time = #{record.makeInvoiceTime,jdbcType=TIMESTAMP},
      express_company_id = #{record.expressCompanyId,jdbcType=BIGINT},
      express_company_name = #{record.expressCompanyName,jdbcType=VARCHAR},
      express_no = #{record.expressNo,jdbcType=VARCHAR},
      remark = #{record.remark,jdbcType=VARCHAR},
      mail_tick_time = #{record.mailTickTime,jdbcType=TIMESTAMP},
      mail_tick_user_id = #{record.mailTickUserId,jdbcType=VARCHAR},
      mail_tick_status = #{record.mailTickStatus,jdbcType=TINYINT},
      sync_time = #{record.syncTime,jdbcType=TIMESTAMP},
      storage_status = #{record.storageStatus,jdbcType=TINYINT},
      storage_time = #{record.storageTime,jdbcType=TIMESTAMP},
      jc_order_count = #{record.jcOrderCount,jdbcType=INTEGER},
      unified_order_count = #{record.unifiedOrderCount,jdbcType=INTEGER},
      unified_apply_amount = #{record.unifiedApplyAmount,jdbcType=DECIMAL},
      unified_rebate_amount = #{record.unifiedRebateAmount,jdbcType=DECIMAL}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="cn.superdesk.uniorder.dao.entity.thirdpart.qchjc.invoice.QchjcInvoiceApplySupplierEntity">
    update qchjc_invoice_apply_supplier
    <set>
      <if test="accountingOrderType != null">
        accounting_order_type = #{accountingOrderType,jdbcType=TINYINT},
      </if>
      <if test="accountingOrderId != null">
        accounting_order_id = #{accountingOrderId,jdbcType=BIGINT},
      </if>
      <if test="accountingOrderSn != null">
        accounting_order_sn = #{accountingOrderSn,jdbcType=VARCHAR},
      </if>
      <if test="dimCreateBy != null">
        dim_create_by = #{dimCreateBy,jdbcType=TINYINT},
      </if>
      <if test="invoiceSn != null">
        invoice_sn = #{invoiceSn,jdbcType=VARCHAR},
      </if>
      <if test="invoiceApplySn != null">
        invoice_apply_sn = #{invoiceApplySn,jdbcType=VARCHAR},
      </if>
      <if test="invoiceApplyAmount != null">
        invoice_apply_amount = #{invoiceApplyAmount,jdbcType=DECIMAL},
      </if>
      <if test="freeAmount != null">
        free_amount = #{freeAmount,jdbcType=DECIMAL},
      </if>
      <if test="unAccountingAmount != null">
        un_accounting_amount = #{unAccountingAmount,jdbcType=DECIMAL},
      </if>
      <if test="jcUnAccountingAmount != null">
        jc_un_accounting_amount = #{jcUnAccountingAmount,jdbcType=DECIMAL},
      </if>
      <if test="realAmount != null">
        real_amount = #{realAmount,jdbcType=DECIMAL},
      </if>
      <if test="rebateAmount != null">
        rebate_amount = #{rebateAmount,jdbcType=DECIMAL},
      </if>
      <if test="invoiceType != null">
        invoice_type = #{invoiceType,jdbcType=TINYINT},
      </if>
      <if test="invoiceMode != null">
        invoice_mode = #{invoiceMode,jdbcType=VARCHAR},
      </if>
      <if test="sysPlatformExtInvoiceId != null">
        sys_platform_ext_invoice_id = #{sysPlatformExtInvoiceId,jdbcType=BIGINT},
      </if>
      <if test="taxRate != null">
        tax_rate = #{taxRate,jdbcType=VARCHAR},
      </if>
      <if test="invoiceNumber != null">
        invoice_number = #{invoiceNumber,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="saleIsExport != null">
        sale_is_export = #{saleIsExport,jdbcType=INTEGER},
      </if>
      <if test="applyUserId != null">
        apply_user_id = #{applyUserId,jdbcType=VARCHAR},
      </if>
      <if test="applyUserName != null">
        apply_user_name = #{applyUserName,jdbcType=VARCHAR},
      </if>
      <if test="applyTime != null">
        apply_time = #{applyTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateUserId != null">
        update_user_id = #{updateUserId,jdbcType=VARCHAR},
      </if>
      <if test="updateUserName != null">
        update_user_name = #{updateUserName,jdbcType=VARCHAR},
      </if>
      <if test="updateTime != null">
        update_time = #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="makeInvoiceUserId != null">
        make_invoice_user_id = #{makeInvoiceUserId,jdbcType=VARCHAR},
      </if>
      <if test="makeInvoiceUserName != null">
        make_invoice_user_name = #{makeInvoiceUserName,jdbcType=VARCHAR},
      </if>
      <if test="makeInvoiceStatus != null">
        make_invoice_status = #{makeInvoiceStatus,jdbcType=TINYINT},
      </if>
      <if test="makeInvoiceTime != null">
        make_invoice_time = #{makeInvoiceTime,jdbcType=TIMESTAMP},
      </if>
      <if test="expressCompanyId != null">
        express_company_id = #{expressCompanyId,jdbcType=BIGINT},
      </if>
      <if test="expressCompanyName != null">
        express_company_name = #{expressCompanyName,jdbcType=VARCHAR},
      </if>
      <if test="expressNo != null">
        express_no = #{expressNo,jdbcType=VARCHAR},
      </if>
      <if test="remark != null">
        remark = #{remark,jdbcType=VARCHAR},
      </if>
      <if test="mailTickTime != null">
        mail_tick_time = #{mailTickTime,jdbcType=TIMESTAMP},
      </if>
      <if test="mailTickUserId != null">
        mail_tick_user_id = #{mailTickUserId,jdbcType=VARCHAR},
      </if>
      <if test="mailTickStatus != null">
        mail_tick_status = #{mailTickStatus,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>
      <if test="jcOrderCount != null">
        jc_order_count = #{jcOrderCount,jdbcType=INTEGER},
      </if>
      <if test="unifiedOrderCount != null">
        unified_order_count = #{unifiedOrderCount,jdbcType=INTEGER},
      </if>
      <if test="unifiedApplyAmount != null">
        unified_apply_amount = #{unifiedApplyAmount,jdbcType=DECIMAL},
      </if>
      <if test="unifiedRebateAmount != null">
        unified_rebate_amount = #{unifiedRebateAmount,jdbcType=DECIMAL},
      </if>
      <if test="sysPlatformExtInvoiceSnapshot != null">
        sys_platform_ext_invoice_snapshot = #{sysPlatformExtInvoiceSnapshot,jdbcType=LONGVARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKeyWithBLOBs" parameterType="cn.superdesk.uniorder.dao.entity.thirdpart.qchjc.invoice.QchjcInvoiceApplySupplierEntity">
    update qchjc_invoice_apply_supplier
    set accounting_order_type = #{accountingOrderType,jdbcType=TINYINT},
      accounting_order_id = #{accountingOrderId,jdbcType=BIGINT},
      accounting_order_sn = #{accountingOrderSn,jdbcType=VARCHAR},
      dim_create_by = #{dimCreateBy,jdbcType=TINYINT},
      invoice_sn = #{invoiceSn,jdbcType=VARCHAR},
      invoice_apply_sn = #{invoiceApplySn,jdbcType=VARCHAR},
      invoice_apply_amount = #{invoiceApplyAmount,jdbcType=DECIMAL},
      free_amount = #{freeAmount,jdbcType=DECIMAL},
      un_accounting_amount = #{unAccountingAmount,jdbcType=DECIMAL},
      jc_un_accounting_amount = #{jcUnAccountingAmount,jdbcType=DECIMAL},
      real_amount = #{realAmount,jdbcType=DECIMAL},
      rebate_amount = #{rebateAmount,jdbcType=DECIMAL},
      invoice_type = #{invoiceType,jdbcType=TINYINT},
      invoice_mode = #{invoiceMode,jdbcType=VARCHAR},
      sys_platform_ext_invoice_id = #{sysPlatformExtInvoiceId,jdbcType=BIGINT},
      tax_rate = #{taxRate,jdbcType=VARCHAR},
      invoice_number = #{invoiceNumber,jdbcType=VARCHAR},
      sale_id = #{saleId,jdbcType=VARCHAR},
      sale_name = #{saleName,jdbcType=VARCHAR},
      sale_is_export = #{saleIsExport,jdbcType=INTEGER},
      apply_user_id = #{applyUserId,jdbcType=VARCHAR},
      apply_user_name = #{applyUserName,jdbcType=VARCHAR},
      apply_time = #{applyTime,jdbcType=TIMESTAMP},
      update_user_id = #{updateUserId,jdbcType=VARCHAR},
      update_user_name = #{updateUserName,jdbcType=VARCHAR},
      update_time = #{updateTime,jdbcType=TIMESTAMP},
      make_invoice_user_id = #{makeInvoiceUserId,jdbcType=VARCHAR},
      make_invoice_user_name = #{makeInvoiceUserName,jdbcType=VARCHAR},
      make_invoice_status = #{makeInvoiceStatus,jdbcType=TINYINT},
      make_invoice_time = #{makeInvoiceTime,jdbcType=TIMESTAMP},
      express_company_id = #{expressCompanyId,jdbcType=BIGINT},
      express_company_name = #{expressCompanyName,jdbcType=VARCHAR},
      express_no = #{expressNo,jdbcType=VARCHAR},
      remark = #{remark,jdbcType=VARCHAR},
      mail_tick_time = #{mailTickTime,jdbcType=TIMESTAMP},
      mail_tick_user_id = #{mailTickUserId,jdbcType=VARCHAR},
      mail_tick_status = #{mailTickStatus,jdbcType=TINYINT},
      sync_time = #{syncTime,jdbcType=TIMESTAMP},
      storage_status = #{storageStatus,jdbcType=TINYINT},
      storage_time = #{storageTime,jdbcType=TIMESTAMP},
      jc_order_count = #{jcOrderCount,jdbcType=INTEGER},
      unified_order_count = #{unifiedOrderCount,jdbcType=INTEGER},
      unified_apply_amount = #{unifiedApplyAmount,jdbcType=DECIMAL},
      unified_rebate_amount = #{unifiedRebateAmount,jdbcType=DECIMAL},
      sys_platform_ext_invoice_snapshot = #{sysPlatformExtInvoiceSnapshot,jdbcType=LONGVARCHAR}
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="cn.superdesk.uniorder.dao.entity.thirdpart.qchjc.invoice.QchjcInvoiceApplySupplierEntity">
    update qchjc_invoice_apply_supplier
    set accounting_order_type = #{accountingOrderType,jdbcType=TINYINT},
      accounting_order_id = #{accountingOrderId,jdbcType=BIGINT},
      accounting_order_sn = #{accountingOrderSn,jdbcType=VARCHAR},
      dim_create_by = #{dimCreateBy,jdbcType=TINYINT},
      invoice_sn = #{invoiceSn,jdbcType=VARCHAR},
      invoice_apply_sn = #{invoiceApplySn,jdbcType=VARCHAR},
      invoice_apply_amount = #{invoiceApplyAmount,jdbcType=DECIMAL},
      free_amount = #{freeAmount,jdbcType=DECIMAL},
      un_accounting_amount = #{unAccountingAmount,jdbcType=DECIMAL},
      jc_un_accounting_amount = #{jcUnAccountingAmount,jdbcType=DECIMAL},
      real_amount = #{realAmount,jdbcType=DECIMAL},
      rebate_amount = #{rebateAmount,jdbcType=DECIMAL},
      invoice_type = #{invoiceType,jdbcType=TINYINT},
      invoice_mode = #{invoiceMode,jdbcType=VARCHAR},
      sys_platform_ext_invoice_id = #{sysPlatformExtInvoiceId,jdbcType=BIGINT},
      tax_rate = #{taxRate,jdbcType=VARCHAR},
      invoice_number = #{invoiceNumber,jdbcType=VARCHAR},
      sale_id = #{saleId,jdbcType=VARCHAR},
      sale_name = #{saleName,jdbcType=VARCHAR},
      sale_is_export = #{saleIsExport,jdbcType=INTEGER},
      apply_user_id = #{applyUserId,jdbcType=VARCHAR},
      apply_user_name = #{applyUserName,jdbcType=VARCHAR},
      apply_time = #{applyTime,jdbcType=TIMESTAMP},
      update_user_id = #{updateUserId,jdbcType=VARCHAR},
      update_user_name = #{updateUserName,jdbcType=VARCHAR},
      update_time = #{updateTime,jdbcType=TIMESTAMP},
      make_invoice_user_id = #{makeInvoiceUserId,jdbcType=VARCHAR},
      make_invoice_user_name = #{makeInvoiceUserName,jdbcType=VARCHAR},
      make_invoice_status = #{makeInvoiceStatus,jdbcType=TINYINT},
      make_invoice_time = #{makeInvoiceTime,jdbcType=TIMESTAMP},
      express_company_id = #{expressCompanyId,jdbcType=BIGINT},
      express_company_name = #{expressCompanyName,jdbcType=VARCHAR},
      express_no = #{expressNo,jdbcType=VARCHAR},
      remark = #{remark,jdbcType=VARCHAR},
      mail_tick_time = #{mailTickTime,jdbcType=TIMESTAMP},
      mail_tick_user_id = #{mailTickUserId,jdbcType=VARCHAR},
      mail_tick_status = #{mailTickStatus,jdbcType=TINYINT},
      sync_time = #{syncTime,jdbcType=TIMESTAMP},
      storage_status = #{storageStatus,jdbcType=TINYINT},
      storage_time = #{storageTime,jdbcType=TIMESTAMP},
      jc_order_count = #{jcOrderCount,jdbcType=INTEGER},
      unified_order_count = #{unifiedOrderCount,jdbcType=INTEGER},
      unified_apply_amount = #{unifiedApplyAmount,jdbcType=DECIMAL},
      unified_rebate_amount = #{unifiedRebateAmount,jdbcType=DECIMAL}
    where id = #{id,jdbcType=BIGINT}
  </update>

  <select id="queryQchjcInvoiceApplySupplierVoListByAccountingOrderSn" resultType="cn.superdesk.uniorder.dto.vo.thirdpart.qchjc.invoice.QchjcInvoiceSupplierApplyVo">
    SELECT
      t1.invoice_sn AS invoiceSn,
      t2.sale_name AS saleName,
      t1.apply_user_name AS applyUserName,
      t1.invoice_apply_amount AS invoiceApplyAmount,
      t1.rebate_amount AS rebateAmount,
      t1.invoice_apply_sn AS invoiceApplySn,
      t1.invoice_number AS invoiceNumber,
      t1.jc_order_count AS jcOrderCount,
      CASE
        t1.invoice_type
        WHEN 1 THEN
          '电子普通发票'
        WHEN 2 THEN
          '纸质专用发票'
        WHEN 3 THEN
          '纸质普通发票'
        WHEN 4 THEN
          '电子专用发票'
        END AS invoiceType,
      CASE
        t1.invoice_mode
        WHEN 'offLine' THEN
          '线下开票'
        WHEN 'szhtxxElectronicInvoice' THEN
          '深圳航天信息电子发票'
        WHEN 'szhtxxPaperInvoice' THEN
          '深圳航信纸质发票' ELSE ''
        END AS invoiceMode,
      t1.unified_order_count AS unifiedOrderCount,
      t1.unified_apply_amount AS unifiedApplyAmount,
      t1.unified_rebate_amount AS unifiedRebateAmount
    FROM
      qchjc_invoice_apply_supplier t1
        LEFT JOIN qchjc_accounting_unified_supplier t2 ON t1.accounting_order_sn = t2.accounting_order_sn
    WHERE
      t1.accounting_order_sn = #{accountingOrderSn,jdbcType=VARCHAR}
  </select>

</mapper>