<?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.DomesticExportCustomsDao">
    <resultMap id="BaseResultMap" type="com.dxhy.domestic.entity.TdxExportCustoms">
        <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="export_no" jdbcType="VARCHAR" property="exportNo"/>
        <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="export_tax_amount" jdbcType="VARCHAR" property="exportTaxAmount"/>
        <result column="yx_export_tax_amount" jdbcType="VARCHAR" property="yxExportTaxAmount"/>
        <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="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="rzh_date" jdbcType="TIMESTAMP" property="rzhDate"/>
        <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="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="company" jdbcType="VARCHAR" property="company"/>
        <result column="rzh_belong_date" jdbcType="VARCHAR" property="rzhBelongDate"/>
    </resultMap>

    <select databaseId="mysql" id="querySgBySum"
            parameterType="com.dxhy.domestic.model.dto.TdxExportCustomsModelDTO" resultType="java.util.Map">
        SELECT
        count(1) as hjsl,
        '' as hjje,
        sum(p.export_tax_amount) as hjse
        FROM
        t_dx_export_customs p
        left join
        t_dx_tax_current c on p.gf_tax_no = c.taxno
        where
        p.rzh_yesorno = '0'
        and p.auth_status in ('0','5','6')
        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.customsCode!=null and queryParams.customsCode!=''">
            and p.customs_code = #{queryParams.customsCode}
        </if>

        <if test="queryParams.exportNo!=null and queryParams.exportNo!=''">
            and p.export_no = #{queryParams.exportNo}
        </if>

        <if test="queryParams.fillInDateStart!=null and queryParams.fillInDateStart!=''">
            and p.fill_in_date &gt;= #{queryParams.fillInDateStart}
        </if>

        <if test="queryParams.fillInDateEnd!=null and queryParams.fillInDateEnd!=''">
            and p.fill_in_date &lt;= #{queryParams.fillInDateEnd}
        </if>

        <if test="queryParams.exportTaxAmountMin!=null and queryParams.exportTaxAmountMin!=''">
            and p.export_tax_amount &gt;= #{queryParams.exportTaxAmountMin}+0
        </if>

        <if test="queryParams.exportTaxAmountMax!=null and queryParams.exportTaxAmountMax!=''">
            and p.export_tax_amount &lt;= #{queryParams.exportTaxAmountMax}+0
        </if>

    </select>

    <select databaseId="mysql" id="querySgByPage"
            parameterType="com.dxhy.domestic.model.dto.TdxExportCustomsModelDTO" resultType="java.util.Map">
        SELECT
        p.id as id,
        p.customs_code as customsCode,
        DATE_FORMAT(p.fill_in_date ,'%Y-%m-%d')   as fillInDate,
        p.gf_name as gfName,
        p.gf_tax_no as gfTaxNo,
        p.export_tax_amount as exportTaxAmount,
        p.yx_export_tax_amount as yxExportTaxAmount,
        p.data_sources as dataSources,
        p.apply_check as applyCheck,
        p.audit_status as auditStatus,
        p.export_no as exportNo,
        p.glzt as glzt,
        p.check_status as checkStatus,
        p.entry_discrepancy as entryDiscrepancy
        FROM
        t_dx_export_customs p
        left join
        t_dx_tax_current c on p.gf_tax_no = c.taxno
        where
        p.rzh_yesorno = '0'
        and p.auth_status in ('0','5','6')
        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.customsCode!=null and queryParams.customsCode!=''">
            and p.customs_code = #{queryParams.customsCode}
        </if>

        <if test="queryParams.exportNo!=null and queryParams.exportNo!=''">
            and p.export_no = #{queryParams.exportNo}
        </if>

        <if test="queryParams.fillInDateStart!=null and queryParams.fillInDateStart!=''">
            and p.fill_in_date &gt;= #{queryParams.fillInDateStart}
        </if>

        <if test="queryParams.fillInDateEnd!=null and queryParams.fillInDateEnd!=''">
            and p.fill_in_date &lt;= #{queryParams.fillInDateEnd}
        </if>

        <if test="queryParams.exportTaxAmountMin!=null and queryParams.exportTaxAmountMin!=''">
            and p.export_tax_amount &gt;= #{queryParams.exportTaxAmountMin}+0
        </if>

        <if test="queryParams.exportTaxAmountMax!=null and queryParams.exportTaxAmountMax!=''">
            and p.export_tax_amount &lt;= #{queryParams.exportTaxAmountMax}+0
        </if>

        order by p.create_date desc
    </select>

    <select databaseId="mysql" id="queryBdkBySum"
            parameterType="com.dxhy.domestic.model.dto.TdxExportCustomsModelDTO" resultType="java.util.Map">
        SELECT
        count(1) as hjsl,
        '' as hjje,
        sum(p.export_tax_amount) as hjse
        FROM
        t_dx_export_customs p
        where
        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.sfDkStatus!=null and queryParams.sfDkStatus == '0'.toString()">
            and (p.auth_status in('0','5','6') or (p.bdk_status = '2' and p.auth_status != '4'))
        </if>

        <if test="queryParams.sfDkStatus!=null and queryParams.sfDkStatus == '4'.toString()">
            and p.bdk_status = '2' and p.auth_status='4'
        </if>

        <if test="queryParams.gfsh!=null and queryParams.gfsh!=''">
            and p.gf_tax_no = #{queryParams.gfsh}
        </if>

        <if test="queryParams.customsCode!=null and queryParams.customsCode!=''">
            and p.customs_code = #{queryParams.customsCode}
        </if>

        <if test="queryParams.exportNo!=null and queryParams.exportNo!=''">
            and p.export_no = #{queryParams.exportNo}
        </if>

        <if test="queryParams.fillInDateStart!=null and queryParams.fillInDateStart!=''">
            and p.fill_in_date &gt;= #{queryParams.fillInDateStart}
        </if>

        <if test="queryParams.fillInDateEnd!=null and queryParams.fillInDateEnd!=''">
            and p.fill_in_date &lt;= #{queryParams.fillInDateEnd}
        </if>

        <if test="queryParams.exportTaxAmountMin!=null and queryParams.exportTaxAmountMin!=''">
            and p.export_tax_amount &gt;= #{queryParams.exportTaxAmountMin}+0
        </if>

        <if test="queryParams.exportTaxAmountMax!=null and queryParams.exportTaxAmountMax!=''">
            and p.export_tax_amount &lt;= #{queryParams.exportTaxAmountMax}+0
        </if>
    </select>

    <select databaseId="mysql" id="queryBdkByPage"
            parameterType="com.dxhy.domestic.model.dto.TdxExportCustomsModelDTO" resultType="java.util.Map">
        SELECT
        p.id as id,
        p.customs_code as customsCode,
        DATE_FORMAT(p.fill_in_date,'%Y-%m-%d') as fillInDate,
        p.gf_name as gfName,
        p.gf_tax_no as gfTaxNo,
        p.export_tax_amount as exportTaxAmount,
        p.yx_export_tax_amount as yxExportTaxAmount,
        p.data_sources as dataSources,
        p.apply_check as applyCheck,
        p.audit_status as auditStatus,
        p.export_no as exportNo,
        p.cxbdk_status as cxbdkStatus,
        p.auth_status as authStatus,
        p.bdk_status as bdkStatus
        FROM
        t_dx_export_customs p
        where
        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.sfDkStatus!=null and queryParams.sfDkStatus == '0'.toString()">
            and (p.auth_status in('0','5','6') or (p.bdk_status = '2' and p.auth_status != '4'))
        </if>

        <if test="queryParams.sfDkStatus!=null and queryParams.sfDkStatus == '4'.toString()">
            and p.bdk_status = '2' and p.auth_status='4'
        </if>

        <if test="queryParams.gfsh!=null and queryParams.gfsh!=''">
            and p.gf_tax_no = #{queryParams.gfsh}
        </if>

        <if test="queryParams.customsCode!=null and queryParams.customsCode!=''">
            and p.customs_code = #{queryParams.customsCode}
        </if>

        <if test="queryParams.exportNo!=null and queryParams.exportNo!=''">
            and p.export_no = #{queryParams.exportNo}
        </if>

        <if test="queryParams.fillInDateStart!=null and queryParams.fillInDateStart!=''">
            and p.fill_in_date &gt;= #{queryParams.fillInDateStart}
        </if>

        <if test="queryParams.fillInDateEnd!=null and queryParams.fillInDateEnd!=''">
            and p.fill_in_date &lt;= #{queryParams.fillInDateEnd}
        </if>

        <if test="queryParams.exportTaxAmountMin!=null and queryParams.exportTaxAmountMin!=''">
            and p.export_tax_amount &gt;= #{queryParams.exportTaxAmountMin}+0
        </if>

        <if test="queryParams.exportTaxAmountMax!=null and queryParams.exportTaxAmountMax!=''">
            and p.export_tax_amount &lt;= #{queryParams.exportTaxAmountMax}+0
        </if>
        order by fill_in_date desc
    </select>

    <select databaseId="mysql" id="queryRzcxBySum"
            parameterType="com.dxhy.domestic.model.dto.TdxExportCustomsModelDTO" resultType="java.util.Map">
        SELECT
        count(1) as hjsl,
        '' as hjje,
        sum(p.export_tax_amount) as hjse
        FROM
        t_dx_export_customs p
        where
        p.auth_status !='0'
        <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="bzdh != null and bzdh != '' and bzdh != 'null'">-->
<!--            and p.bzdh = #{bzdh}-->
<!--        </if>-->
<!--        <if test="inAccountStatus != null and inAccountStatus != '' and inAccountStatus != 'null'">-->
<!--            and p.inaccount_status = #{inAccountStatus}-->
<!--        </if>-->

        <if test="queryParams.gfsh!=null and queryParams.gfsh!=''">
            and p.gf_tax_no = #{queryParams.gfsh}
        </if>

        <if test="queryParams.customsCode!=null and queryParams.customsCode!=''">
            and p.customs_code = #{queryParams.customsCode}
        </if>

        <if test="queryParams.fillInDateStart!=null and queryParams.fillInDateStart!=''">
            and p.fill_in_date &gt;= #{queryParams.fillInDateStart}
        </if>

        <if test="queryParams.fillInDateEnd!=null and queryParams.fillInDateEnd!=''">
            and p.fill_in_date &lt;= #{queryParams.fillInDateEnd}
        </if>
        <if test="queryParams.exportTaxAmountMin!=null and queryParams.exportTaxAmountMin!=''">
            and p.export_tax_amount &gt;= #{queryParams.exportTaxAmountMin}+0
        </if>
        <if test="queryParams.exportTaxAmountMax!=null and queryParams.exportTaxAmountMax!=''">
            and p.export_tax_amount &lt;= #{queryParams.exportTaxAmountMax}+0
        </if>

        <if test="queryParams.exportNo!=null and queryParams.exportNo!=''">
            and p.export_no = #{queryParams.exportNo}
        </if>

        <if test="queryParams.rzhBelongDate!=null and queryParams.rzhBelongDate!=''">
            and p.rzh_belong_date = #{queryParams.rzhBelongDate}
        </if>

        <if test="queryParams.glzt!=null and queryParams.glzt!=''">
            and p.glzt = #{queryParams.glzt}
        </if>

        <if test="queryParams.rzhYesorno!=null and queryParams.rzhYesorno!='' and queryParams.rzhYesorno != 3 ">
            and p.rzh_yesorno = #{queryParams.rzhYesorno}
        </if>

        <if test="queryParams.rzhYesorno != null and queryParams.rzhYesorno != '' and queryParams.rzhYesorno == 3">
            and (p.rzh_yesorno = '1' or p.rzh_yesorno = '2')
        </if>

        <if test="queryParams.bdkStatus!=null and queryParams.bdkStatus!=''">
            and p.bdk_status = #{queryParams.bdkStatus}
        </if>

        <if test="queryParams.authStatus!=null and queryParams.authStatus!=''">
            and p.auth_status = #{queryParams.authStatus}
        </if>

        <if test="queryParams.confirmUser!=null and queryParams.confirmUser!=''">
            and p.confirm_user = #{queryParams.confirmUser}
        </if>

        <if test="queryParams.rzhDateStart!=null and queryParams.rzhDateStart!=''">
            and p.rzh_date &gt;= #{queryParams.rzhDateStart}
        </if>

        <if test="queryParams.rzhDateEnd!=null and queryParams.rzhDateEnd!=''">
            and p.rzh_date &lt;= #{queryParams.rzhDateEnd}
        </if>
    </select>

    <select databaseId="mysql" id="queryRzcxByPage"
            parameterType="com.dxhy.domestic.model.dto.TdxExportCustomsModelDTO" resultType="java.util.Map">
        SELECT
        p.id as id,
        p.customs_code as customsCode,
        DATE_FORMAT(p.fill_in_date ,'%Y-%m-%d') fillInDate,
        p.gf_name as gfName,
        p.gf_tax_no as gfTaxNo,
        p.export_tax_amount as exportTaxAmount,
        p.yx_export_tax_amount as yxExportTaxAmount,
        p.data_sources as dataSources,
        p.apply_check as applyCheck,
        p.audit_status as auditStatus,
        p.export_no as exportNo,
        p.glzt as glzt,
        DATE_FORMAT(p.rzh_date,'%Y-%m-%d') rzhDate,
        p.auth_status as authStatus,
        p.rzh_yesorno as rzhYesorno,
        p.bdk_status as bdkStatus,
        p.confirm_user as confirmUser,
        p.rzh_belong_date as rzhBelongDate,
        p.cxrz_status as cxrzStatus,
        p.cxbdk_status as cxbdkStatus
        FROM
        t_dx_export_customs p
        where
        p.auth_status !='0'
        <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="bzdh != null and bzdh != '' and bzdh != 'null'">-->
<!--            and p.bzdh = #{bzdh}-->
<!--        </if>-->

<!--        <if test="inAccountStatus != null and inAccountStatus != '' and inAccountStatus != 'null'">-->
<!--            and p.inaccount_status = #{inAccountStatus}-->
<!--        </if>-->

        <if test="queryParams.gfsh!=null and queryParams.gfsh!=''">
            and p.gf_tax_no = #{queryParams.gfsh}
        </if>

        <if test="queryParams.customsCode!=null and queryParams.customsCode!=''">
            and p.customs_code = #{queryParams.customsCode}
        </if>

        <if test="queryParams.fillInDateStart!=null and queryParams.fillInDateStart!=''">
            and p.fill_in_date &gt;= #{queryParams.fillInDateStart}
        </if>

        <if test="queryParams.fillInDateEnd!=null and queryParams.fillInDateEnd!=''">
            and p.fill_in_date &lt;= #{queryParams.fillInDateEnd}
        </if>

        <if test="queryParams.exportTaxAmountMin!=null and queryParams.exportTaxAmountMin!=''">
            and p.export_tax_amount &gt;= #{queryParams.exportTaxAmountMin}+0
        </if>

        <if test="queryParams.exportTaxAmountMax!=null and queryParams.exportTaxAmountMax!=''">
            and p.export_tax_amount &lt;= #{queryParams.exportTaxAmountMax}+0
        </if>

        <if test="queryParams.exportNo!=null and queryParams.exportNo!=''">
            and p.export_no = #{queryParams.exportNo}
        </if>

        <if test="queryParams.rzhBelongDate!=null and queryParams.rzhBelongDate!=''">
            and p.rzh_belong_date = #{queryParams.rzhBelongDate}
        </if>

        <if test="queryParams.glzt!=null and queryParams.glzt!=''">
            and p.glzt = #{queryParams.glzt}
        </if>

        <if test="queryParams.rzhYesorno!=null and queryParams.rzhYesorno!='' and queryParams.rzhYesorno != 3">
            and p.rzh_yesorno = #{queryParams.rzhYesorno}
        </if>

        <if test="queryParams.rzhYesorno != null and queryParams.rzhYesorno != '' and queryParams.rzhYesorno == 3">
            and (p.rzh_yesorno = '1' and p.rzh_yesorno = '2')
        </if>

        <if test="queryParams.bdkStatus!=null and queryParams.bdkStatus!=''">
            and p.bdk_status = #{queryParams.bdkStatus}
        </if>

        <if test="queryParams.authStatus!=null and queryParams.authStatus!=''">
            and p.auth_status = #{queryParams.authStatus}
        </if>

        <if test="queryParams.confirmUser!=null and queryParams.confirmUser!=''">
            and p.confirm_user = #{queryParams.confirmUser}
        </if>

        <if test="queryParams.rzhDateStart!=null and queryParams.rzhDateStart!=''">
            and p.rzh_date &gt;= #{queryParams.rzhDateStart}
        </if>

        <if test="queryParams.rzhDateEnd!=null and queryParams.rzhDateEnd!=''">
            and p.rzh_date &lt;= #{queryParams.rzhDateEnd}
        </if>
    </select>

    <select databaseId="mysql"
            id="queryExportCustomsList" parameterType="com.dxhy.domestic.model.dto.TdxExportCustomsModelDTO"
            resultType="java.util.Map">
        SELECT
        p.id as id,
        p.customs_code as customsCode,
        DATE_FORMAT(fill_in_date,'%Y-%m-%d') as fillInDate,
        p.gf_name as gfName,
        p.gf_tax_no as gfTaxNo,
        p.export_tax_amount as exportTaxAmount,
        p.yx_export_tax_amount as yxExportTaxAmount,
        p.data_sources as dataSources,
        p.apply_check as applyCheck,
        p.audit_status as auditStatus,
        p.export_no as exportNo,
        p.glzt as glzt,
        DATE_FORMAT(p.rzh_date,'%Y-%m-%d') as rzhDate,
        p.auth_status as authStatus,
        p.rzh_yesorno as rzhYesorno,
        p.bdk_status as bdkStatus,
        p.confirm_user as confirmUser,
        p.rzh_belong_date as rzhBelongDate,
        p.cxrz_status as cxrzStatus
        FROM
        t_dx_export_customs p
        where 1=1
        <include refid="queryExportCustoms_sql"/>
        order by p.fill_in_date desc
    </select>

    <select databaseId="mysql"
            id="queryExportCustomsSum" parameterType="com.dxhy.domestic.model.dto.TdxExportCustomsModelDTO"
            resultType="java.util.Map">
        SELECT
        count(1) as hjsl,
        '' as hjje,
        sum(p.export_tax_amount) as hjse
        FROM
        t_dx_export_customs p
        where 1=1
        <include refid="queryExportCustoms_sql"/>
    </select>
    <select databaseId="mysql" id="selectDkse" parameterType="java.util.Map"
            resultType="com.dxhy.domestic.entity.TdxExportCustoms">
        select sum(t.yx_export_tax_amount) yxTaxAmount
        from t_dx_export_customs t
        WHERE t.data_type = '17'
          and (t.rzh_yesorno = "1" or t.auth_status in ("2", "3", "4"))
          and t.gf_tax_no = #{gfsh}
          and t.rzh_belong_date = #{skssq}

    </select>
    <select databaseId="oracle" id="querySgBySum"
            parameterType="com.dxhy.domestic.model.dto.TdxExportCustomsModelDTO" resultType="java.util.Map">
        SELECT
        count(1) as "hjsl",
        '' as "hjje",
        sum(p.export_tax_amount) as "hjse"
        FROM
        t_dx_export_customs p
        left join
        t_dx_tax_current c on p.gf_tax_no = c.taxno
        where
        p.rzh_yesorno = '0'
        and p.auth_status in ('0','5','6')
        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.customsCode!=null and queryParams.customsCode!=''">
            and p.customs_code = #{queryParams.customsCode}
        </if>

        <if test="queryParams.exportNo!=null and queryParams.exportNo!=''">
            and p.export_no = #{queryParams.exportNo}
        </if>

        <if test="queryParams.fillInDateStart!=null and queryParams.fillInDateStart!=''">
            and to_char(p.fill_in_date,'yyyy-mm-dd hh24:mi:ss') &gt;= #{queryParams.fillInDateStart}
        </if>

        <if test="queryParams.fillInDateEnd!=null and queryParams.fillInDateEnd!=''">
            and to_char(p.fill_in_date,'yyyy-mm-dd hh24:mi:ss') &lt;= #{queryParams.fillInDateEnd}
        </if>

        <if test="queryParams.exportTaxAmountMin!=null and queryParams.exportTaxAmountMin!=''">
            and p.export_tax_amount &gt;= #{queryParams.exportTaxAmountMin}+0
        </if>

        <if test="queryParams.exportTaxAmountMax!=null and queryParams.exportTaxAmountMax!=''">
            and p.export_tax_amount &lt;= #{queryParams.exportTaxAmountMax}+0
        </if>

    </select>
    <select databaseId="oracle" id="querySgByPage"
            parameterType="com.dxhy.domestic.model.dto.TdxExportCustomsModelDTO" resultType="java.util.Map">
        SELECT
        to_char(p.id) as "id",
        p.customs_code as "customsCode",
        to_date(p.fill_in_date, 'yyyy-MM-dd') as "fillInDate",
        p.gf_name as "gfName",
        p.gf_tax_no as "gfTaxNo",
        p.export_tax_amount as "exportTaxAmount",
        p.yx_export_tax_amount as "yxExportTaxAmount",
        p.data_sources as "dataSources",
        p.apply_check as "applyCheck",
        p.audit_status as "auditStatus",
        p.export_no as "exportNo",
        p.glzt as "glzt",
        p.check_status as "checkStatus",
        p.entry_discrepancy as "entryDiscrepancy"
        FROM
        t_dx_export_customs p
        left join
        t_dx_tax_current c on p.gf_tax_no = c.taxno
        where
        p.rzh_yesorno = '0'
        and p.auth_status in ('0','5','6')
        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.customsCode!=null and queryParams.customsCode!=''">
            and p.customs_code = #{queryParams.customsCode}
        </if>

        <if test="queryParams.exportNo!=null and queryParams.exportNo!=''">
            and p.export_no = #{queryParams.exportNo}
        </if>

        <if test="queryParams.fillInDateStart!=null and queryParams.fillInDateStart!=''">
            and to_char(p.fill_in_date,'yyyy-mm-dd hh24:mi:ss') &gt;= #{queryParams.fillInDateStart}
        </if>

        <if test="queryParams.fillInDateEnd!=null and queryParams.fillInDateEnd!=''">
            and to_char(p.fill_in_date,'yyyy-mm-dd hh24:mi:ss') &lt;= #{queryParams.fillInDateEnd}
        </if>

        <if test="queryParams.exportTaxAmountMin!=null and queryParams.exportTaxAmountMin!=''">
            and p.export_tax_amount &gt;= #{queryParams.exportTaxAmountMin}+0
        </if>

        <if test="queryParams.exportTaxAmountMax!=null and queryParams.exportTaxAmountMax!=''">
            and p.export_tax_amount &lt;= #{queryParams.exportTaxAmountMax}+0
        </if>

        order by p.create_date desc
    </select>

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

    <select databaseId="oracle" id="queryBdkBySum"
            parameterType="com.dxhy.domestic.model.dto.TdxExportCustomsModelDTO" resultType="java.util.Map">
        SELECT
        count(1) as "hjsl",
        '' as "hjje",
        sum(p.export_tax_amount) as "hjse"
        FROM
        t_dx_export_customs p
        where
        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.sfDkStatus!=null and queryParams.sfDkStatus == '0'.toString()">
            and (p.auth_status in('0','5','6') or (p.bdk_status = '2' and p.auth_status != '4'))
        </if>

        <if test="queryParams.sfDkStatus!=null and queryParams.sfDkStatus == '4'.toString()">
            and p.bdk_status = '2' and p.auth_status='4'
        </if>

        <if test="queryParams.gfsh!=null and queryParams.gfsh!=''">
            and p.gf_tax_no = #{queryParams.gfsh}
        </if>

        <if test="queryParams.customsCode!=null and queryParams.customsCode!=''">
            and p.customs_code = #{queryParams.customsCode}
        </if>

        <if test="queryParams.exportNo!=null and queryParams.exportNo!=''">
            and p.export_no = #{queryParams.exportNo}
        </if>

        <if test="queryParams.fillInDateStart!=null and queryParams.fillInDateStart!=''">
            and to_char(p.fill_in_date,'yyyy-mm-dd hh24:mi:ss') &gt;= #{queryParams.fillInDateStart}
        </if>

        <if test="queryParams.fillInDateEnd!=null and queryParams.fillInDateEnd!=''">
            and to_char(p.fill_in_date,'yyyy-mm-dd hh24:mi:ss') &lt;= #{queryParams.fillInDateEnd}
        </if>

        <if test="queryParams.exportTaxAmountMin!=null and queryParams.exportTaxAmountMin!=''">
            and p.export_tax_amount &gt;= #{queryParams.exportTaxAmountMin}+0
        </if>

        <if test="queryParams.exportTaxAmountMax!=null and queryParams.exportTaxAmountMax!=''">
            and p.export_tax_amount &lt;= #{queryParams.exportTaxAmountMax}+0
        </if>
    </select>

    <select databaseId="oracle" id="queryBdkByPage"
            parameterType="com.dxhy.domestic.model.dto.TdxExportCustomsModelDTO" resultType="java.util.Map">
        SELECT
        to_char(p.id) as "id",
        p.customs_code as "customsCode",
        to_date(p.fill_in_date, 'yyyy-MM-dd') as "fillInDate",
        p.gf_name as "gfName",
        p.gf_tax_no as "gfTaxNo",
        p.export_tax_amount as "exportTaxAmount",
        p.yx_export_tax_amount as "yxExportTaxAmount",
        p.data_sources as "dataSources",
        p.apply_check as "applyCheck",
        p.audit_status as "auditStatus",
        p.export_no as "exportNo",
        p.cxbdk_status as "cxbdkStatus",
        p.auth_status as "authStatus",
        p.bdk_status as "bdkStatus"
        FROM
        t_dx_export_customs p
        where
        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.sfDkStatus!=null and queryParams.sfDkStatus == '0'.toString()">
            and (p.auth_status in('0','5','6') or (p.bdk_status = '2' and p.auth_status != '4'))
        </if>

        <if test="queryParams.sfDkStatus!=null and queryParams.sfDkStatus == '4'.toString()">
            and p.bdk_status = '2' and p.auth_status='4'
        </if>

        <if test="queryParams.gfsh!=null and queryParams.gfsh!=''">
            and p.gf_tax_no = #{queryParams.gfsh}
        </if>

        <if test="queryParams.customsCode!=null and queryParams.customsCode!=''">
            and p.customs_code = #{queryParams.customsCode}
        </if>

        <if test="queryParams.exportNo!=null and queryParams.exportNo!=''">
            and p.export_no = #{queryParams.exportNo}
        </if>

        <if test="queryParams.fillInDateStart!=null and queryParams.fillInDateStart!=''">
            and to_char(p.fill_in_date,'yyyy-mm-dd hh24:mi:ss') &gt;= #{queryParams.fillInDateStart}
        </if>

        <if test="queryParams.fillInDateEnd!=null and queryParams.fillInDateEnd!=''">
            and to_char(p.fill_in_date,'yyyy-mm-dd hh24:mi:ss') &lt;= #{queryParams.fillInDateEnd}
        </if>

        <if test="queryParams.exportTaxAmountMin!=null and queryParams.exportTaxAmountMin!=''">
            and p.export_tax_amount &gt;= #{queryParams.exportTaxAmountMin}+0
        </if>

        <if test="queryParams.exportTaxAmountMax!=null and queryParams.exportTaxAmountMax!=''">
            and p.export_tax_amount &lt;= #{queryParams.exportTaxAmountMax}+0
        </if>
        order by p.fill_in_date desc
    </select>

    <select databaseId="oracle" id="queryRzcxBySum"
            parameterType="com.dxhy.domestic.model.dto.TdxExportCustomsModelDTO" resultType="java.util.Map">
        SELECT
        count(1) as "hjsl",
        '' as "hjje",
        sum(p.export_tax_amount) as "hjse"
        FROM
        t_dx_export_customs p
        where
        p.auth_status !='0'
        <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.customsCode!=null and queryParams.customsCode!=''">
            and p.customs_code = #{queryParams.customsCode}
        </if>

        <if test="queryParams.fillInDateStart!=null and queryParams.fillInDateStart!=''">
            and to_char(p.fill_in_date,'yyyy-mm-dd hh24:mi:ss') &gt;= #{queryParams.fillInDateStart}
        </if>

        <if test="queryParams.fillInDateEnd!=null and queryParams.fillInDateEnd!=''">
            and to_char(p.fill_in_date,'yyyy-mm-dd hh24:mi:ss') &lt;= #{queryParams.fillInDateEnd}
        </if>
        <if test="queryParams.exportTaxAmountMin!=null and queryParams.exportTaxAmountMin!=''">
            and p.export_tax_amount &gt;= #{queryParams.exportTaxAmountMin}+0
        </if>
        <if test="queryParams.exportTaxAmountMax!=null and queryParams.exportTaxAmountMax!=''">
            and p.export_tax_amount &lt;= #{queryParams.exportTaxAmountMax}+0
        </if>

        <if test="queryParams.exportNo!=null and queryParams.exportNo!=''">
            and p.export_no = #{queryParams.exportNo}
        </if>

        <if test="queryParams.rzhBelongDate!=null and queryParams.rzhBelongDate!=''">
            and p.rzh_belong_date = #{queryParams.rzhBelongDate}
        </if>

        <if test="queryParams.glzt!=null and queryParams.glzt!=''">
            and p.glzt = #{queryParams.glzt}
        </if>

        <if test="queryParams.rzhYesorno!=null and queryParams.rzhYesorno!=''">
            and p.rzh_yesorno = #{queryParams.rzhYesorno}
        </if>

        <if test="queryParams.bdkStatus!=null and queryParams.bdkStatus!=''">
            and p.bdk_status = #{queryParams.bdkStatus}
        </if>

        <if test="queryParams.authStatus!=null and queryParams.authStatus!=''">
            and p.auth_status = #{queryParams.authStatus}
        </if>

        <if test="queryParams.confirmUser!=null and queryParams.confirmUser!=''">
            and p.confirm_user = #{queryParams.confirmUser}
        </if>

        <if test="queryParams.rzhDateStart!=null and queryParams.rzhDateStart!=''">
            and to_char(p.rzh_date,'yyyy-mm-dd hh24:mi:ss') &gt;= #{queryParams.rzhDateStart}
        </if>

        <if test="queryParams.rzhDateEnd!=null and queryParams.rzhDateEnd!=''">
            and to_char(p.rzh_date,'yyyy-mm-dd hh24:mi:ss') &lt;= #{queryParams.rzhDateEnd}
        </if>
    </select>

    <select databaseId="oracle" id="queryRzcxByPage"
            parameterType="com.dxhy.domestic.model.dto.TdxExportCustomsModelDTO" resultType="java.util.Map">
        SELECT
        to_char(p.id) as "id",
        p.customs_code as "customsCode",
        to_date(p.fill_in_date, 'yyyy-MM-dd') as "fillInDate",
        p.gf_name as "gfName",
        p.gf_tax_no as "gfTaxNo",
        p.export_tax_amount as "exportTaxAmount",
        p.yx_export_tax_amount as "yxExportTaxAmount",
        p.data_sources as "dataSources",
        p.apply_check as "applyCheck",
        p.audit_status as "auditStatus",
        p.export_no as "exportNo",
        p.glzt as "glzt",
        to_date(p.rzh_date, 'yyyy-MM-dd') as "rzhDate",
        p.auth_status as "authStatus",
        p.rzh_yesorno as "rzhYesorno",
        p.bdk_status as "bdkStatus",
        p.confirm_user as "confirmUser",
        p.rzh_belong_date as "rzhBelongDate",
        p.cxrz_status as "cxrzStatus",
        p.cxbdk_status as "cxbdkStatus"
        FROM
        t_dx_export_customs p
        where
        p.auth_status !='0'
        <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.customsCode!=null and queryParams.customsCode!=''">
            and p.customs_code = #{queryParams.customsCode}
        </if>

        <if test="queryParams.fillInDateStart!=null and queryParams.fillInDateStart!=''">
            and to_char(p.fill_in_date,'yyyy-mm-dd hh24:mi:ss') &gt;= #{queryParams.fillInDateStart}
        </if>

        <if test="queryParams.fillInDateEnd!=null and queryParams.fillInDateEnd!=''">
            and to_char(p.fill_in_date,'yyyy-mm-dd hh24:mi:ss') &lt;= #{queryParams.fillInDateEnd}
        </if>

        <if test="queryParams.exportTaxAmountMin!=null and queryParams.exportTaxAmountMin!=''">
            and p.export_tax_amount &gt;= #{queryParams.exportTaxAmountMin}+0
        </if>

        <if test="queryParams.exportTaxAmountMax!=null and queryParams.exportTaxAmountMax!=''">
            and p.export_tax_amount &lt;= #{queryParams.exportTaxAmountMax}+0
        </if>

        <if test="queryParams.exportNo!=null and queryParams.exportNo!=''">
            and p.export_no = #{queryParams.exportNo}
        </if>

        <if test="queryParams.rzhBelongDate!=null and queryParams.rzhBelongDate!=''">
            and p.rzh_belong_date = #{queryParams.rzhBelongDate}
        </if>

        <if test="queryParams.glzt!=null and queryParams.glzt!=''">
            and p.glzt = #{queryParams.glzt}
        </if>

        <if test="queryParams.rzhYesorno!=null and queryParams.rzhYesorno!=''">
            and p.rzh_yesorno = #{queryParams.rzhYesorno}
        </if>

        <if test="queryParams.bdkStatus!=null and queryParams.bdkStatus!=''">
            and p.bdk_status = #{queryParams.bdkStatus}
        </if>

        <if test="queryParams.authStatus!=null and queryParams.authStatus!=''">
            and p.auth_status = #{queryParams.authStatus}
        </if>

        <if test="queryParams.confirmUser!=null and queryParams.confirmUser!=''">
            and p.confirm_user = #{queryParams.confirmUser}
        </if>

        <if test="queryParams.rzhDateStart!=null and queryParams.rzhDateStart!=''">
            and to_char(p.rzh_date,'yyyy-mm-dd hh24:mi:ss') &gt;= #{queryParams.rzhDateStart}
        </if>

        <if test="queryParams.rzhDateEnd!=null and queryParams.rzhDateEnd!=''">
            and to_char(p.rzh_date,'yyyy-mm-dd hh24:mi:ss') &lt;= #{queryParams.rzhDateEnd}
        </if>
        order by p.confirm_date desc
    </select>

    <select databaseId="oracle"
            id="queryExportCustomsList" parameterType="com.dxhy.domestic.model.dto.TdxExportCustomsModelDTO"
            resultType="java.util.Map">
        SELECT
        p.id as "id",
        p.customs_code as "customsCode",
        to_date(p.fill_in_date, 'yyyy-MM-dd') as "fillInDate",
        p.gf_name as "gfName",
        p.gf_tax_no as "gfTaxNo",
        p.export_tax_amount as "exportTaxAmount",
        p.yx_export_tax_amount as "yxExportTaxAmount",
        p.data_sources as "dataSources",
        p.apply_check as "applyCheck",
        p.audit_status as "auditStatus",
        p.export_no as "exportNo",
        p.glzt as "glzt",
        to_date( p.rzh_date , 'yyyy-MM-dd') as "rzhDate",
        p.auth_status as "authStatus",
        p.rzh_yesorno as "rzhYesorno",
        p.bdk_status as "bdkStatus",
        p.confirm_user as "confirmUser",
        p.rzh_belong_date as "rzhBelongDate",
        p.cxrz_status as "cxrzStatus"
        FROM
        t_dx_export_customs p
        where 1=1
        <include refid="queryExportCustoms_oracle"/>
        order by p.fill_in_date desc
    </select>

    <select databaseId="oracle"
            id="queryExportCustomsSum" parameterType="com.dxhy.domestic.model.dto.TdxExportCustomsModelDTO"
            resultType="java.util.Map">
        SELECT
        count(1) as "hjsl",
        '' as "hjje",
        sum(p.export_tax_amount) as "hjse"
        FROM
        t_dx_export_customs p
        where 1=1
        <include refid="queryExportCustoms_oracle"/>
    </select>

    <select databaseId="oracle" id="selectDkse"
            parameterType="java.util.Map" resultType="com.dxhy.domestic.entity.TdxExportCustoms">
        select sum(t.yx_export_tax_amount) yxTaxAmount
        from t_dx_export_customs t
        WHERE t.data_type = '17'
          and (t.rzh_yesorno = "1" or t.auth_status in ("2", "3", "4"))
          and t.gf_tax_no = #{gfsh}
          and t.rzh_belong_date = #{skssq}

    </select>
    <sql id="Base_Column_List">
        id, gf_name, gf_tax_no, customs_code, export_no, payer_one_taxno, payer_one_name,
    payer_two_taxno, payer_two_name, fill_in_date, export_tax_amount, yx_export_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, audit_status, apply_check, fail_reason, check_status,
    rzh_date, confirm_date, rzh_type, rzh_yesorno, rzh_back_msg, dqskssq, gxjzr, gxfwq,
    gxfwz, detail_yesorno, auth_status, send_date, rzlx, confirm_user, glzt, xxly, cxrz_status,
    cxrz_date, cxrz_current_period, bdk_status, cxbdk_status, cxbdk_date, bdk_current_period,
    entry_discrepancy, company,rzh_belong_date
    </sql>

    <sql id="queryExportCustoms_sql">
        <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.customsCode!=null and queryParams.customsCode!=''">
            and p.customs_code = #{queryParams.customsCode}
        </if>

        <if test="queryParams.fillInDateStart!=null and queryParams.fillInDateStart!=''">
            and p.fill_in_date &gt;= #{queryParams.fillInDateStart}
        </if>

        <if test="queryParams.fillInDateEnd!=null and queryParams.fillInDateEnd!=''">
            and p.fill_in_date &lt;= #{queryParams.fillInDateEnd}
        </if>

        <if test="queryParams.exportTaxAmountMin!=null and queryParams.exportTaxAmountMin!=''">
            and p.export_tax_amount &gt;= #{queryParams.exportTaxAmountMin}+0
        </if>

        <if test="queryParams.exportTaxAmountMax!=null and queryParams.exportTaxAmountMax!=''">
            and p.export_tax_amount &lt;= #{queryParams.exportTaxAmountMax}+0
        </if>

        <if test="queryParams.exportNo!=null and queryParams.exportNo!=''">
            and p.export_no = #{queryParams.exportNo}
        </if>

        <if test="queryParams.rzhBelongDate!=null and queryParams.rzhBelongDate!=''">
            and p.rzh_belong_date = #{queryParams.rzhBelongDate}
        </if>

        <if test="queryParams.glzt!=null and queryParams.glzt!=''">
            and p.glzt = #{queryParams.glzt}
        </if>

        <if test="queryParams.rzhYesorno!=null and queryParams.rzhYesorno!=''">
            and p.rzh_yesorno = #{queryParams.rzhYesorno}
        </if>

        <if test="queryParams.bdkStatus!=null and queryParams.bdkStatus!=''">
            and p.bdk_status = #{queryParams.bdkStatus}
        </if>

        <if test="queryParams.applyCheck!=null and queryParams.applyCheck!=''">
            and p.apply_check = #{queryParams.applyCheck}
        </if>

        <if test="queryParams.auditStatus!=null and queryParams.auditStatus!=''">
            and p.audit_status = #{queryParams.auditStatus}
        </if>

        <if test="queryParams.authStatus!=null and queryParams.authStatus!=''">
            and p.auth_status = #{queryParams.authStatus}
        </if>

        <if test="queryParams.confirmUser!=null and queryParams.confirmUser!=''">
            and p.confirm_user = #{queryParams.confirmUser}
        </if>

        <if test="queryParams.rzhDateStart!=null and queryParams.rzhDateStart!=''">
            and p.rzh_date &gt;= #{queryParams.rzhDateStart}
        </if>

        <if test="queryParams.rzhDateEnd!=null and queryParams.rzhDateEnd!=''">
            and p.rzh_date &lt;= #{queryParams.rzhDateEnd}
        </if>
    </sql>
    <sql id="queryExportCustoms_oracle">
        <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.customsCode!=null and queryParams.customsCode!=''">
            and p.customs_code = #{queryParams.customsCode}
        </if>

        <if test="queryParams.fillInDateStart!=null and queryParams.fillInDateStart!=''">
            and to_char(p.fill_in_date,'yyyy-mm-dd hh:mm:ss') &gt;= #{queryParams.fillInDateStart}
        </if>

        <if test="queryParams.fillInDateEnd!=null and queryParams.fillInDateEnd!=''">
            and to_char(p.fill_in_date,'yyyy-mm-dd hh:mm:ss') &lt;= #{queryParams.fillInDateEnd}
        </if>

        <if test="queryParams.exportTaxAmountMin!=null and queryParams.exportTaxAmountMin!=''">
            and p.export_tax_amount &gt;= #{queryParams.exportTaxAmountMin}+0
        </if>

        <if test="queryParams.exportTaxAmountMax!=null and queryParams.exportTaxAmountMax!=''">
            and p.export_tax_amount &lt;= #{queryParams.exportTaxAmountMax}+0
        </if>

        <if test="queryParams.exportNo!=null and queryParams.exportNo!=''">
            and p.export_no = #{queryParams.exportNo}
        </if>

        <if test="queryParams.rzhBelongDate!=null and queryParams.rzhBelongDate!=''">
            and p.rzh_belong_date = #{queryParams.rzhBelongDate}
        </if>

        <if test="queryParams.glzt!=null and queryParams.glzt!=''">
            and p.glzt = #{queryParams.glzt}
        </if>

        <if test="queryParams.rzhYesorno!=null and queryParams.rzhYesorno!=''">
            and p.rzh_yesorno = #{queryParams.rzhYesorno}
        </if>

        <if test="queryParams.bdkStatus!=null and queryParams.bdkStatus!=''">
            and p.bdk_status = #{queryParams.bdkStatus}
        </if>

        <if test="queryParams.applyCheck!=null and queryParams.applyCheck!=''">
            and p.apply_check = #{queryParams.applyCheck}
        </if>

        <if test="queryParams.auditStatus!=null and queryParams.auditStatus!=''">
            and p.audit_status = #{queryParams.auditStatus}
        </if>

        <if test="queryParams.authStatus!=null and queryParams.authStatus!=''">
            and p.auth_status = #{queryParams.authStatus}
        </if>

        <if test="queryParams.confirmUser!=null and queryParams.confirmUser!=''">
            and p.confirm_user = #{queryParams.confirmUser}
        </if>

        <if test="queryParams.rzhDateStart!=null and queryParams.rzhDateStart!=''">
            and to_char(p.rzh_date,'yyyy-mm-dd hh:mm:ss') &gt;= #{queryParams.rzhDateStart}
        </if>

        <if test="queryParams.rzhDateEnd!=null and queryParams.rzhDateEnd!=''">
            and to_char(p.rzh_date,'yyyy-mm-dd hh:mm:ss') &lt;= #{queryParams.rzhDateEnd}
        </if>
    </sql>
</mapper>
