<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.dxhy.domestic.dao.DomesticCustomsRecordDao">
    <delete databaseId="mysql" id="deleteByPrimaryKey" parameterType="java.lang.Long">
        delete
        from t_dx_customs_record
        where id = #{id,jdbcType=BIGINT}
    </delete>
    <delete databaseId="oracle" id="deleteByPrimaryKey" parameterType="java.lang.Long">
        delete
        from t_dx_customs_record
        where id = #{id,jdbcType=BIGINT}
    </delete>
    <resultMap id="BaseResultMap" type="com.dxhy.domestic.entity.TdxCustomsRecord">
        <id column="id" jdbcType="BIGINT" property="id"/>
        <result column="gf_name" jdbcType="VARCHAR" property="gfName"/>
        <result column="gf_tax_no" jdbcType="VARCHAR" property="gfTaxNo"/>
        <result column="customs_code" jdbcType="VARCHAR" property="customsCode"/>
        <result column="payer_one_taxno" jdbcType="VARCHAR" property="payerOneTaxno"/>
        <result column="payer_one_name" jdbcType="VARCHAR" property="payerOneName"/>
        <result column="payer_two_taxno" jdbcType="VARCHAR" property="payerTwoTaxno"/>
        <result column="payer_two_name" jdbcType="VARCHAR" property="payerTwoName"/>
        <result column="fill_in_date" jdbcType="TIMESTAMP" property="fillInDate"/>
        <result column="tax_amount" jdbcType="VARCHAR" property="taxAmount"/>
        <result column="yx_tax_amount" jdbcType="VARCHAR" property="yxTaxAmount"/>
        <result column="import_port_code" jdbcType="VARCHAR" property="importPortCode"/>
        <result column="income_office" jdbcType="VARCHAR" property="incomeOffice"/>
        <result column="applicant_code" jdbcType="VARCHAR" property="applicantCode"/>
        <result column="bill_code" jdbcType="VARCHAR" property="billCode"/>
        <result column="mode_type" jdbcType="VARCHAR" property="modeType"/>
        <result column="budget_code" jdbcType="VARCHAR" property="budgetCode"/>
        <result column="treasury_code" jdbcType="VARCHAR" property="treasuryCode"/>
        <result column="contract_code" jdbcType="VARCHAR" property="contractCode"/>
        <result column="means_transport" jdbcType="VARCHAR" property="meansTransport"/>
        <result column="payment_period" jdbcType="VARCHAR" property="paymentPeriod"/>
        <result column="delivery_code" jdbcType="VARCHAR" property="deliveryCode"/>
        <result column="data_sources" jdbcType="VARCHAR" property="dataSources"/>
        <result column="create_date" jdbcType="TIMESTAMP" property="createDate"/>
        <result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/>
        <result column="data_type" jdbcType="VARCHAR" property="dataType"/>
        <result column="collect_upload_status" jdbcType="VARCHAR" property="collectUploadStatus"/>
        <result column="audit_status" jdbcType="VARCHAR" property="auditStatus"/>
        <result column="apply_check" jdbcType="VARCHAR" property="applyCheck"/>
        <result column="fail_reason" jdbcType="VARCHAR" property="failReason"/>
        <result column="check_status" jdbcType="VARCHAR" property="checkStatus"/>
        <result column="qs_status" jdbcType="VARCHAR" property="qsStatus"/>
        <result column="qs_date" jdbcType="TIMESTAMP" property="qsDate"/>
        <result column="qs_type" jdbcType="VARCHAR" property="qsType"/>
        <result column="qs_user" jdbcType="VARCHAR" property="qsUser"/>
        <result column="rzh_date" jdbcType="TIMESTAMP" property="rzhDate"/>
        <result column="rzh_belong_date" jdbcType="VARCHAR" property="rzhBelongDate"/>
        <result column="confirm_date" jdbcType="TIMESTAMP" property="confirmDate"/>
        <result column="rzh_type" jdbcType="VARCHAR" property="rzhType"/>
        <result column="rzh_yesorno" jdbcType="VARCHAR" property="rzhYesorno"/>
        <result column="rzh_back_msg" jdbcType="VARCHAR" property="rzhBackMsg"/>
        <result column="dqskssq" jdbcType="VARCHAR" property="dqskssq"/>
        <result column="gxjzr" jdbcType="VARCHAR" property="gxjzr"/>
        <result column="gxfwq" jdbcType="VARCHAR" property="gxfwq"/>
        <result column="gxfwz" jdbcType="VARCHAR" property="gxfwz"/>
        <result column="detail_yesorno" jdbcType="VARCHAR" property="detailYesorno"/>
        <result column="auth_status" jdbcType="VARCHAR" property="authStatus"/>
        <result column="send_date" jdbcType="TIMESTAMP" property="sendDate"/>
        <result column="rzlx" jdbcType="VARCHAR" property="rzlx"/>
        <result column="confirm_user" jdbcType="VARCHAR" property="confirmUser"/>
        <result column="dept_id" jdbcType="VARCHAR" property="deptId"/>
        <result column="dept_name" jdbcType="VARCHAR" property="deptName"/>
        <result column="glzt" jdbcType="VARCHAR" property="glzt"/>
        <result column="xxly" jdbcType="VARCHAR" property="xxly"/>
        <result column="cxrz_status" jdbcType="VARCHAR" property="cxrzStatus"/>
        <result column="cxrz_date" jdbcType="TIMESTAMP" property="cxrzDate"/>
        <result column="cxrz_current_period" jdbcType="VARCHAR" property="cxrzCurrentPeriod"/>
        <result column="bdk_status" jdbcType="VARCHAR" property="bdkStatus"/>
        <result column="cxbdk_status" jdbcType="VARCHAR" property="cxbdkStatus"/>
        <result column="cxbdk_date" jdbcType="TIMESTAMP" property="cxbdkDate"/>
        <result column="bdk_current_period" jdbcType="VARCHAR" property="bdkCurrentPeriod"/>
        <result column="entry_discrepancy" jdbcType="VARCHAR" property="entryDiscrepancy"/>
        <result column="customs_scan_id" jdbcType="VARCHAR" property="customsScanId"/>
        <result column="export_mark" jdbcType="VARCHAR" property="exportMark"/>
        <result column="entry_date" jdbcType="TIMESTAMP" property="entryDate"/>
        <result column="entry_user" jdbcType="VARCHAR" property="entryUser"/>
    </resultMap>
    <select databaseId="mysql" id="selectByPrimaryKey" parameterType="java.lang.Long"
            resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"/>
        from t_dx_customs_record
        where id = #{id,jdbcType=BIGINT}
    </select>
    <select databaseId="mysql" id="queryManualConfirmList"
            parameterType="com.dxhy.domestic.model.vo.BaseCustomsVO" resultType="java.util.Map">
        select
        id as id,
        customs_code as customsCode,
        DATE_FORMAT(fill_in_date,'%Y-%m-%d') fillInDate,
        gf_name as gfName,
        gf_tax_no as gfTaxNo,
        tax_amount as taxAmount,
        yx_tax_amount as yxTaxAmount,
        data_sources as dataSources,
        qs_status as qsStatus,
        DATE_FORMAT(qs_date,'%Y-%m-%d') qsDate,
        qs_type as qsType,
        qs_user as qsUser,
        apply_check as applyCheck,
        audit_status as auditStatus,
        rzh_belong_date as rzhBelongDate,
        glzt as glzt,
        entry_discrepancy as entryDiscrepancy,
        dept_name as deptName,
        sn_voucher_number as snVoucherNumber,
        posting_time as postingTime,
        image_id as imageNumber,
        account_period as accountPeriod,
        bzdh,
        bzr,
        inaccount_status as inAccountStatus,
        comp_code as compCode
        from t_dx_customs_record
        where
        <include refid="queryManualConfirm_mysql"/>
    </select>
    <select databaseId="mysql" id="queryManualConfirmSum"
            parameterType="com.dxhy.domestic.model.vo.BaseCustomsVO" resultType="java.util.Map">
        select
        count(1) as hjsl,
        sum(tax_amount) as hjse
        from t_dx_customs_record
        where
        <include refid="queryManualConfirm_mysql"/>
    </select>
    <select databaseId="mysql"
            id="queryCustomsRefundConfirmList" parameterType="com.dxhy.domestic.model.vo.BaseCustomsVO"
            resultType="java.util.Map">
        select
        id as id,
        customs_code as customsCode,
        DATE_FORMAT(fill_in_date,'%Y-%m-%d') as fillInDate,
        gf_name as gfName,
        glzt, dqskssq, rzlx,
        gf_tax_no as gfTaxNo,
        tax_amount as taxAmount,
        yx_tax_amount as yxTaxAmount,
        data_sources as dataSources,
        qs_status as qsStatus,
        DATE_FORMAT(qs_date,'%Y-%m-%d') as qsDate,
        qs_type as qsType,
        qs_user as qsUser,
        apply_check as applyCheck,
        audit_status as auditStatus,
        DATE_FORMAT(rzh_date,'%Y-%m-%d')   as rzhDate,
        rzh_yesorno as rzhYesorno,
        auth_status as authStatus,
        confirm_user as confirmUser,
        rzh_belong_date as rzhBelongDate,
        dept_name as deptName,
        sn_voucher_number as snVoucherNumber,
        posting_time as postingTime,
        image_id as imageNumber,
        account_period as accountPeriod,
        bzdh,
        bzr,
        inaccount_status as inAccountStatus,
        comp_code as compCode
        from t_dx_customs_record
        where
        <include refid="queryCustomsRefundConfirm_mysql"/>
    </select>
    <select databaseId="mysql" id="queryCustomsRefundConfirmSum"
            parameterType="com.dxhy.domestic.model.vo.BaseCustomsVO" resultType="java.util.Map">
        select
        count(1) as hjsl,
        sum(tax_amount) as hjse
        from t_dx_customs_record
        where
        <include refid="queryCustomsRefundConfirm_mysql"/>
    </select>
    <select databaseId="mysql" id="queryRefundCountPage"
            parameterType="com.dxhy.domestic.model.vo.BaseCustomsVO" resultType="java.util.Map">
        select d.gf_tax_no as gfTaxNo,
        d.rzh_belong_date as rzhBelongDate,
        c.taxname as taxname,
        sum(d.tax_amount) as taxAmount from (
        SELECT
        p.gf_tax_no,
        p.rzh_belong_date,
        sum(p.tax_amount) AS tax_amount
        FROM
        t_dx_customs_record p
        WHERE p.rzh_yesorno = '1'
        and p.rzlx in ('2','3')
        and p.data_type = '17'
        <if test="queryParams.gfTaxNo!=null  and queryParams.gfTaxNo.size>0">
            and p.gf_tax_no in
            <foreach close=")" collection="queryParams.gfTaxNo" index="index" item="item" open="("
                     separator=",">
                #{item,jdbcType=VARCHAR}
            </foreach>
        </if>
        <if test="queryParams.gfsh!=null and queryParams.gfsh!=''">
            and p.gf_tax_no = #{queryParams.gfsh}
        </if>
        <if test="queryParams.belongDate!=null and queryParams.belongDate!=''">
            AND p.rzh_belong_date = #{queryParams.belongDate}
        </if>
        GROUP BY
        p.rzh_belong_date, p.gf_tax_no
        union
        SELECT
        p.gf_tax_no,
        p.rzh_belong_date,
        sum(p.tax_amount) AS tax_amount
        FROM
        t_dx_record_invoice p
        WHERE p.rzh_yesorno = '1'
        and p.rzlx in ('2','3')
        and p.invoice_type in('01','08','31')
        <if test="queryParams.gfTaxNo!=null  and queryParams.gfTaxNo.size>0">
            and p.gf_tax_no in
            <foreach close=")" collection="queryParams.gfTaxNo" index="index" item="item" open="("
                     separator=",">
                #{item,jdbcType=VARCHAR}
            </foreach>
        </if>
        <if test="queryParams.gfsh!=null and queryParams.gfsh!=''">
            and p.gf_tax_no = #{queryParams.gfsh}
        </if>
        <if test="queryParams.belongDate!=null and queryParams.belongDate!=''">
            AND p.rzh_belong_date = #{queryParams.belongDate}
        </if>
        GROUP BY
        p.rzh_belong_date, p.gf_tax_no) d left join
        t_dx_tax_current c on d.gf_tax_no = c.taxno

        GROUP BY d.gf_tax_no, d.rzh_belong_date
    </select>
    <select databaseId="mysql" id="queryRefundCountDetailPage"
            parameterType="com.dxhy.domestic.model.vo.BaseCustomsVO" resultType="java.util.Map">
        SELECT d.invoice_type   AS invoiceType,
               d.invoice_amount AS invoiceAmount,
               d.tax_amount     AS taxAmount,
               d.inv_count      AS invCount
        FROM (
                 SELECT p.data_type       AS invoice_type,
                        sum(p.tax_amount) AS tax_amount,
                        0                 AS invoice_amount,
                        count(1)          AS inv_count
                 FROM t_dx_customs_record p
                 WHERE p.rzh_yesorno = '1'
                   and p.rzlx in ('2', '3')
                   and p.gf_tax_no = #{queryParams.gfsh}
                   and p.rzh_belong_date = #{queryParams.belongDate}
                   and p.data_type = '17'
                 GROUP BY p.data_type
                 UNION
                 SELECT p.invoice_type,
                        sum(p.tax_amount)     AS tax_amount,
                        sum(p.invoice_amount) AS invoice_amount,
                        count(1)              AS inv_count
                 FROM t_dx_record_invoice p
                 WHERE p.rzh_yesorno = '1'
                   and p.rzlx in ('2', '3')
                   and p.gf_tax_no = #{queryParams.gfsh}
                   AND p.rzh_belong_date = #{queryParams.belongDate}
                   and p.invoice_type in ('01', '08','31')
                 GROUP BY p.invoice_type
             ) d
    </select>
    <select databaseId="oracle" id="selectByPrimaryKey" parameterType="java.lang.Long"
            resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"/>
        from t_dx_customs_record
        where id = #{id,jdbcType=BIGINT}
    </select>
    <select databaseId="oracle" id="queryManualConfirmList"
            parameterType="com.dxhy.domestic.model.vo.BaseCustomsVO" resultType="java.util.Map">
        select
        id as "id",
        customs_code as "customsCode",
        to_date(fill_in_date, 'yyyy-MM-dd') as "fillInDate",
        to_date(qs_date, 'yyyy-MM-dd') as "qsDate",
        gf_name as "gfName",
        gf_tax_no as "gfTaxNo",
        tax_amount as "taxAmount",
        yx_tax_amount as "yxTaxAmount",
        data_sources as "dataSources",
        qs_status as "qsStatus",
        qs_type as "qsType",
        qs_user as "qsUser",
        apply_check as "applyCheck",
        audit_status as "auditStatus",
        rzh_belong_date as "rzhBelongDate",
        glzt as "glzt",
        entry_discrepancy as "entryDiscrepancy",
        dept_name as "deptName"
        from t_dx_customs_record
        where
        <include refid="queryManualConfirm_oracle"/>
    </select>
    <select databaseId="oracle" id="queryManualConfirmSum"
            parameterType="com.dxhy.domestic.model.vo.BaseCustomsVO" resultType="java.util.Map">
        select
        count(1) as hjsl,
        sum(tax_amount) as hjse
        from t_dx_customs_record
        where
        <include refid="queryManualConfirm_oracle"/>
    </select>

    <!-- ====================================== ↓↓↓↓↓↓ oracle ↓↓↓↓↓↓  ====================================== -->

    <select databaseId="oracle"
            id="queryCustomsRefundConfirmList" parameterType="com.dxhy.domestic.model.vo.BaseCustomsVO"
            resultType="java.util.Map">
        select
        id as "id",
        customs_code as "customsCode",
        to_date(fill_in_date, 'yyyy-MM-dd') as "fillInDate",
        to_date(qs_date, 'yyyy-MM-dd') as "qsDate",
        gf_name as "gfName",
        glzt as "glzt",
        dqskssq as "dqskssq",
        rzlx as "rzlx",
        gf_tax_no as "gfTaxNo",
        tax_amount as "taxAmount",
        yx_tax_amount as "yxTaxAmount",
        data_sources as "dataSources",
        qs_status as "qsStatus",
        qs_type as "qsType",
        qs_user as "qsUser",
        apply_check as "applyCheck",
        audit_status as "auditStatus",
        to_date(rzh_date, 'yyyy-MM-dd')  as "rzhDate",
        rzh_yesorno as "rzhYesorno",
        auth_status as "authStatus",
        confirm_user as "confirmUser",
        rzh_belong_date as "rzhBelongDate",
        dept_name as "deptName"
        from t_dx_customs_record
        where
        <include refid="queryCustomsRefundConfirm_oracle"/>
    </select>
    <select databaseId="oracle" id="queryCustomsRefundConfirmSum"
            parameterType="com.dxhy.domestic.model.vo.BaseCustomsVO" resultType="java.util.Map">
        select
        count(1) as hjsl,
        sum(tax_amount) as hjse
        from t_dx_customs_record
        where
        <include refid="queryCustomsRefundConfirm_oracle"/>
    </select>
    <select databaseId="oracle" id="queryRefundCountPage"
            parameterType="com.dxhy.domestic.model.vo.BaseCustomsVO" resultType="java.util.Map">
        select d.gf_tax_no as "gfTaxNo",
        d.rzh_belong_date as "rzhBelongDate",
        c.taxname as "taxname",
        sum(d.tax_amount) as "taxAmount" from (
        SELECT
        p.gf_tax_no,
        p.rzh_belong_date,
        sum(p.tax_amount) AS tax_amount
        FROM
        t_dx_customs_record p
        WHERE p.rzh_yesorno = '1'
        and p.rzlx in ('2','3')
        and p.data_type = '17'
        <if test="queryParams.gfTaxNo!=null  and queryParams.gfTaxNo.size>0">
            and p.gf_tax_no in
            <foreach close=")" collection="queryParams.gfTaxNo" index="index" item="item" open="("
                     separator=",">
                #{item,jdbcType=VARCHAR}
            </foreach>
        </if>
        <if test="queryParams.gfsh!=null and queryParams.gfsh!=''">
            and p.gf_tax_no = #{queryParams.gfsh}
        </if>
        <if test="queryParams.belongDate!=null and queryParams.belongDate!=''">
            AND p.rzh_belong_date = #{queryParams.belongDate}
        </if>
        GROUP BY
        p.rzh_belong_date, p.gf_tax_no
        union
        SELECT
        p.gf_tax_no,
        p.rzh_belong_date,
        sum(p.tax_amount) AS tax_amount
        FROM
        t_dx_record_invoice p
        WHERE p.rzh_yesorno = '1'
        and p.rzlx in ('2','3')
        and p.invoice_type in('01','08')
        <if test="queryParams.gfTaxNo!=null  and queryParams.gfTaxNo.size>0">
            and p.gf_tax_no in
            <foreach close=")" collection="queryParams.gfTaxNo" index="index" item="item" open="("
                     separator=",">
                #{item,jdbcType=VARCHAR}
            </foreach>
        </if>
        <if test="queryParams.gfsh!=null and queryParams.gfsh!=''">
            and p.gf_tax_no = #{queryParams.gfsh}
        </if>
        <if test="queryParams.belongDate!=null and queryParams.belongDate!=''">
            AND p.rzh_belong_date = #{queryParams.belongDate}
        </if>
        GROUP BY
        p.rzh_belong_date, p.gf_tax_no) d left join
        t_dx_tax_current c on d.gf_tax_no = c.taxno

        GROUP BY d.gf_tax_no, d.rzh_belong_date,c.taxname
    </select>
    <select databaseId="oracle" id="queryRefundCountDetailPage"
            parameterType="com.dxhy.domestic.model.vo.BaseCustomsVO" resultType="java.util.Map">
        SELECT d.invoice_type   AS "invoiceType",
               d.invoice_amount AS "invoiceAmount",
               d.tax_amount     AS "taxAmount",
               d.inv_count      AS "invCount"
        FROM (
                 SELECT p.data_type       AS invoice_type,
                        sum(p.tax_amount) AS tax_amount,
                        0                 AS invoice_amount,
                        count(1)          AS inv_count
                 FROM t_dx_customs_record p
                 WHERE p.rzh_yesorno = '1'
                   and p.rzlx in ('2', '3')
                   and p.gf_tax_no = #{queryParams.gfsh}
                   and p.rzh_belong_date = #{queryParams.belongDate}
                   and p.data_type = '17'
                 GROUP BY p.data_type
                 UNION
                 SELECT p.invoice_type,
                        sum(p.tax_amount)     AS tax_amount,
                        sum(p.invoice_amount) AS invoice_amount,
                        count(1)              AS inv_count
                 FROM t_dx_record_invoice p
                 WHERE p.rzh_yesorno = '1'
                   and p.rzlx in ('2', '3')
                   and p.gf_tax_no = #{queryParams.gfsh}
                   AND p.rzh_belong_date = #{queryParams.belongDate}
                   and p.invoice_type in ('01', '08','31')
                 GROUP BY p.invoice_type
             ) d
    </select>
    <sql id="Base_Column_List">
        id
        , gf_name, gf_tax_no, customs_code, payer_one_taxno, payer_one_name, payer_two_taxno,
    payer_two_name, fill_in_date, tax_amount, yx_tax_amount, import_port_code, income_office,
    applicant_code, bill_code, mode_type, budget_code, treasury_code, contract_code,
    means_transport, payment_period, delivery_code, data_sources, create_date, update_date,
    data_type, collect_upload_status, audit_status, apply_check, fail_reason, check_status,
    qs_status, qs_date, qs_type, qs_user, rzh_date, rzh_belong_date, confirm_date, rzh_type,
    rzh_yesorno, rzh_back_msg, dqskssq, gxjzr, gxfwq, gxfwz, detail_yesorno, auth_status,
    send_date, rzlx, confirm_user, dept_id, dept_name, glzt, xxly, cxrz_status, cxrz_date,
    cxrz_current_period, bdk_status, cxbdk_status, cxbdk_date, bdk_current_period, entry_discrepancy,
    customs_scan_id, export_mark, entry_date, entry_user
    </sql>
    <sql id="queryManualConfirm_mysql">
        rzh_yesorno = '0' and auth_status in ('0','5','6')
        and data_type = '17'
        and export_mark='0'
        and fill_in_date &gt;= '2017-01-01'
        and gf_tax_no = #{queryParams.gfsh}
        and (comp_code = #{queryParams.companyCode} or comp_code = '' or comp_code is null)
        <if test="queryParams.customsCode!=null and queryParams.customsCode!=''">
            and customs_code = #{queryParams.customsCode}
        </if>
        <if test="queryParams.fillInDateStart!=null and queryParams.fillInDateStart!=''">
            and fill_in_date &gt;= #{queryParams.fillInDateStart}
        </if>
        <if test="queryParams.fillInDateEnd!=null and queryParams.fillInDateEnd!=''">
            and fill_in_date &lt;= CONCAT(substring(#{queryParams.fillInDateEnd},1,10),' 23:59:59')
        </if>
        <if test="queryParams.belongDateStart!=null and queryParams.belongDateStart!=''">
            and fill_in_date &gt;= #{queryParams.belongDateStart}
        </if>
        <if test="queryParams.belongDateEnd!=null and queryParams.belongDateEnd!=''">
            and fill_in_date &lt;= CONCAT(substring(#{queryParams.belongDateEnd},1,10),' 23:59:59')
        </if>
<!--        <if test="queryParams.taxAmountStart!=null and queryParams.taxAmountStart!=''">-->
<!--            and cast(tax_amount as DECIMAL) &gt;= #{queryParams.taxAmountStart}-->
<!--        </if>-->
<!--        <if test="queryParams.taxAmountEnd!=null and queryParams.taxAmountEnd!=''">-->
<!--            and cast(tax_amount as DECIMAL) &lt;= #{queryParams.taxAmountEnd}-->
<!--        </if>-->
        <if test="queryParams.taxAmountStart!=null and queryParams.taxAmountStart!=''">
            and tax_amount &gt;= #{queryParams.taxAmountStart}+0
        </if>

        <if test="queryParams.taxAmountEnd!=null and queryParams.taxAmountEnd!=''">
            and tax_amount &lt;= #{queryParams.taxAmountEnd}+0
        </if>
        <if test="queryParams.signStatus!=null and queryParams.signStatus!=''">
            and qs_status = #{queryParams.signStatus}
        </if>
        <if test="queryParams.signDateStart!=null and queryParams.signDateStart!=''">
            and qs_date &gt;= #{queryParams.signDateStart}
        </if>
        <if test="queryParams.signDateEnd!=null and queryParams.signDateEnd!=''">
            and qs_date &lt;= CONCAT(substring(#{queryParams.signDateEnd},1,10),' 23:59:59')
        </if>

        <if
                test="queryParams.businessCode != '99' and queryParams.businessCode != null and queryParams.businessCode != '' and queryParams.businessCode != 'null' ">
            and dept_id = #{queryParams.businessCode}
        </if>
        <if test="queryParams.businessCode==''">
            and (dept_id is null or dept_id='' or dept_id='99')
        </if>
        <if
                test='queryParams.businessCode == "99" and queryParams.business != null and queryParams.business.size()>0'>
            and (dept_id in
            <foreach close="" collection="queryParams.business" index="index" item="item" open="("
                     separator=",">
                #{item.businessCode}
            </foreach>
            ) or (dept_id is null or dept_id='' or dept_id='99'))
        </if>
    </sql>
    <sql id="queryCustomsRefundConfirm_mysql">
        auth_status != '0' and (rzlx = '2' or rzlx = '3')
        and gf_tax_no = #{queryParams.gfsh}
        and (comp_code = #{queryParams.companyCode} or comp_code = '' or comp_code is null)
        <if test="queryParams.customsCode!=null and queryParams.customsCode!=''">
            and customs_code = #{queryParams.customsCode}
        </if>
        <if test="queryParams.fillInDateStart!=null and queryParams.fillInDateStart!=''">
            and fill_in_date &gt;= #{queryParams.fillInDateStart}
        </if>
        <if test="queryParams.fillInDateEnd!=null and queryParams.fillInDateEnd!=''">
            and fill_in_date &lt;= CONCAT(substring(#{queryParams.fillInDateEnd},1,10),' 23:59:59')
        </if>
        <if test="queryParams.belongDateStart!=null and queryParams.belongDateStart!=''">
            and fill_in_date &gt;= #{queryParams.belongDateStart}
        </if>
        <if test="queryParams.belongDateEnd!=null and queryParams.belongDateEnd!=''">
            and fill_in_date &lt;= CONCAT(substring(#{queryParams.belongDateEnd},1,10),' 23:59:59')
        </if>
<!--        <if test="queryParams.taxAmountStart!=null and queryParams.taxAmountStart!=''">-->
<!--            and cast(tax_amount as DECIMAL) &gt;= #{queryParams.taxAmountStart}-->
<!--        </if>-->
<!--        <if test="queryParams.taxAmountEnd!=null and queryParams.taxAmountEnd!=''">-->
<!--            and cast(tax_amount as DECIMAL) &lt;= #{queryParams.taxAmountEnd}-->
<!--        </if>-->
        <if test="queryParams.taxAmountStart!=null and queryParams.taxAmountStart!=''">
            and tax_amount &gt;= #{queryParams.taxAmountStart}+0
        </if>

        <if test="queryParams.taxAmountEnd!=null and queryParams.taxAmountEnd!=''">
            and tax_amount &lt;= #{queryParams.taxAmountEnd}+0
        </if>
        <if test="queryParams.signStatus!=null and queryParams.signStatus!=''">
            and qs_status = #{queryParams.signStatus}
        </if>
        <if test="queryParams.signDateStart!=null and queryParams.signDateStart!=''">
            and qs_date &gt;= #{queryParams.signDateStart}
        </if>
        <if test="queryParams.signDateEnd!=null and queryParams.signDateEnd!=''">
            and qs_date &lt;= CONCAT(substring(#{queryParams.signDateEnd},1,10),' 23:59:59')
        </if>
        <if test="queryParams.manageStatus!=null and queryParams.manageStatus!=''">
            and glzt = #{queryParams.manageStatus}
        </if>
        <if test="queryParams.confirmStatus!=null and queryParams.confirmStatus!=''">
            and rzh_yesorno = #{queryParams.confirmStatus}
        </if>
        <if test="queryParams.authStatus!=null and queryParams.authStatus!=''">
            and auth_status = #{queryParams.authStatus}
        </if>
        <if test="queryParams.confirmUser!=null and queryParams.confirmUser!=''">
            and confirm_user = #{queryParams.confirmUser}
        </if>
        <if test="queryParams.rzhDateStart!=null and queryParams.rzhDateStart!=''">
            and rzh_date &gt;= #{queryParams.rzhDateStart}
        </if>
        <if test="queryParams.rzhDateEnd!=null and queryParams.rzhDateEnd!=''">
            and rzh_date &lt;= CONCAT(substring(#{queryParams.rzhDateEnd},1,10),' 23:59:59')
        </if>
        <if test="queryParams.belongDate!=null and queryParams.belongDate!=''">
            and rzh_belong_date = #{queryParams.belongDate}
        </if>
        <if
                test="queryParams.businessCode != '99' and queryParams.businessCode != null and queryParams.businessCode != '' and queryParams.businessCode != 'null' ">
            and dept_id = #{queryParams.businessCode}
        </if>
        <if test="queryParams.businessCode==''">
            and (dept_id is null or dept_id='' or dept_id='99')
        </if>
        <if
                test='queryParams.businessCode == "99" and queryParams.business != null and queryParams.business.size()>0'>
            and (dept_id in
            <foreach close="" collection="queryParams.business" index="index" item="item" open="("
                     separator=",">
                #{item.businessCode}
            </foreach>
            ) or (dept_id is null or dept_id='' or dept_id='99'))
        </if>
        <if test="queryParams.company!=null and queryParams.company !=''">
            and company = #{queryParams.company}
        </if>
    </sql>
    <sql id="queryManualConfirm_oracle">
        rzh_yesorno = '0' and auth_status in ('0','5','6')
        and data_type = '17'
        and export_mark='0'
        and fill_in_date &gt;= to_date('2017-01-01', 'yyyy-MM-dd hh24:mi:ss')
        <if test="queryParams.gfTaxNo!=null  and queryParams.gfTaxNo.size>0">
            and gf_tax_no in
            <foreach close=")" collection="queryParams.gfTaxNo" index="index" item="item" open="("
                     separator=",">
                #{item,jdbcType=VARCHAR}
            </foreach>
        </if>
        <if test="queryParams.gfsh!=null and queryParams.gfsh!=''">
            and gf_tax_no = #{queryParams.gfsh}
        </if>
        <if test="queryParams.customsCode!=null and queryParams.customsCode!=''">
            and customs_code = #{queryParams.customsCode}
        </if>
        <if test="queryParams.fillInDateStart!=null and queryParams.fillInDateStart!=''">
            and fill_in_date &gt;= to_date(#{queryParams.fillInDateStart}, 'yyyy-MM-dd hh24:mi:ss')
        </if>
        <if test="queryParams.fillInDateEnd!=null and queryParams.fillInDateEnd!=''">
            and fill_in_date &lt;= to_date(substr(#{queryParams.fillInDateEnd},1,10) || ' 23:59:59',
            'yyyy-MM-dd hh24:mi:ss')
        </if>
        <if test="queryParams.belongDateStart!=null and queryParams.belongDateStart!=''">
            and fill_in_date &gt;= to_date(#{queryParams.belongDateStart}, 'yyyy-MM-dd hh24:mi:ss')
        </if>
        <if test="queryParams.belongDateEnd!=null and queryParams.belongDateEnd!=''">
            and fill_in_date &lt;= to_date(substr(#{queryParams.belongDateEnd},1,10) || ' 23:59:59',
            'yyyy-MM-dd hh24:mi:ss')
        </if>
<!--        <if test="queryParams.taxAmountStart!=null and queryParams.taxAmountStart!=''">-->
<!--            and cast(tax_amount as DECIMAL) &gt;= #{queryParams.taxAmountStart}-->
<!--        </if>-->
<!--        <if test="queryParams.taxAmountEnd!=null and queryParams.taxAmountEnd!=''">-->
<!--            and cast(tax_amount as DECIMAL) &lt;= #{queryParams.taxAmountEnd}-->
<!--        </if>-->
        <if test="queryParams.taxAmountStart!=null and queryParams.taxAmountStart!=''">
            and tax_amount &gt;= #{queryParams.taxAmountStart}+0
        </if>

        <if test="queryParams.taxAmountEnd!=null and queryParams.taxAmountEnd!=''">
            and tax_amount &lt;= #{queryParams.taxAmountEnd}+0
        </if>
        <if test="queryParams.signStatus!=null and queryParams.signStatus!=''">
            and qs_status = #{queryParams.signStatus}
        </if>
        <if test="queryParams.signDateStart!=null and queryParams.signDateStart!=''">
            and qs_date &gt;= to_date(#{queryParams.signDateStart}, 'yyyy-MM-dd hh24:mi:ss')
        </if>
        <if test="queryParams.signDateEnd!=null and queryParams.signDateEnd!=''">
            and qs_date &lt;= to_date(substr(#{queryParams.signDateEnd},1,10) || ' 23:59:59', 'yyyy-MM-dd
            hh24:mi:ss')
        </if>

        <if
                test="queryParams.businessCode != '99' and queryParams.businessCode != null and queryParams.businessCode != '' and queryParams.businessCode != 'null' ">
            and dept_id = #{queryParams.businessCode}
        </if>
        <if test="queryParams.businessCode==''">
            and (dept_id is null or dept_id='' or dept_id='99')
        </if>
        <if
                test='queryParams.businessCode == "99" and queryParams.business != null and queryParams.business.size()>0'>
            and (dept_id in
            <foreach close="" collection="queryParams.business" index="index" item="item" open="("
                     separator=",">
                #{item.businessCode}
            </foreach>
            ) or (dept_id is null or dept_id='' or dept_id='99'))
        </if>
    </sql>
    <sql id="queryCustomsRefundConfirm_oracle">
        auth_status != '0' and (rzlx = '2' or rzlx = '3')
        <if test="queryParams.gfTaxNo!=null  and queryParams.gfTaxNo.size>0">
            and gf_tax_no in
            <foreach close=")" collection="queryParams.gfTaxNo" index="index" item="item" open="("
                     separator=",">
                #{item,jdbcType=VARCHAR}
            </foreach>
        </if>
        <if test="queryParams.gfsh!=null and queryParams.gfsh!=''">
            and gf_tax_no = #{queryParams.gfsh}
        </if>
        <if test="queryParams.customsCode!=null and queryParams.customsCode!=''">
            and customs_code = #{queryParams.customsCode}
        </if>
        <if test="queryParams.fillInDateStart!=null and queryParams.fillInDateStart!=''">
            and fill_in_date &gt;= to_date(#{queryParams.fillInDateStart}, 'yyyy-MM-dd hh24:mi:ss')
        </if>
        <if test="queryParams.fillInDateEnd!=null and queryParams.fillInDateEnd!=''">
            and fill_in_date &lt;= to_date(substr(#{queryParams.fillInDateEnd},1,10) || ' 23:59:59',
            'yyyy-MM-dd hh24:mi:ss')
        </if>
        <if test="queryParams.belongDateStart!=null and queryParams.belongDateStart!=''">
            and fill_in_date &gt;= to_date(#{queryParams.belongDateStart}, 'yyyy-MM-dd hh24:mi:ss')
        </if>
        <if test="queryParams.belongDateEnd!=null and queryParams.belongDateEnd!=''">
            and fill_in_date &lt;= to_date(substr(#{queryParams.belongDateEnd},1,10) || ' 23:59:59',
            'yyyy-MM-dd hh24:mi:ss')
        </if>
<!--        <if test="queryParams.taxAmountStart!=null and queryParams.taxAmountStart!=''">-->
<!--            and cast(tax_amount as DECIMAL) &gt;= #{queryParams.taxAmountStart}-->
<!--        </if>-->
<!--        <if test="queryParams.taxAmountEnd!=null and queryParams.taxAmountEnd!=''">-->
<!--            and cast(tax_amount as DECIMAL) &lt;= #{queryParams.taxAmountEnd}-->
<!--        </if>-->
        <if test="queryParams.taxAmountStart!=null and queryParams.taxAmountStart!=''">
            and tax_amount &gt;= #{queryParams.taxAmountStart}+0
        </if>

        <if test="queryParams.taxAmountEnd!=null and queryParams.taxAmountEnd!=''">
            and tax_amount &lt;= #{queryParams.taxAmountEnd}+0
        </if>
        <if test="queryParams.signStatus!=null and queryParams.signStatus!=''">
            and qs_status = #{queryParams.signStatus}
        </if>
        <if test="queryParams.signDateStart!=null and queryParams.signDateStart!=''">
            and qs_date &gt;= to_date(#{queryParams.signDateStart}, 'yyyy-MM-dd hh24:mi:ss')
        </if>
        <if test="queryParams.signDateEnd!=null and queryParams.signDateEnd!=''">
            and qs_date &lt;= to_date(substr(#{queryParams.signDateEnd},1,10) || ' 23:59:59', 'yyyy-MM-dd
            hh24:mi:ss')
        </if>
        <if test="queryParams.manageStatus!=null and queryParams.manageStatus!=''">
            and glzt = #{queryParams.manageStatus}
        </if>
        <if test="queryParams.confirmStatus!=null and queryParams.confirmStatus!=''">
            and rzh_yesorno = #{queryParams.confirmStatus}
        </if>
        <if test="queryParams.authStatus!=null and queryParams.authStatus!=''">
            and auth_status = #{queryParams.authStatus}
        </if>
        <if test="queryParams.confirmUser!=null and queryParams.confirmUser!=''">
            and confirm_user = #{queryParams.confirmUser}
        </if>
        <if test="queryParams.rzhDateStart!=null and queryParams.rzhDateStart!=''">
            and rzh_date &gt;= to_date(#{queryParams.rzhDateStart}, 'yyyy-MM-dd hh24:mi:ss')
        </if>
        <if test="queryParams.rzhDateEnd!=null and queryParams.rzhDateEnd!=''">
            and rzh_date &lt;= to_date(substr(#{queryParams.rzhDateEnd},1,10) || ' 23:59:59', 'yyyy-MM-dd
            hh24:mi:ss')
        </if>
        <if test="queryParams.belongDate!=null and queryParams.belongDate!=''">
            and rzh_belong_date = #{queryParams.belongDate}
        </if>
        <if
                test="queryParams.businessCode != '99' and queryParams.businessCode != null and queryParams.businessCode != '' and queryParams.businessCode != 'null' ">
            and dept_id = #{queryParams.businessCode}
        </if>
        <if test="queryParams.businessCode==''">
            and (dept_id is null or dept_id='' or dept_id='99')
        </if>
        <if
                test='queryParams.businessCode == "99" and queryParams.business != null and queryParams.business.size()>0'>
            and (dept_id in
            <foreach close="" collection="queryParams.business" index="index" item="item" open="("
                     separator=",">
                #{item.businessCode}
            </foreach>
            ) or (dept_id is null or dept_id='' or dept_id='99'))
        </if>
        <if test="queryParams.company!=null and queryParams.company !=''">
            and company = #{queryParams.company}
        </if>
    </sql>
    <update databaseId="mysql" id="updateByPrimaryKeySelective"
            parameterType="com.dxhy.domestic.entity.TdxCustomsRecord">
        update t_dx_customs_record
        <set>
            <if test="gfName != null">
                gf_name = #{gfName,jdbcType=VARCHAR},
            </if>
            <if test="gfTaxNo != null">
                gf_tax_no = #{gfTaxNo,jdbcType=VARCHAR},
            </if>
            <if test="customsCode != null">
                customs_code = #{customsCode,jdbcType=VARCHAR},
            </if>
            <if test="payerOneTaxno != null">
                payer_one_taxno = #{payerOneTaxno,jdbcType=VARCHAR},
            </if>
            <if test="payerOneName != null">
                payer_one_name = #{payerOneName,jdbcType=VARCHAR},
            </if>
            <if test="payerTwoTaxno != null">
                payer_two_taxno = #{payerTwoTaxno,jdbcType=VARCHAR},
            </if>
            <if test="payerTwoName != null">
                payer_two_name = #{payerTwoName,jdbcType=VARCHAR},
            </if>
            <if test="fillInDate != null">
                fill_in_date = #{fillInDate,jdbcType=TIMESTAMP},
            </if>
            <if test="taxAmount != null">
                tax_amount = #{taxAmount,jdbcType=VARCHAR},
            </if>
            <if test="yxTaxAmount != null">
                yx_tax_amount = #{yxTaxAmount,jdbcType=VARCHAR},
            </if>
            <if test="importPortCode != null">
                import_port_code = #{importPortCode,jdbcType=VARCHAR},
            </if>
            <if test="incomeOffice != null">
                income_office = #{incomeOffice,jdbcType=VARCHAR},
            </if>
            <if test="applicantCode != null">
                applicant_code = #{applicantCode,jdbcType=VARCHAR},
            </if>
            <if test="billCode != null">
                bill_code = #{billCode,jdbcType=VARCHAR},
            </if>
            <if test="modeType != null">
                mode_type = #{modeType,jdbcType=VARCHAR},
            </if>
            <if test="budgetCode != null">
                budget_code = #{budgetCode,jdbcType=VARCHAR},
            </if>
            <if test="treasuryCode != null">
                treasury_code = #{treasuryCode,jdbcType=VARCHAR},
            </if>
            <if test="contractCode != null">
                contract_code = #{contractCode,jdbcType=VARCHAR},
            </if>
            <if test="meansTransport != null">
                means_transport = #{meansTransport,jdbcType=VARCHAR},
            </if>
            <if test="paymentPeriod != null">
                payment_period = #{paymentPeriod,jdbcType=VARCHAR},
            </if>
            <if test="deliveryCode != null">
                delivery_code = #{deliveryCode,jdbcType=VARCHAR},
            </if>
            <if test="dataSources != null">
                data_sources = #{dataSources,jdbcType=VARCHAR},
            </if>
            <if test="createDate != null">
                create_date = #{createDate,jdbcType=TIMESTAMP},
            </if>
            <if test="updateDate != null">
                update_date = #{updateDate,jdbcType=TIMESTAMP},
            </if>
            <if test="dataType != null">
                data_type = #{dataType,jdbcType=VARCHAR},
            </if>
            <if test="collectUploadStatus != null">
                collect_upload_status = #{collectUploadStatus,jdbcType=VARCHAR},
            </if>
            <if test="auditStatus != null">
                audit_status = #{auditStatus,jdbcType=VARCHAR},
            </if>
            <if test="applyCheck != null">
                apply_check = #{applyCheck,jdbcType=VARCHAR},
            </if>
            <if test="failReason != null">
                fail_reason = #{failReason,jdbcType=VARCHAR},
            </if>
            <if test="checkStatus != null">
                check_status = #{checkStatus,jdbcType=VARCHAR},
            </if>
            <if test="qsStatus != null">
                qs_status = #{qsStatus,jdbcType=VARCHAR},
            </if>
            <if test="qsDate != null">
                qs_date = #{qsDate,jdbcType=TIMESTAMP},
            </if>
            <if test="qsType != null">
                qs_type = #{qsType,jdbcType=VARCHAR},
            </if>
            <if test="qsUser != null">
                qs_user = #{qsUser,jdbcType=VARCHAR},
            </if>
            <if test="rzhDate != null">
                rzh_date = #{rzhDate,jdbcType=TIMESTAMP},
            </if>
            <if test="rzhBelongDate != null">
                rzh_belong_date = #{rzhBelongDate,jdbcType=VARCHAR},
            </if>
            <if test="confirmDate != null">
                confirm_date = #{confirmDate,jdbcType=TIMESTAMP},
            </if>
            <if test="rzhType != null">
                rzh_type = #{rzhType,jdbcType=VARCHAR},
            </if>
            <if test="rzhYesorno != null">
                rzh_yesorno = #{rzhYesorno,jdbcType=VARCHAR},
            </if>
            <if test="rzhBackMsg != null">
                rzh_back_msg = #{rzhBackMsg,jdbcType=VARCHAR},
            </if>
            <if test="dqskssq != null">
                dqskssq = #{dqskssq,jdbcType=VARCHAR},
            </if>
            <if test="gxjzr != null">
                gxjzr = #{gxjzr,jdbcType=VARCHAR},
            </if>
            <if test="gxfwq != null">
                gxfwq = #{gxfwq,jdbcType=VARCHAR},
            </if>
            <if test="gxfwz != null">
                gxfwz = #{gxfwz,jdbcType=VARCHAR},
            </if>
            <if test="detailYesorno != null">
                detail_yesorno = #{detailYesorno,jdbcType=VARCHAR},
            </if>
            <if test="authStatus != null">
                auth_status = #{authStatus,jdbcType=VARCHAR},
            </if>
            <if test="sendDate != null">
                send_date = #{sendDate,jdbcType=TIMESTAMP},
            </if>
            <if test="rzlx != null">
                rzlx = #{rzlx,jdbcType=VARCHAR},
            </if>
            <if test="confirmUser != null">
                confirm_user = #{confirmUser,jdbcType=VARCHAR},
            </if>
            <if test="deptId != null">
                dept_id = #{deptId,jdbcType=VARCHAR},
            </if>
            <if test="deptName != null">
                dept_name = #{deptName,jdbcType=VARCHAR},
            </if>
            <if test="glzt != null">
                glzt = #{glzt,jdbcType=VARCHAR},
            </if>
            <if test="xxly != null">
                xxly = #{xxly,jdbcType=VARCHAR},
            </if>
            <if test="cxrzStatus != null">
                cxrz_status = #{cxrzStatus,jdbcType=VARCHAR},
            </if>
            <if test="cxrzDate != null">
                cxrz_date = #{cxrzDate,jdbcType=TIMESTAMP},
            </if>
            <if test="cxrzCurrentPeriod != null">
                cxrz_current_period = #{cxrzCurrentPeriod,jdbcType=VARCHAR},
            </if>
            <if test="bdkStatus != null">
                bdk_status = #{bdkStatus,jdbcType=VARCHAR},
            </if>
            <if test="cxbdkStatus != null">
                cxbdk_status = #{cxbdkStatus,jdbcType=VARCHAR},
            </if>
            <if test="cxbdkDate != null">
                cxbdk_date = #{cxbdkDate,jdbcType=TIMESTAMP},
            </if>
            <if test="bdkCurrentPeriod != null">
                bdk_current_period = #{bdkCurrentPeriod,jdbcType=VARCHAR},
            </if>
            <if test="entryDiscrepancy != null">
                entry_discrepancy = #{entryDiscrepancy,jdbcType=VARCHAR},
            </if>
            <if test="customsScanId != null">
                customs_scan_id = #{customsScanId,jdbcType=VARCHAR},
            </if>
            <if test="exportMark != null">
                export_mark = #{exportMark,jdbcType=VARCHAR},
            </if>
            <if test="entryDate != null">
                entry_date = #{entryDate,jdbcType=TIMESTAMP},
            </if>
            <if test="entryUser != null">
                entry_user = #{entryUser,jdbcType=VARCHAR},
            </if>
        </set>
        where id = #{id,jdbcType=BIGINT}
    </update>
    <update databaseId="oracle" id="updateByPrimaryKeySelective"
            parameterType="com.dxhy.domestic.entity.TdxCustomsRecord">
        update t_dx_customs_record
        <set>
            <if test="gfName != null">
                gf_name = #{gfName,jdbcType=VARCHAR},
            </if>
            <if test="gfTaxNo != null">
                gf_tax_no = #{gfTaxNo,jdbcType=VARCHAR},
            </if>
            <if test="customsCode != null">
                customs_code = #{customsCode,jdbcType=VARCHAR},
            </if>
            <if test="payerOneTaxno != null">
                payer_one_taxno = #{payerOneTaxno,jdbcType=VARCHAR},
            </if>
            <if test="payerOneName != null">
                payer_one_name = #{payerOneName,jdbcType=VARCHAR},
            </if>
            <if test="payerTwoTaxno != null">
                payer_two_taxno = #{payerTwoTaxno,jdbcType=VARCHAR},
            </if>
            <if test="payerTwoName != null">
                payer_two_name = #{payerTwoName,jdbcType=VARCHAR},
            </if>
            <if test="fillInDate != null">
                fill_in_date = #{fillInDate,jdbcType=TIMESTAMP},
            </if>
            <if test="taxAmount != null">
                tax_amount = #{taxAmount,jdbcType=VARCHAR},
            </if>
            <if test="yxTaxAmount != null">
                yx_tax_amount = #{yxTaxAmount,jdbcType=VARCHAR},
            </if>
            <if test="importPortCode != null">
                import_port_code = #{importPortCode,jdbcType=VARCHAR},
            </if>
            <if test="incomeOffice != null">
                income_office = #{incomeOffice,jdbcType=VARCHAR},
            </if>
            <if test="applicantCode != null">
                applicant_code = #{applicantCode,jdbcType=VARCHAR},
            </if>
            <if test="billCode != null">
                bill_code = #{billCode,jdbcType=VARCHAR},
            </if>
            <if test="modeType != null">
                mode_type = #{modeType,jdbcType=VARCHAR},
            </if>
            <if test="budgetCode != null">
                budget_code = #{budgetCode,jdbcType=VARCHAR},
            </if>
            <if test="treasuryCode != null">
                treasury_code = #{treasuryCode,jdbcType=VARCHAR},
            </if>
            <if test="contractCode != null">
                contract_code = #{contractCode,jdbcType=VARCHAR},
            </if>
            <if test="meansTransport != null">
                means_transport = #{meansTransport,jdbcType=VARCHAR},
            </if>
            <if test="paymentPeriod != null">
                payment_period = #{paymentPeriod,jdbcType=VARCHAR},
            </if>
            <if test="deliveryCode != null">
                delivery_code = #{deliveryCode,jdbcType=VARCHAR},
            </if>
            <if test="dataSources != null">
                data_sources = #{dataSources,jdbcType=VARCHAR},
            </if>
            <if test="createDate != null">
                create_date = #{createDate,jdbcType=TIMESTAMP},
            </if>
            <if test="updateDate != null">
                update_date = #{updateDate,jdbcType=TIMESTAMP},
            </if>
            <if test="dataType != null">
                data_type = #{dataType,jdbcType=VARCHAR},
            </if>
            <if test="collectUploadStatus != null">
                collect_upload_status = #{collectUploadStatus,jdbcType=VARCHAR},
            </if>
            <if test="auditStatus != null">
                audit_status = #{auditStatus,jdbcType=VARCHAR},
            </if>
            <if test="applyCheck != null">
                apply_check = #{applyCheck,jdbcType=VARCHAR},
            </if>
            <if test="failReason != null">
                fail_reason = #{failReason,jdbcType=VARCHAR},
            </if>
            <if test="checkStatus != null">
                check_status = #{checkStatus,jdbcType=VARCHAR},
            </if>
            <if test="qsStatus != null">
                qs_status = #{qsStatus,jdbcType=VARCHAR},
            </if>
            <if test="qsDate != null">
                qs_date = #{qsDate,jdbcType=TIMESTAMP},
            </if>
            <if test="qsType != null">
                qs_type = #{qsType,jdbcType=VARCHAR},
            </if>
            <if test="qsUser != null">
                qs."USER" = #{qsUser,jdbcType=VARCHAR},
            </if>
            <if test="rzhDate != null">
                rzh_date = #{rzhDate,jdbcType=TIMESTAMP},
            </if>
            <if test="rzhBelongDate != null">
                rzh_belong_date = #{rzhBelongDate,jdbcType=VARCHAR},
            </if>
            <if test="confirmDate != null">
                confirm_date = #{confirmDate,jdbcType=TIMESTAMP},
            </if>
            <if test="rzhType != null">
                rzh_type = #{rzhType,jdbcType=VARCHAR},
            </if>
            <if test="rzhYesorno != null">
                rzh_yesorno = #{rzhYesorno,jdbcType=VARCHAR},
            </if>
            <if test="rzhBackMsg != null">
                rzh_back_msg = #{rzhBackMsg,jdbcType=VARCHAR},
            </if>
            <if test="dqskssq != null">
                dqskssq = #{dqskssq,jdbcType=VARCHAR},
            </if>
            <if test="gxjzr != null">
                gxjzr = #{gxjzr,jdbcType=VARCHAR},
            </if>
            <if test="gxfwq != null">
                gxfwq = #{gxfwq,jdbcType=VARCHAR},
            </if>
            <if test="gxfwz != null">
                gxfwz = #{gxfwz,jdbcType=VARCHAR},
            </if>
            <if test="detailYesorno != null">
                detail_yesorno = #{detailYesorno,jdbcType=VARCHAR},
            </if>
            <if test="authStatus != null">
                auth_status = #{authStatus,jdbcType=VARCHAR},
            </if>
            <if test="sendDate != null">
                send_date = #{sendDate,jdbcType=TIMESTAMP},
            </if>
            <if test="rzlx != null">
                rzlx = #{rzlx,jdbcType=VARCHAR},
            </if>
            <if test="confirmUser != null">
                confirm_user = #{confirmUser,jdbcType=VARCHAR},
            </if>
            <if test="deptId != null">
                dept_id = #{deptId,jdbcType=VARCHAR},
            </if>
            <if test="deptName != null">
                dept_name = #{deptName,jdbcType=VARCHAR},
            </if>
            <if test="glzt != null">
                glzt = #{glzt,jdbcType=VARCHAR},
            </if>
            <if test="xxly != null">
                xxly = #{xxly,jdbcType=VARCHAR},
            </if>
            <if test="cxrzStatus != null">
                cxrz_status = #{cxrzStatus,jdbcType=VARCHAR},
            </if>
            <if test="cxrzDate != null">
                cxrz_date = #{cxrzDate,jdbcType=TIMESTAMP},
            </if>
            <if test="cxrzCurrentPeriod != null">
                cxrz_current_period = #{cxrzCurrentPeriod,jdbcType=VARCHAR},
            </if>
            <if test="bdkStatus != null">
                bdk_status = #{bdkStatus,jdbcType=VARCHAR},
            </if>
            <if test="cxbdkStatus != null">
                cxbdk_status = #{cxbdkStatus,jdbcType=VARCHAR},
            </if>
            <if test="cxbdkDate != null">
                cxbdk_date = #{cxbdkDate,jdbcType=TIMESTAMP},
            </if>
            <if test="bdkCurrentPeriod != null">
                bdk_current_period = #{bdkCurrentPeriod,jdbcType=VARCHAR},
            </if>
            <if test="entryDiscrepancy != null">
                entry_discrepancy = #{entryDiscrepancy,jdbcType=VARCHAR},
            </if>
            <if test="customsScanId != null">
                customs_scan_id = #{customsScanId,jdbcType=VARCHAR},
            </if>
            <if test="exportMark != null">
                export_mark = #{exportMark,jdbcType=VARCHAR},
            </if>
            <if test="entryDate != null">
                entry_date = #{entryDate,jdbcType=TIMESTAMP},
            </if>
            <if test="entryUser != null">
                entry."USER" = #{entryUser,jdbcType=VARCHAR},
            </if>
        </set>
        where id = #{id,jdbcType=BIGINT}
    </update>

</mapper>
