<?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.core.dao.TDxExportInvoiceDao">
    <resultMap id="BaseResultMap" type="com.dxhy.core.entity.TDxExportInvoice">
        <id column="id" jdbcType="BIGINT" property="id"/>
        <result column="export_no" jdbcType="VARCHAR" property="exportNo"/>
        <result column="invoice_code" jdbcType="VARCHAR" property="invoiceCode"/>
        <result column="invoice_no" jdbcType="VARCHAR" property="invoiceNo"/>
        <result column="invoice_type" jdbcType="VARCHAR" property="invoiceType"/>
        <result column="invoice_status" jdbcType="VARCHAR" property="invoiceStatus"/>
        <result column="invoice_date" jdbcType="TIMESTAMP" property="invoiceDate"/>
        <result column="gf_tax_no" jdbcType="VARCHAR" property="gfTaxNo"/>
        <result column="gf_name" jdbcType="VARCHAR" property="gfName"/>
        <result column="xf_tax_no" jdbcType="VARCHAR" property="xfTaxNo"/>
        <result column="xf_name" jdbcType="VARCHAR" property="xfName"/>
        <result column="export_amount" jdbcType="DECIMAL" property="exportAmount"/>
        <result column="export_tax_amount" jdbcType="DECIMAL" property="exportTaxAmount"/>
        <result column="export_yxse" jdbcType="DECIMAL" property="exportYxse"/>
        <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_yesorno" jdbcType="VARCHAR" property="rzhYesorno"/>
        <result column="uuid" jdbcType="VARCHAR" property="uuid"/>
        <result column="create_date" jdbcType="TIMESTAMP" property="createDate"/>
        <result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/>
        <result column="rzh_back_msg" jdbcType="VARCHAR" property="rzhBackMsg"/>
        <result column="check_code" jdbcType="VARCHAR" property="checkCode"/>
        <result column="txfbz" jdbcType="VARCHAR" property="txfbz"/>
        <result column="lslbz" jdbcType="VARCHAR" property="lslbz"/>
        <result column="confirm_user" jdbcType="VARCHAR" property="confirmUser"/>
        <result column="glzt" jdbcType="VARCHAR" property="glzt"/>
        <result column="xxly" jdbcType="VARCHAR" property="xxly"/>
        <result column="yqkgxbz" jdbcType="VARCHAR" property="yqkgxbz"/>
        <result column="company" jdbcType="VARCHAR" property="company"/>
        <result column="cxrz_status" jdbcType="VARCHAR" property="cxrzStatus"/>
        <result column="cxrz_date" jdbcType="TIMESTAMP" property="cxrzDate"/>
        <result column="bdk_status" jdbcType="VARCHAR" property="bdkStatus"/>
        <result column="cxrz_current_period" jdbcType="VARCHAR" property="cxrzCurrentPeriod"/>
        <result column="bdk_current_period" jdbcType="VARCHAR" property="bdkCurrentPeriod"/>
        <result column="cxbdk_status" jdbcType="VARCHAR" property="cxbdkStatus"/>
        <result column="cxbdk_date" jdbcType="TIMESTAMP" property="cxbdkDate"/>
        <result column="auth_status" jdbcType="VARCHAR" property="authStatus"/>
    </resultMap>
    <sql id="Base_Column_List">
        id, export_no, invoice_code, invoice_no, invoice_type, invoice_status, invoice_date,
    gf_tax_no, gf_name, xf_tax_no, xf_name, export_amount, export_tax_amount, export_yxse,
    rzh_date, rzh_belong_date, confirm_date, rzh_yesorno, uuid, create_date, update_date,
    rzh_back_msg, check_code, txfbz, lslbz, confirm_user, glzt, xxly, yqkgxbz, company,
    cxrz_status, cxrz_date, bdk_status, cxrz_current_period, bdk_current_period, cxbdk_status,
    cxbdk_date, auth_status
    </sql>

    <select id="queryVatRzcx" parameterType="java.util.Map" resultType="com.dxhy.core.model.ExportInvoiceRzcxVO"
            databaseId="mysql">
        SELECT
        p.id as id,
        p.export_no as exportNo,
        p.invoice_code as invoiceCode,
        p.invoice_no as invoiceNo,
        p.invoice_status as invoiceStatus,
        date_format(p.invoice_date,'%Y-%m-%d') as invoiceDate,
        p.invoice_type as invoiceType,
        p.gf_name as gfName,
        p.xf_name as xfName,
        p.export_amount as exportAmount,
        p.export_tax_amount as exportTaxAmount,
        p.export_yxse as exportYxse,
        p.gf_tax_no as gfTaxNo,
        p.xf_tax_no as xfTaxNo,
        date_format(p.rzh_date,'%Y-%m-%d') as rzhDate,
        p.rzh_yesorno as rzhYesorno,
        p.auth_status as authStatus,
        p.bdk_status as bdkStatus,
        p.confirm_user as confirmUser,
        p.rzh_belong_date as rzhBelongDate,
        p.cxbdk_status as cxbdkStatus,
        p.cxrz_status as cxrzStatus
        FROM
        t_dx_export_invoice p
        where
        p.auth_status != '0'
        <if test="queryParams.gfTaxNo!=null  and queryParams.gfTaxNo.size>0">
            and p.gf_tax_no in
            <foreach item="item" index="index" collection="queryParams.gfTaxNo" open="(" separator="," close=")">
                #{item,jdbcType=VARCHAR}
            </foreach>
        </if>

        <if test="queryParams.gfsh!=null and queryParams.gfsh!=''">
            and p.gf_tax_no = #{queryParams.gfsh}
        </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.rzhBelongDate!=null and queryParams.rzhBelongDate!=''">
            and p.rzh_belong_date = #{queryParams.rzhBelongDate}
        </if>

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

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

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

        <if test="queryParams.invoiceDateEnd!=null and queryParams.invoiceDateEnd!=''">
            and p.invoice_date &lt;= #{queryParams.invoiceDateEnd}
        </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>

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

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

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

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

        <if test="queryParams.invoiceStatus!=null and queryParams.invoiceStatus!=''">
            and p.invoice_status = #{queryParams.invoiceStatus}
        </if>
        <if test="queryParams.company != null and queryParams.company !=''">
            and p.company = #{queryParams.company}
        </if>
        order by p.confirm_date desc
    </select>
    <select id="queryVatRzcx" parameterType="java.util.Map" resultType="com.dxhy.core.model.ExportInvoiceRzcxVO"
            databaseId="oracle">
        SELECT
        p.id as id,
        p.export_no as exportNo,
        p.invoice_code as invoiceCode,
        p.invoice_no as invoiceNo,
        p.invoice_status as invoiceStatus,
        to_char(p.invoice_date,'yyyy-mm-dd') as invoiceDate,
        p.invoice_type as invoiceType,
        p.gf_name as gfName,
        p.xf_name as xfName,
        p.export_amount as exportAmount,
        p.export_tax_amount as exportTaxAmount,
        p.export_yxse as exportYxse,
        p.gf_tax_no as gfTaxNo,
        p.xf_tax_no as xfTaxNo,
        to_char(p.rzh_date,'yyyy-mm-dd') as rzhDate,
        p.rzh_yesorno as rzhYesorno,
        p.auth_status as authStatus,
        p.bdk_status as bdkStatus,
        p.confirm_user as confirmUser,
        p.rzh_belong_date as rzhBelongDate,
        p.cxbdk_status as cxbdkStatus,
        p.cxrz_status as cxrzStatus
        FROM
        t_dx_export_invoice p
        where
        p.auth_status != '0'
        <if test="queryParams.gfTaxNo!=null  and queryParams.gfTaxNo.size>0">
            and p.gf_tax_no in
            <foreach item="item" index="index" collection="queryParams.gfTaxNo" open="(" separator="," close=")">
                #{item,jdbcType=VARCHAR}
            </foreach>
        </if>

        <if test="queryParams.gfsh!=null and queryParams.gfsh!=''">
            and p.gf_tax_no = #{queryParams.gfsh}
        </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.rzhBelongDate!=null and queryParams.rzhBelongDate!=''">
            and p.rzh_belong_date = #{queryParams.rzhBelongDate}
        </if>

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

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

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

        <if test="queryParams.invoiceDateEnd!=null and queryParams.invoiceDateEnd!=''">
            and to_char(p.invoice_date,'yyyy-mm-dd hh24:mi:ss') &lt;= #{queryParams.invoiceDateEnd}
        </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>

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

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

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

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

        <if test="queryParams.invoiceStatus!=null and queryParams.invoiceStatus!=''">
            and p.invoice_status = #{queryParams.invoiceStatus}
        </if>
        <if test="queryParams.company != null and queryParams.company !=''">
            and p.company = #{queryParams.company}
        </if>
        order by p.confirm_date desc
    </select>
    <select id="queryRzcxSum" parameterType="java.util.Map" resultType="java.util.Map">
        SELECT
        sum(p.export_amount) as taxAmountSum,
        count(p.id) as number
        FROM
        t_dx_export_invoice p
        where
        p.auth_status != '0'
        <if test="queryParams.gfTaxNo!=null  and queryParams.gfTaxNo.size>0">
            and p.gf_tax_no in
            <foreach item="item" index="index" collection="queryParams.gfTaxNo" open="(" separator="," close=")">
                #{item,jdbcType=VARCHAR}
            </foreach>
        </if>

        <if test="queryParams.gfsh!=null and queryParams.gfsh!=''">
            and p.gf_tax_no = #{queryParams.gfsh}
        </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.rzhBelongDate!=null and queryParams.rzhBelongDate!=''">
            and p.rzh_belong_date = #{queryParams.rzhBelongDate}
        </if>

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

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

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

        <if test="queryParams.invoiceDateEnd!=null and queryParams.invoiceDateEnd!=''">
            and p.invoice_date &lt;= #{queryParams.invoiceDateEnd}
        </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>

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

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

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

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

    </select>
    <select id="queryExportInvoiceList" parameterType="java.util.Map"
            resultType="com.dxhy.core.model.ExportInvoiceRzcxVO" databaseId="mysql">
        SELECT
        p.id as id,
        p.export_no as exportNo,
        p.invoice_code as invoiceCode,
        p.invoice_no as invoiceNo,
        p.invoice_status as invoiceStatus,
        date_format(p.invoice_date,'%Y-%m-%d') as invoiceDate,
        p.invoice_type as invoiceType,
        p.gf_name as gfName,
        p.xf_name as xfName,
        p.export_amount as exportAmount,
        p.export_tax_amount as exportTaxAmount,
        p.export_yxse as exportYxse,
        p.gf_tax_no as gfTaxNo,
        p.xf_tax_no as xfTaxNo,
        date_format(p.rzh_date,'%Y-%m-%d') as rzhDate,
        p.rzh_yesorno as rzhYesorno,
        p.auth_status as authStatus,
        p.bdk_status as bdkStatus,
        p.confirm_user as confirmUser,
        p.rzh_belong_date as rzhBelongDate,
        p.cxbdk_status as cxbdkStatus
        FROM
        t_dx_export_invoice p
        where 1=1
        <include refid="queryExportInvoice_sql"/>
        order by p.invoice_date desc
    </select>
    <select id="queryExportInvoiceList" parameterType="java.util.Map"
            resultType="com.dxhy.core.model.ExportInvoiceRzcxVO" databaseId="oracle">
        SELECT
        p.id as id,
        p.export_no as exportNo,
        p.invoice_code as invoiceCode,
        p.invoice_no as invoiceNo,
        p.invoice_status as invoiceStatus,
        to_char(p.invoice_date,'yyyy-mm-dd') as invoiceDate,
        p.invoice_type as invoiceType,
        p.gf_name as gfName,
        p.xf_name as xfName,
        p.export_amount as exportAmount,
        p.export_tax_amount as exportTaxAmount,
        p.export_yxse as exportYxse,
        p.gf_tax_no as gfTaxNo,
        p.xf_tax_no as xfTaxNo,
        to_char(p.rzh_date,'yyyy-mm-dd') as rzhDate,
        p.rzh_yesorno as rzhYesorno,
        p.auth_status as authStatus,
        p.bdk_status as bdkStatus,
        p.confirm_user as confirmUser,
        p.rzh_belong_date as rzhBelongDate,
        p.cxbdk_status as cxbdkStatus
        FROM
        t_dx_export_invoice p
        where 1=1
        <include refid="queryExportInvoice_oracle"/>
        order by p.invoice_date desc
    </select>
    <select id="queryExportInvoiceSum" parameterType="java.util.Map" resultType="java.util.Map">
        SELECT
        count(1) as hjsl,
        sum(p.export_amount) as hjje,
        sum(p.export_tax_amount) as hjse
        FROM
        t_dx_export_invoice p
        where 1=1
        <include refid="queryExportInvoice_sql"/>
    </select>
    <sql id="queryExportInvoice_sql">
        <if test="queryParams.gfTaxNoList!=null  and queryParams.gfTaxNoList.size>0">
            and p.gf_tax_no in
            <foreach item="item" index="index" collection="queryParams.gfTaxNoList" open="(" separator="," close=")">
                #{item,jdbcType=VARCHAR}
            </foreach>
        </if>
        <if test="queryParams.rzhYesorno!=null and queryParams.rzhYesorno!=''">
            and p.rzh_yesorno = #{queryParams.rzhYesorno}
        </if>

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

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

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

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

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

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

        <if test="queryParams.invoiceDateEnd!=null and queryParams.invoiceDateEnd!=''">
            and p.invoice_date &lt;= #{queryParams.invoiceDateEnd}
        </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>

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

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

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

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

        <if test="queryParams.invoiceStatus!=null and queryParams.invoiceStatus!=''">
            and p.invoice_status = #{queryParams.invoiceStatus}
        </if>
        <if test="queryParams.company !=null and queryParams.company !=''">
            and p.company = #{queryParams.company}
        </if>
    </sql>
    <sql id="queryExportInvoice_oracle">
        <if test="queryParams.gfTaxNoList!=null  and queryParams.gfTaxNoList.size>0">
            and p.gf_tax_no in
            <foreach item="item" index="index" collection="queryParams.gfTaxNoList" open="(" separator="," close=")">
                #{item,jdbcType=VARCHAR}
            </foreach>
        </if>
        <if test="queryParams.rzhYesorno!=null and queryParams.rzhYesorno!=''">
            and p.rzh_yesorno = #{queryParams.rzhYesorno}
        </if>

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

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

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

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

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

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

        <if test="queryParams.invoiceDateEnd!=null and queryParams.invoiceDateEnd!=''">
            and to_char(p.invoice_date,'yyyy-mm-dd hh:mm:ss') &lt;= #{queryParams.invoiceDateEnd}
        </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>

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

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

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

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

        <if test="queryParams.invoiceStatus!=null and queryParams.invoiceStatus!=''">
            and p.invoice_status = #{queryParams.invoiceStatus}
        </if>
        <if test="queryParams.company !=null and queryParams.company !=''">
            and p.company = #{queryParams.company}
        </if>
    </sql>
</mapper>
