<?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.jxpt.baseService.sign.dao.SignInvoiceDao">
    <resultMap id="BaseResultMap" type="com.dxhy.api.model.sign.TDxInvoice">
        <id column="id" property="id"/>
        <result column="invoice_code" property="invoiceCode"/>
        <result column="invoice_no" property="invoiceNo"/>
        <result column="eleInvoiceNo" property="eleInvoiceNo"/>
        <result column="invoice_date" property="invoiceDate"/>
        <result column="invoice_amount" property="invoiceAmount"/>
        <result column="tax_amount" property="taxAmount"/>
        <result column="invoice_date" property="invoiceDate"/>
        <result column="user_name" property="userName"/>
        <result column="qs_type" property="qsType"/>
        <result column="qs_status" property="qsStatus"/>
        <result column="uuid" property="uuid"/>
        <result column="qs_date" property="qsDate"/>
        <result column="notes" property="notes"/>
        <result column="dept_id" property="deptId"/>
        <result column="scan_id" property="scanId"/>
        <result column="remark" property="remark"/>
        <result column="create_date" property="createDate"/>
        <result column="voucher_number" property="voucherNumber"/>
        <result column="image_path" property="imagePath"/>
    </resultMap>

    <resultMap id="BaseResultCountMap" type="com.dxhy.api.model.sign.QsInvoiceCount">
        <result column="sumTaxAmount" property="sumTaxAmount"/>
        <result column="sumInvoiceAmount" property="sumInvoiceAmount"/>
    </resultMap>

    <select id="selectQsfpList" parameterType="java.util.Map"
            resultMap="BaseResultMap" databaseId="mysql">
        SELECT
        t.id,t.notes,t.qs_type,t.qs_status,t.qs_date,t.user_name,t.invoice_code,t.invoice_no,t.ele_invoice_no eleInvoiceNo,t.uuid,t.invoice_date,t.invoice_type,t.invoice_amount,t.tax_amount
        ,t.dept_id,t.dept_name,t.scan_id,t.gf_name,t.xf_name,t.gf_tax_no,t.xf_tax_no,t.check_code,t.remark,t.create_date,t.total_amount,
        t.voucher_number,img.image_path
        FROM t_dx_invoice t
        left join t_dx_invoice_img img on t.scan_id = img.scan_id
        WHERE t.valid = '1'
        <if test="qsNameFlag==null">
            and t.user_account = #{userId}
        </if>
        <if test="gfsh != '99' and gfsh != null and gfsh != '' and gfsh != 'null'">
            and t.gf_tax_no = #{gfsh}
        </if>
        <!--
        <if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' ">
            and t.invoice_type = #{invoiceType}
        </if>
        -->
        <if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType == '14' ">
            and (t.invoice_type = '14' or (t.invoice_type = '32' and t.lq_tdyslxDm='08') )
        </if>
        <if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType == '32' ">
            and t.invoice_type = #{invoiceType} and t.lq_tdyslxDm!='08'
        </if>
        <if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType != '14' and invoiceType != '32' and invoiceType != '99'">
            and t.invoice_type = #{invoiceType}
        </if>
        <if test="invoiceCode != null and invoiceCode != '' and invoiceCode != 'null' ">
            and t.invoice_code = #{invoiceCode}
        </if>
        <if test="invoiceNo != null and invoiceNo != '' and invoiceNo != 'null' ">
            and t.invoice_no = #{invoiceNo}
        </if>
        <if test="eleInvoiceNo!=null and eleInvoiceNo!='' and eleInvoiceNo!='null'">
            and t.ele_invoice_no = #{eleInvoiceNo}
        </if>
        <if test="businessCode != '99' and businessCode != null and businessCode != '' and businessCode != 'null'">
            and t.dept_id = #{businessCode}
        </if>
        <if test="businessCode == ''">
            and (t.dept_id is null or t.dept_id='' or t.dept_id='99')
        </if>
        <if test="qsStatus != null and qsStatus != '' and qsStatus != 'null' ">
            and t.qs_status = #{qsStatus}
        </if>
        <if test="qsType != null and qsType != '' and qsType != 'null' ">
            and t.qs_type = #{qsType}
        </if>
        <if test="notes != null and notes != '' and notes != 'null' ">
            and t.notes like concat(#{notes},'%')
        </if>
        <if test="xfsh != null and xfsh != '' and xfsh != 'null' ">
            and t.xf_tax_no like concat(#{xfsh},'%')
        </if>
        <if test="createDateBegin != null and createDateBegin != '' and createDateBegin != 'null' ">
            <![CDATA[ AND t.create_date >= #{createDateBegin} ]]>
        </if>
        <if test="createDateEnd != null and createDateEnd != '' and createDateEnd != 'null' ">
            <![CDATA[ AND t.create_date <= #{createDateEnd} ]]>
        </if>
        AND t.qs_date BETWEEN #{qsrqq} AND #{qsrqz}
        <if test="company!=null and company!=''">
            and t.company = #{company}
        </if>
        <if test="xfmc!=null and xfmc!=''">
            and t.xf_name like concat(#{xfmc},'%')
        </if>
        <if test="invoiceSource!=null and invoiceSource!='' and invoiceSource!='99'">
            and t.invoice_source  = #{invoiceSource}
        </if>
        ORDER BY t.invoice_serial_no desc , t.qs_date desc
    </select>

    <select id="selectQsfpList" parameterType="java.util.Map"
            resultMap="BaseResultMap" databaseId="oracle">
        SELECT
        t.id,t.notes,t.qs_type,t.qs_status,t.qs_date,t.user_name,t.invoice_code,t.invoice_no,t.ele_invoice_no eleInvoiceNo,t.uuid,t.invoice_date,t.invoice_type,t.invoice_amount,t.tax_amount,t.dept_id,t.dept_name
        ,t.scan_id,t.gf_name,t.xf_name,t.gf_tax_no,t.xf_tax_no,t.check_code,t.remark,t.create_date,t.total_amount,t.voucher_number,img.image_path
        FROM t_dx_invoice t
        left join t_dx_invoice_img img on t.scan_id = img.scan_id
        WHERE t.valid = '1'
        <if test="qsNameFlag==null">
            and t.user_account = #{userId}
        </if>
        <if test="gfsh != null and gfsh != '' and gfsh != 'null' and gfsh != '99' ">
            and t.gf_tax_no = #{gfsh}
        </if>
        <!--
        <if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' ">
            and t.invoice_type = #{invoiceType}
        </if>
        -->
        <if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType == '14' ">
            and (t.invoice_type = '14' or (t.invoice_type = '32' and t.lq_tdyslxDm='08') )
        </if>
        <if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType == '32' ">
            and t.invoice_type = #{invoiceType} and t.lq_tdyslxDm!='08'
        </if>
        <if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType != '14' and invoiceType != '32' and invoiceType != '99'">
            and t.invoice_type = #{invoiceType}
        </if>
        <if test="invoiceCode != null and invoiceCode != '' and invoiceCode != 'null' ">
            and t.invoice_code = #{invoiceCode}
        </if>
        <if test="invoiceNo != null and invoiceNo != '' and invoiceNo != 'null' ">
            and t.invoice_no = #{invoiceNo}
        </if>
        <if test="eleInvoiceNo!=null and eleInvoiceNo!='' and eleInvoiceNo!='null'">
            and t.ele_invoice_no = #{eleInvoiceNo}
        </if>
        <if test="businessCode != '99' and businessCode != null and businessCode != '' and businessCode != 'null'">
            and t.dept_id = #{businessCode}
        </if>
        <if test="businessCode == ''">
            and (tt.dept_id is null or t.dept_id='' or t.dept_id='99')
        </if>
        <if test="qsStatus != null and qsStatus != '' and qsStatus != 'null' ">
            and t.qs_status = #{qsStatus}
        </if>
        <if test="qsType != null and qsType != '' and qsType != 'null' ">
            and t.qs_type = #{qsType}
        </if>
        <if test="notes != null and notes != '' and notes != 'null' ">
            and t.notes like concat(#{notes},'%')
        </if>
        <if test="xfsh != null and xfsh != '' and xfsh != 'null' ">
            and t.xf_tax_no like concat(#{xfsh},'%')
        </if>
        <if test="createDateBegin != null and createDateBegin != '' and createDateBegin != 'null' ">
            <![CDATA[ AND to_char(t.create_date,'yyyy-mm-dd hh24:mi:ss') >= #{createDateBegin} ]]>
        </if>
        <if test="createDateEnd != null and createDateEnd != '' and createDateEnd != 'null' ">
            <![CDATA[ AND to_char(t.create_date,'yyyy-mm-dd hh24:mi:ss') <= #{createDateEnd} ]]>
        </if>
        AND TO_CHAR(t.QS_DATE, 'yyyy-mm-dd hh24:mi:ss') between #{qsrqq} and #{qsrqz}
        <if test="company!=null and company!=''">
            and t.company = #{company}
        </if>

        <if test="xfmc!=null and xfmc!=''">
            and t.xf_name like concat(#{xfmc},'%')
        </if>
        <if test="invoiceSource!=null and invoiceSource!='' and invoiceSource!='99'">
            and t.invoice_source  = #{invoiceSource}
        </if>
        ORDER BY t.invoice_serial_no desc, t.qs_date desc
    </select>


    <select id="selectQsfpListCount" parameterType="java.util.Map"
            resultMap="BaseResultCountMap" databaseId="mysql">
        SELECT sum(t.invoice_amount) sumInvoiceAmount,
        sum(t.tax_amount) sumTaxAmount
        FROM t_dx_invoice t
        WHERE t.valid = '1'
        <if test="qsNameFlag==null">
            and t.user_account = #{userId}
        </if>
        <if test="gfsh != null and gfsh != '' and gfsh != 'null' and gfsh != '99' ">
            and t.gf_tax_no = #{gfsh}
        </if>
        <!--
        <if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' ">
            and t.invoice_type = #{invoiceType}
        </if>
        -->
        <if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType == '14' ">
            and (t.invoice_type = '14' or (t.invoice_type = '32' and t.lq_tdyslxDm='08') )
        </if>
        <if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType == '32' ">
            and t.invoice_type = #{invoiceType} and t.lq_tdyslxDm!='08'
        </if>
        <if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType != '14' and invoiceType != '32' and invoiceType != '99'">
            and t.invoice_type = #{invoiceType}
        </if>
        <if test="invoiceCode != null and invoiceCode != '' and invoiceCode != 'null' ">
            and t.invoice_code = #{invoiceCode}
        </if>
        <if test="invoiceNo != null and invoiceNo != '' and invoiceNo != 'null' ">
            and t.invoice_no = #{invoiceNo}
        </if>
        <if test="eleInvoiceNo!=null and eleInvoiceNo!='' and eleInvoiceNo!='null'">
            and t.ele_invoice_no = #{eleInvoiceNo}
        </if>
        <if
                test="businessCode != '99' and businessCode != null and businessCode != '' and businessCode != 'null'">
            and t.dept_id = #{businessCode}
        </if>
        <if test="businessCode == ''">
            and (t.dept_id is null or t.dept_id='' or t.dept_id='99')
        </if>
        <if test="voucherNumber != null and voucherNumber != ''">
            and t.voucher_number like concat('%',concat(#{voucherNumber},'%'))
        </if>
        <if test="qsStatus != null and qsStatus != '' and qsStatus != 'null' ">
            and t.qs_status = #{qsStatus}
        </if>
        <if test="qsType != null and qsType != '' and qsType != 'null' ">
            and t.qs_type = #{qsType}
        </if>
        <if test="notes != null and notes != '' and notes != 'null' ">
            and t.notes like concat(#{notes},'%')
        </if>
        <if test="xfsh != null and xfsh != '' and xfsh != 'null' ">
            and t.xf_tax_no like concat(#{xfsh},'%')
        </if>
        <if test="createDateBegin != null and createDateBegin != '' and createDateBegin != 'null' ">
            <![CDATA[ AND t.create_date >= #{createDateBegin} ]]>
        </if>
        <if test="createDateEnd != null and createDateEnd != '' and createDateEnd != 'null' ">
            <![CDATA[ AND t.create_date <= #{createDateEnd} ]]>
        </if>
        AND t.qs_date BETWEEN #{qsrqq} AND #{qsrqz}
        <if test="company!=null and company!=''">
            and t.company = #{company}
        </if>
        <if test="xfmc!=null and xfmc!=''">
            and t.xf_name like concat(#{xfmc},'%')
        </if>
        <if test="invoiceSource!=null and invoiceSource!='' and invoiceSource!='99'">
            and t.invoice_source  = #{invoiceSource}
        </if>
    </select>

    <select id="selectQsfpListCount" parameterType="java.util.Map"
            resultMap="BaseResultCountMap" databaseId="oracle">
        SELECT sum(t.invoice_amount) sumInvoiceAmount,
        sum(t.tax_amount) sumTaxAmount
        FROM t_dx_invoice t
        WHERE t.valid = '1'
        <if test="qsNameFlag==null">
            and t.user_account = #{userId}
        </if>
        <if test="gfsh != null and gfsh != '' and gfsh != 'null' and gfsh != '99' ">
            and t.gf_tax_no = #{gfsh}
        </if>
        <!--
        <if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' ">
            and t.invoice_type = #{invoiceType}
        </if>
        -->
        <if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType == '14' ">
            and (t.invoice_type = '14' or (t.invoice_type = '32' and t.lq_tdyslxDm='08') )
        </if>
        <if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType == '32' ">
            and t.invoice_type = #{invoiceType} and t.lq_tdyslxDm!='08'
        </if>
        <if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType != '14' and invoiceType != '32' and invoiceType != '99'">
            and t.invoice_type = #{invoiceType}
        </if>
        <if test="invoiceCode != null and invoiceCode != '' and invoiceCode != 'null' ">
            and t.invoice_code = #{invoiceCode}
        </if>
        <if test="invoiceNo != null and invoiceNo != '' and invoiceNo != 'null' ">
            and t.invoice_no = #{invoiceNo}
        </if>
        <if test="eleInvoiceNo!=null and eleInvoiceNo!='' and eleInvoiceNo!='null'">
            and t.ele_invoice_no = #{eleInvoiceNo}
        </if>
        <if
                test="businessCode != '99' and businessCode != null and businessCode != '' and businessCode != 'null'">
            and t.dept_id = #{businessCode}
        </if>
        <if test="businessCode == ''">
            and (t.dept_id is null or t.dept_id='' or t.dept_id='99')
        </if>
        <if test="qsStatus != null and qsStatus != '' and qsStatus != 'null' ">
            and t.qs_status = #{qsStatus}
        </if>
        <if test="qsType != null and qsType != '' and qsType != 'null' ">
            and t.qs_type = #{qsType}
        </if>
        <if test="notes != null and notes != '' and notes != 'null' ">
            and t.notes like concat(#{notes},'%')
        </if>
        <if test="xfsh != null and xfsh != '' and xfsh != 'null' ">
            and t.xf_tax_no like concat(#{xfsh},'%')
        </if>
        <if test="createDateBegin != null and createDateBegin != '' and createDateBegin != 'null' ">
            <![CDATA[ AND to_char(t.create_date,'yyyy-mm-dd hh24:mi:ss') >= #{createDateBegin} ]]>
        </if>
        <if test="createDateEnd != null and createDateEnd != '' and createDateEnd != 'null' ">
            <![CDATA[ AND to_char(t.create_date,'yyyy-mm-dd hh24:mi:ss') <= #{createDateEnd} ]]>
        </if>
        AND TO_CHAR(t.QS_DATE, 'yyyy-mm-dd hh24:mi:ss') between #{qsrqq} and #{qsrqz}
        <if test="company!=null and company!=''">
            and t.company = #{company}
        </if>
        <if test="xfmc!=null and xfmc!=''">
            and t.xf_name like concat(#{xfmc},'%')
        </if>
        <if test="invoiceSource!=null and invoiceSource!='' and invoiceSource!='99'">
            and t.invoice_source  = #{invoiceSource}
        </if>
    </select>


    <select id="selectElecInvoiceCount" parameterType="java.util.Map"
            resultMap="BaseResultCountMap" databaseId="mysql">
        SELECT sum(t.invoice_amount) sumInvoiceAmount,
        sum(t.tax_amount) sumTaxAmount
        FROM t_dx_invoice t
        WHERE t.user_name = #{userName} and t.valid = '1' and qs_type = '5' and invoice_type in
        ('10','14')

        <if test="gfsh != null and gfsh != '' and gfsh != 'null' and gfsh != '99' ">
            and t.gf_tax_no = #{gfsh}
        </if>
        <if
                test="businessCode != '99' and businessCode != null and businessCode != '' and businessCode != 'null'">
            and t.dept_id = #{businessCode}
        </if>
        <if test="businessCode == ''">
            and (t.dept_id is null or t.dept_id='' or t.dept_id='99')
        </if>
        <if test="invoiceNo != null and invoiceNo != '' and invoiceNo != 'null' ">
            and t.invoice_no = #{invoiceNo}
        </if>
        <if test="company != null and company != '' and company != 'null' ">
            and t.company = #{company}
        </if>
        AND t.qs_date BETWEEN #{qsrqq} AND #{qsrqz}

    </select>

    <select id="selectElecInvoiceCount" parameterType="java.util.Map"
            resultMap="BaseResultCountMap" databaseId="oracle">
        SELECT sum(t.invoice_amount) sumInvoiceAmount,
        sum(t.tax_amount) sumTaxAmount
        FROM t_dx_invoice t
        WHERE t.user_name = #{userName} and t.valid = '1' and qs_type = '5' and invoice_type in
        ('10','14')

        <if test="gfsh != null and gfsh != '' and gfsh != 'null' and gfsh != '99' ">
            and t.gf_tax_no = #{gfsh}
        </if>
        <if
                test="businessCode != '99' and businessCode != null and businessCode != '' and businessCode != 'null'">
            and t.dept_id = #{businessCode}
        </if>
        <if test="businessCode == ''">
            and (t.dept_id is null or t.dept_id='' or t.dept_id='99')
        </if>
        <if test="invoiceNo != null and invoiceNo != '' and invoiceNo != 'null' ">
            and t.invoice_no = #{invoiceNo}
        </if>
        AND TO_CHAR(t.QS_DATE, 'yyyy-mm-dd hh24:mi:ss') BETWEEN #{qsrqq} AND #{qsrqz}

    </select>


    <select id="selectElecInvoice" parameterType="java.util.Map"
            resultMap="BaseResultMap" databaseId="oracle">
        SELECT
        t.id,t.notes,t.qs_type,t.qs_status,t.qs_date,t.user_name,t.invoice_code,t.invoice_no,t.uuid,t.invoice_date,t.invoice_type,t.invoice_amount,t.tax_amount,t.dept_id,t.dept_name
        ,t.scan_id,t.gf_name,t.xf_name,t.gf_tax_no,t.xf_tax_no,t.check_code
        FROM t_dx_invoice t
        WHERE t.user_name = #{userName} and t.valid = '1' and qs_type = '5' and invoice_type in
        ('08','10','14')

        <if test="gfsh != null and gfsh != '' and gfsh != 'null' and gfsh != '99' ">
            and t.gf_tax_no = #{gfsh}
        </if>
        <if
                test="businessCode != '99' and businessCode != null and businessCode != '' and businessCode != 'null'">
            and t.dept_id = #{businessCode}
        </if>
        <if test="businessCode == ''">
            and (t.dept_id is null or t.dept_id='' or t.dept_id='99')
        </if>
        <if test="invoiceNo != null and invoiceNo != '' and invoiceNo != 'null' ">
            and t.invoice_no = #{invoiceNo}
        </if>
        AND TO_CHAR(t.QS_DATE, 'yyyy-mm-dd hh24:mi:ss') BETWEEN #{qsrqq} AND #{qsrqz}
        <if test="company!=null and company!=''">
            and t.company = #{company}
        </if>
        ORDER BY t.invoice_serial_no desc
    </select>
    <select id="selectElecInvoice" parameterType="java.util.Map"
            resultMap="BaseResultMap" databaseId="mysql">
        SELECT
        t.id,t.notes,t.qs_type,t.qs_status,t.qs_date,t.user_name,t.invoice_code,t.invoice_no,t.uuid,t.invoice_date,t.invoice_type,t.invoice_amount,t.tax_amount
        ,t.dept_id,t.dept_name,t.scan_id,t.gf_name,t.xf_name,t.gf_tax_no,t.xf_tax_no,t.check_code
        FROM t_dx_invoice t
        WHERE t.user_name = #{userName} and t.valid = '1' and qs_type = '5' and invoice_type in
        ('08','10','14')

        <if test="gfsh != null and gfsh != '' and gfsh != 'null' and gfsh != '99' ">
            and t.gf_tax_no = #{gfsh}
        </if>
        <if
                test="businessCode != '99' and businessCode != null and businessCode != '' and businessCode != 'null'">
            and t.dept_id = #{businessCode}
        </if>
        <if test="businessCode == ''">
            and (t.dept_id is null or t.dept_id='' or t.dept_id='99')
        </if>
        <if test="invoiceNo != null and invoiceNo != '' and invoiceNo != 'null' ">
            and t.invoice_no = #{invoiceNo}
        </if>
        <if test="notes != null and notes != '' and notes != 'null' ">
            and t.notes like concat(#{notes},'%')
        </if>
        <if test="xfsh != null and xfsh != '' and xfsh != 'null' ">
            and t.xf_tax_no like concat(#{xfsh},'%'}
        </if>
        <if test="createDateBegin != null and createDateBegin != '' and createDateBegin != 'null' ">
            <![CDATA[ AND t.create_date >= #{createDateBegin} ]]>
        </if>
        <if test="createDateEnd != null and createDateEnd != '' and createDateEnd != 'null' ">
            <![CDATA[ AND t.create_date <= #{createDateEnd} ]]>
        </if>
        AND t.qs_date BETWEEN #{qsrqq} AND #{qsrqz}
        <if test="company!=null and company!=''">
            and t.company = #{company}
        </if>
        ORDER BY t.invoice_serial_no desc
    </select>

    <!-- 获取有无权限推送艺龙结算平台 -->
    <select id="queryByUuid" resultType="com.dxhy.api.model.sign.TDxInvoice" databaseId="mysql">
        SELECT *
        FROM t_dx_invoice d
                 LEFT JOIN sys_user u on d.user_account = u.user_id
        where u.push_yesorno = 1
          AND d.qs_status = 1
          and d.uuid = #{uuid}
    </select>

    <!-- 获取有无权限推送艺龙结算平台 -->
    <select id="queryByUuid" resultType="com.dxhy.api.model.sign.TDxInvoice" databaseId="oracle">
        SELECT *
        FROM t_dx_invoice d
                 LEFT JOIN sys_user u on d.user_account = u.user_id
        where u.push_yesorno = 1
          AND d.qs_status = 1
          and d.uuid = #{uuid}
    </select>

    <select id="selectQsfpListMryx" parameterType="java.util.Map"
            resultMap="BaseResultMap" databaseId="mysql">
        SELECT
        t.id,t.notes,t.qs_type,t.qs_status,t.qs_date,t.user_name,t.invoice_code,t.invoice_no,t.ele_invoice_no eleInvoiceNo,t.uuid,t.invoice_date,t.invoice_type,t.invoice_amount,t.tax_amount
        ,t.dept_id,t.dept_name,t.scan_id,t.gf_name,t.xf_name,t.gf_tax_no,t.xf_tax_no,t.check_code,t.remark,t.create_date,t.total_amount
        FROM t_dx_invoice t
        WHERE t.valid = '1'
        and t.gf_tax_no in
        <foreach collection="gfsh" index="index" item="item" open="(" separator="," close=")">
            #{item}
        </foreach>
        <if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType == '14' ">
            and (t.invoice_type = '14' or (t.invoice_type = '32' and t.lq_tdyslxDm='08') )
        </if>
        <if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType == '32' ">
            and t.invoice_type = #{invoiceType} and t.lq_tdyslxDm!='08'
        </if>
        <if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType != '14' and invoiceType != '32' and invoiceType != '99'">
            and t.invoice_type = #{invoiceType}
        </if>
        <if test="invoiceSource != null and invoiceSource != '' and invoiceSource != 'null' and invoiceSource != '99' ">
            and t.invoice_source = #{invoiceSource}
        </if>
        <if test="invoiceCode != null and invoiceCode != '' and invoiceCode != 'null' ">
            and t.invoice_code = #{invoiceCode}
        </if>
        <if test="invoiceNo != null and invoiceNo != '' and invoiceNo != 'null' ">
            and t.invoice_no = #{invoiceNo}
        </if>
        <if test="eleInvoiceNo!=null and eleInvoiceNo!='' and eleInvoiceNo!='null'">
            and t.ele_invoice_no = #{eleInvoiceNo}
        </if>
        <if test="userName!= null and userName!= '' and userName!='null'">
            and t.user_name like concat('%',concat(#{userName},'%'))
        </if>
        <if test="qsStatus != null and qsStatus != '' and qsStatus != 'null' ">
            and t.qs_status = #{qsStatus}
        </if>

        <if test="createDateBegin != null and createDateBegin != '' and createDateBegin != 'null' ">
            <![CDATA[ AND t.create_date >= #{createDateBegin} ]]>
        </if>
        <if test="createDateEnd != null and createDateEnd != '' and createDateEnd != 'null' ">
            <![CDATA[ AND t.create_date <= #{createDateEnd} ]]>
        </if>
        <if test="invoiceDateBegin != null and invoiceDateBegin != '' and invoiceDateBegin != 'null' ">
            <![CDATA[ AND t.invoice_date >= #{invoiceDateBegin} ]]>
        </if>
        <if test="invoiceDateEnd != null and invoiceDateEnd != '' and invoiceDateEnd != 'null' ">
            <![CDATA[ AND t.invoice_date <= #{invoiceDateEnd} ]]>
        </if>
        <if test="qsrqq != null and qsrqq != '' and qsrqq != 'null' ">
            <![CDATA[ AND t.qs_date >= #{qsrqq} ]]>
        </if>
        <if test="qsrqz != null and qsrqz != '' and qsrqz != 'null' ">
            <![CDATA[ AND t.qs_date <= #{qsrqz} ]]>
        </if>
        <if test="company !=null and company!=''">
            and t.company = #{company}
        </if>
        <if test="businessCode != '99' and businessCode != null and businessCode != '' and businessCode != 'null' ">
            and t.dept_id = #{businessCode}
        </if>
        <if test="businessCode==''">
            and (t.dept_id is null or t.dept_id='' or t.dept_id='99')
        </if>
        ORDER BY t.invoice_serial_no desc
    </select>

    <select id="selectQsfpListMryx" parameterType="java.util.Map"
            resultMap="BaseResultMap" databaseId="oracle">
        SELECT
        t.id,t.notes,t.qs_type,t.qs_status,t.qs_date,t.user_name,t.invoice_code,t.invoice_no,t.ele_invoice_no eleInvoiceNo,t.uuid,t.invoice_date,t.invoice_type,t.invoice_amount,t.tax_amount
        ,t.dept_id,t.dept_name,t.scan_id,t.gf_name,t.xf_name,t.gf_tax_no,t.xf_tax_no,t.check_code,t.remark,t.create_date,t.total_amount
        FROM t_dx_invoice t
        WHERE t.valid = '1'
        and t.gf_tax_no in
        <foreach collection="gfsh" index="index" item="item" open="(" separator="," close=")">
            #{item}
        </foreach>
        <if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType == '14' ">
            and (t.invoice_type = '14' or (t.invoice_type = '32' and t.lq_tdyslxDm='08') )
        </if>
        <if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType == '32' ">
            and t.invoice_type = #{invoiceType} and t.lq_tdyslxDm!='08'
        </if>
        <if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType != '14' and invoiceType != '32' and invoiceType != '99'">
            and t.invoice_type = #{invoiceType}
        </if>
        <if test="invoiceSource != null and invoiceSource != '' and invoiceSource != 'null' and invoiceSource != '99' ">
            and t.invoice_source = #{invoiceSource}
        </if>
        <if test="invoiceCode != null and invoiceCode != '' and invoiceCode != 'null' ">
            and t.invoice_code = #{invoiceCode}
        </if>
        <if test="invoiceNo != null and invoiceNo != '' and invoiceNo != 'null' ">
            and t.invoice_no = #{invoiceNo}
        </if>
        <if test="eleInvoiceNo!=null and eleInvoiceNo!='' and eleInvoiceNo!='null'">
            and t.ele_invoice_no = #{eleInvoiceNo}
        </if>
        <if test="userName!= null and userName!= '' and userName!='null'">
            and t.user_name like concat('%',concat(#{userName},'%'))
        </if>
        <if test="qsStatus != null and qsStatus != '' and qsStatus != 'null' ">
            and t.qs_status = #{qsStatus}
        </if>

        <if test="createDateBegin != null and createDateBegin != '' and createDateBegin != 'null' ">
            <![CDATA[ AND t.create_date >= #{createDateBegin} ]]>
        </if>
        <if test="createDateEnd != null and createDateEnd != '' and createDateEnd != 'null' ">
            <![CDATA[ AND t.create_date <= #{createDateEnd} ]]>
        </if>
        <if test="invoiceDateBegin != null and invoiceDateBegin != '' and invoiceDateBegin != 'null' ">
            <![CDATA[ AND t.invoice_date >= #{invoiceDateBegin} ]]>
        </if>
        <if test="invoiceDateEnd != null and invoiceDateEnd != '' and invoiceDateEnd != 'null' ">
            <![CDATA[ AND t.invoice_date <= #{invoiceDateEnd} ]]>
        </if>
        <if test="qsrqq != null and qsrqq != '' and qsrqq != 'null' ">
            <![CDATA[ AND t.qs_date >= to_date(#{qsrqq},'yyyy-mm-dd hh24:mi:ss') ]]>
        </if>
        <if test="qsrqz != null and qsrqz != '' and qsrqz != 'null' ">
            <![CDATA[ AND t.qs_date <= to_date(#{qsrqz},'yyyy-mm-dd hh24:mi:ss') ]]>
        </if>
        <if test="company !=null and company!=''">
            and t.company = #{company}
        </if>
        <if test="businessCode != '99' and businessCode != null and businessCode != '' and businessCode != 'null' ">
            and t.dept_id = #{businessCode}
        </if>
        <if test="businessCode==''">
            and (t.dept_id is null or t.dept_id='' or t.dept_id='99')
        </if>
        ORDER BY t.invoice_serial_no desc
    </select>

    <select id="selectQsfpListCountMryx" parameterType="java.util.Map"
            resultMap="BaseResultCountMap" databaseId="mysql">
        SELECT sum(t.invoice_amount) sumInvoiceAmount,
        sum(t.tax_amount) sumTaxAmount
        FROM t_dx_invoice t
        WHERE t.valid = '1'
        and t.gf_tax_no in
        <foreach collection="gfsh" index="index" item="item" open="(" separator="," close=")">
            #{item}
        </foreach>
        <if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType == '14' ">
            and (t.invoice_type = '14' or (t.invoice_type = '32' and t.lq_tdyslxDm='08') )
        </if>
        <if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType == '32' ">
            and t.invoice_type = #{invoiceType} and t.lq_tdyslxDm!='08'
        </if>
        <if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType != '14' and invoiceType != '32' and invoiceType != '99'">
            and t.invoice_type = #{invoiceType}
        </if>
        <if test="invoiceSource != null and invoiceSource != '' and invoiceSource != 'null' and invoiceSource != '99' ">
            and t.invoice_source = #{invoiceSource}
        </if>
        <if test="invoiceCode != null and invoiceCode != '' and invoiceCode != 'null' ">
            and t.invoice_code = #{invoiceCode}
        </if>
        <if test="invoiceNo != null and invoiceNo != '' and invoiceNo != 'null' ">
            and t.invoice_no = #{invoiceNo}
        </if>
        <if test="eleInvoiceNo!=null and eleInvoiceNo!='' and eleInvoiceNo!='null'">
            and t.ele_invoice_no = #{eleInvoiceNo}
        </if>

        <if test="qsStatus != null and qsStatus != '' and qsStatus != 'null' ">
            and t.qs_status = #{qsStatus}
        </if>

        <if test="userName!= null and userName!= '' and userName!='null'">
            and t.user_name like concat('%',concat(#{userName},'%'))
        </if>

        <if test="createDateBegin != null and createDateBegin != '' and createDateBegin != 'null' ">
            <![CDATA[ AND t.create_date >= #{createDateBegin} ]]>
        </if>
        <if test="createDateEnd != null and createDateEnd != '' and createDateEnd != 'null' ">
            <![CDATA[ AND t.create_date <= #{createDateEnd} ]]>
        </if>
        <if test="invoiceDateBegin != null and invoiceDateBegin != '' and invoiceDateBegin != 'null' ">
            <![CDATA[ AND t.invoice_date >= #{invoiceDateBegin} ]]>
        </if>
        <if test="invoiceDateEnd != null and invoiceDateEnd != '' and invoiceDateEnd != 'null' ">
            <![CDATA[ AND t.invoice_date <= #{invoiceDateEnd} ]]>
        </if>
        <if test="qsrqq != null and qsrqq != '' and qsrqq != 'null' ">
            <![CDATA[ AND t.qs_date >= #{qsrqq} ]]>
        </if>
        <if test="qsrqz != null and qsrqz != '' and qsrqz != 'null' ">
            <![CDATA[ AND t.qs_date <= #{qsrqz} ]]>
        </if>
        <if test="company !=null and company!=''">
            and t.company = #{company}
        </if>
        <if test="businessCode != '99' and businessCode != null and businessCode != '' and businessCode != 'null' ">
            and t.dept_id = #{businessCode}
        </if>
        <if test="businessCode==''">
            and (t.dept_id is null or t.dept_id='' or t.dept_id='99')
        </if>
    </select>

    <select id="selectQsfpListCountMryx" parameterType="java.util.Map"
            resultMap="BaseResultCountMap" databaseId="oracle">
        SELECT sum(t.invoice_amount) sumInvoiceAmount,
        sum(t.tax_amount) sumTaxAmount
        FROM t_dx_invoice t
        WHERE t.valid = '1'
        and t.gf_tax_no in
        <foreach collection="gfsh" index="index" item="item" open="(" separator="," close=")">
            #{item}
        </foreach>
        <if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType == '14' ">
            and (t.invoice_type = '14' or (t.invoice_type = '32' and t.lq_tdyslxDm='08') )
        </if>
        <if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType == '32' ">
            and t.invoice_type = #{invoiceType} and t.lq_tdyslxDm!='08'
        </if>
        <if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType != '14' and invoiceType != '32' and invoiceType != '99'">
            and t.invoice_type = #{invoiceType}
        </if>
        <if test="invoiceSource != null and invoiceSource != '' and invoiceSource != 'null' and invoiceSource != '99' ">
            and t.invoice_source = #{invoiceSource}
        </if>
        <if test="invoiceCode != null and invoiceCode != '' and invoiceCode != 'null' ">
            and t.invoice_code = #{invoiceCode}
        </if>
        <if test="invoiceNo != null and invoiceNo != '' and invoiceNo != 'null' ">
            and t.invoice_no = #{invoiceNo}
        </if>
        <if test="eleInvoiceNo!=null and eleInvoiceNo!='' and eleInvoiceNo!='null'">
            and t.ele_invoice_no = #{eleInvoiceNo}
        </if>

        <if test="qsStatus != null and qsStatus != '' and qsStatus != 'null' ">
            and t.qs_status = #{qsStatus}
        </if>

        <if test="userName!= null and userName!= '' and userName!='null'">
            and t.user_name like concat('%',concat(#{userName},'%'))
        </if>

        <if test="createDateBegin != null and createDateBegin != '' and createDateBegin != 'null' ">
            <![CDATA[ AND t.create_date >= #{createDateBegin} ]]>
        </if>
        <if test="createDateEnd != null and createDateEnd != '' and createDateEnd != 'null' ">
            <![CDATA[ AND t.create_date <= #{createDateEnd} ]]>
        </if>
        <if test="invoiceDateBegin != null and invoiceDateBegin != '' and invoiceDateBegin != 'null' ">
            <![CDATA[ AND t.invoice_date >= #{invoiceDateBegin} ]]>
        </if>
        <if test="invoiceDateEnd != null and invoiceDateEnd != '' and invoiceDateEnd != 'null' ">
            <![CDATA[ AND t.invoice_date <= #{invoiceDateEnd} ]]>
        </if>
        <if test="qsrqq != null and qsrqq != '' and qsrqq != 'null' ">
            <![CDATA[ AND t.qs_date >= to_date(#{qsrqq},'yyyy-mm-dd hh24:mi:ss') ]]>
        </if>
        <if test="qsrqz != null and qsrqz != '' and qsrqz != 'null' ">
            <![CDATA[ AND t.qs_date <= to_date(#{qsrqz},'yyyy-mm-dd hh24:mi:ss') ]]>
        </if>
        <if test="company !=null and company!=''">
            and t.company = #{company}
        </if>
        <if test="businessCode != '99' and businessCode != null and businessCode != '' and businessCode != 'null' ">
            and t.dept_id = #{businessCode}
        </if>
        <if test="businessCode==''">
            and (t.dept_id is null or t.dept_id='' or t.dept_id='99')
        </if>
    </select>


    <select id="selectQsfpListJrtt" parameterType="java.util.Map"
            resultMap="BaseResultMap">
        SELECT
        t.id,t.notes,t.qs_type,t.qs_status,t.qs_date,t.user_name,t.invoice_code,t.invoice_no,t.ele_invoice_no eleInvoiceNo,t.uuid,t.invoice_date,t.invoice_type,t.invoice_amount,t.tax_amount
        ,t.dept_id,t.dept_name,t.scan_id,t.gf_name,t.xf_name,t.gf_tax_no,t.xf_tax_no,t.check_code,t.remark,t.create_date,t.total_amount,t.settle_source,
        t.settlement_no,
        t.settlement_status,
        r.auth_status,r.voucher_number,img.image_path
        FROM t_dx_invoice t
        left join t_dx_record_invoice r on t.uuid=r.uuid left join t_dx_invoice_img img on t.scan_id = img.scan_id
        WHERE t.valid = '1'
        <if test="qsNameFlag==null">
            and t.user_account = #{userId}
        </if>
        <if test="gfsh != '99' and gfsh != null and gfsh != '' and gfsh != 'null'">
            and t.gf_tax_no = #{gfsh}
        </if>
        <if test="voucherNumber != null and voucherNumber != ''">
            and r.voucher_number like concat('%',concat(#{voucherNumber},'%'))
        </if>
        <!--
        <if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' ">
            and t.invoice_type = #{invoiceType}
        </if>
        -->
        <if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType == '14' ">
            and (t.invoice_type = '14' or (t.invoice_type = '32' and r.lq_tdyslxDm='08') )
        </if>
        <if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType == '32' ">
            and t.invoice_type = #{invoiceType} and r.lq_tdyslxDm!='08'
        </if>
        <if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType != '14' and invoiceType != '32' and invoiceType != '99'">
            and t.invoice_type = #{invoiceType}
        </if>

        <if test="invoiceCode != null and invoiceCode != '' and invoiceCode != 'null' ">
            and t.invoice_code = #{invoiceCode}
        </if>
        <if test="invoiceNo != null and invoiceNo != '' and invoiceNo != 'null' ">
            and t.invoice_no = #{invoiceNo}
        </if>
        <if
                test="businessCode != '99' and businessCode != null and businessCode != '' and businessCode != 'null'">
            and t.dept_id = #{businessCode}
        </if>
        <if test="businessCode == ''">
            and (t.dept_id is null or t.dept_id='' or t.dept_id='99')
        </if>
        <if test="qsStatus != null and qsStatus != '' and qsStatus != 'null' ">
            and t.qs_status = #{qsStatus}
        </if>
        <if test="qsType != null and qsType != '' and qsType != 'null' ">
            and t.qs_type = #{qsType}
        </if>
        <if test="notes != null and notes != '' and notes != 'null' ">
            and t.notes like concat(#{notes},'%')
        </if>
        <if test="xfsh != null and xfsh != '' and xfsh != 'null' ">
            and t.xf_tax_no like concat(#{xfsh},'%')
        </if>
        <if test='gxStatus=="1"'>
            and r.auth_status in (1,2,3,4)
        </if>
        <if test='gxStatus=="0"'>
            and r.auth_status in (0,5,6)
        </if>
        <if test="settlementNo != null and settlementNo != ''">
            and t.settlement_no like concat(#{settlementNo},'%')
        </if>
        <if test="settlementStatus!=null and settlementStatus!='' and settlementStatus!='99'">
            and t.settlement_status= #{settlementStatus}
        </if>
        <if test="createDateBegin != null and createDateBegin != '' and createDateBegin != 'null' ">
            <![CDATA[ AND t.create_date >= #{createDateBegin} ]]>
        </if>
        <if test="createDateEnd != null and createDateEnd != '' and createDateEnd != 'null' ">
            <![CDATA[ AND t.create_date <= #{createDateEnd} ]]>
        </if>
        AND t.qs_date BETWEEN #{qsrqq} AND #{qsrqz}
        <if test="company!=null and company!=''">
            and t.company = #{company}
        </if>
        <if test="xfmc!=null and xfmc!=''">
            and t.xf_name like concat(#{xfmc},'%')
        </if>
        <if test="invoiceSource!=null and invoiceSource!='' and invoiceSource!='99'">
            and t.invoice_source  = #{invoiceSource}
        </if>
        ORDER BY t.invoice_serial_no desc
    </select>

    <select id="selectQsfpListCountJrtt" parameterType="java.util.Map"
            resultMap="BaseResultCountMap">
        SELECT sum(t.invoice_amount) sumInvoiceAmount,
        sum(t.tax_amount) sumTaxAmount
        FROM t_dx_invoice t
        left join t_dx_record_invoice r on t.uuid=r.uuid
        WHERE t.valid = '1'
        <if test="qsNameFlag==null">
            and t.user_account = #{userId}
        </if>
        <if test="gfsh != null and gfsh != '' and gfsh != 'null' and gfsh != '99' ">
            and t.gf_tax_no = #{gfsh}
        </if>
        <!--
        <if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' ">
            and t.invoice_type = #{invoiceType}
        </if>
        -->
        <if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType == '14' ">
            and (t.invoice_type = '14' or (t.invoice_type = '32' and r.lq_tdyslxDm='08') )
        </if>
        <if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType == '32' ">
            and t.invoice_type = #{invoiceType} and r.lq_tdyslxDm!='08'
        </if>
        <if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType != '14' and invoiceType != '32' and invoiceType != '99'">
            and t.invoice_type = #{invoiceType}
        </if>
        <if test="invoiceCode != null and invoiceCode != '' and invoiceCode != 'null' ">
            and t.invoice_code = #{invoiceCode}
        </if>
        <if test="invoiceNo != null and invoiceNo != '' and invoiceNo != 'null' ">
            and t.invoice_no = #{invoiceNo}
        </if>
        <if
                test="businessCode != '99' and businessCode != null and businessCode != '' and businessCode != 'null'">
            and t.dept_id = #{businessCode}
        </if>
        <if test="voucherNumber != null and voucherNumber != ''">
            and r.voucher_number like concat('%',concat(#{voucherNumber},'%'))
        </if>
        <if test="businessCode == ''">
            and (t.dept_id is null or t.dept_id='' or t.dept_id='99')
        </if>
        <if test="qsStatus != null and qsStatus != '' and qsStatus != 'null' ">
            and t.qs_status = #{qsStatus}
        </if>
        <if test="qsType != null and qsType != '' and qsType != 'null' ">
            and t.qs_type = #{qsType}
        </if>
        <if test="notes != null and notes != '' and notes != 'null' ">
            and t.notes like concat(#{notes},'%')
        </if>
        <if test="xfsh != null and xfsh != '' and xfsh != 'null' ">
            and t.xf_tax_no like concat(#{xfsh},'%')
        </if>
        <if test='gxStatus=="1"'>
            and r.auth_status in (1,2,3,4)
        </if>
        <if test='gxStatus=="0"'>
            and r.auth_status in (0,5,6)
        </if>
        <if test="settlementNo != null and settlementNo != ''">
            and t.settlement_no like concat(#{settlementNo},'%')
        </if>
        <if test="settlementStatus!=null and settlementStatus!='' and settlementStatus!='99'">
            and t.settlement_status= #{settlementStatus}
        </if>
        <if test="createDateBegin != null and createDateBegin != '' and createDateBegin != 'null' ">
            <![CDATA[ AND t.create_date >= #{createDateBegin} ]]>
        </if>
        <if test="createDateEnd != null and createDateEnd != '' and createDateEnd != 'null' ">
            <![CDATA[ AND t.create_date <= #{createDateEnd} ]]>
        </if>
        AND t.qs_date BETWEEN #{qsrqq} AND #{qsrqz}
        <if test="company!=null and company!=''">
            and t.company = #{company}
        </if>
        <if test="xfmc!=null and xfmc!=''">
            and t.xf_name like concat(#{xfmc},'%')
        </if>
        <if test="invoiceSource!=null and invoiceSource!='' and invoiceSource!='99'">
            and t.invoice_source  = #{invoiceSource}
        </if>
    </select>

    <update id="cancelRecodSettle" databaseId="mysql">
        UPDATE t_dx_record_invoice
        SET settlement_status='0',
        settlement_no=null,
        settle_source=null,
        last_update_date = now()
        WHERE uuid in
        <foreach collection="uuids" index="index" item="uuid" open="(" separator="," close=")">
            #{uuid}
        </foreach>
    </update>
    <update id="cancelRecodSettle" databaseId="oracle">
        UPDATE t_dx_record_invoice
        SET settlement_status='0',
        settlement_no=null,
        settle_source=null,
        last_update_date = sysdate
        WHERE uuid in
        <foreach collection="uuids" index="index" item="uuid" open="(" separator="," close=")">
            #{uuid}
        </foreach>
    </update>
    <update id="cancelSettle" databaseId="mysql">
        UPDATE t_dx_invoice
        SET settlement_status='0',
        settlement_no=null,
        settle_source=null,
        update_date = now()
        WHERE uuid in
        <foreach collection="uuids" index="index" item="uuid" open="(" separator="," close=")">
            #{uuid}
        </foreach>
    </update>
    <update id="cancelSettle" databaseId="oracle">
        UPDATE t_dx_invoice
        SET settlement_status='0',
        settlement_no=null,
        settle_source=null,
        update_date = sysdate
        WHERE uuid in
        <foreach collection="uuids" index="index" item="uuid" open="(" separator="," close=")">
            #{uuid}
        </foreach>
    </update>
    <update id="saveRecodSettlementNo" databaseId="mysql">
        UPDATE t_dx_record_invoice
        SET
        settlement_no=#{settlementNo},
        settle_source=#{settleSource},
        last_update_date = now()
        WHERE uuid in
        <foreach collection="uuids" index="index" item="uuid" open="(" separator="," close=")">
            #{uuid}
        </foreach>
    </update>
    <update id="saveRecodSettlementNo" databaseId="oracle">
        UPDATE t_dx_record_invoice
        SET
        settlement_no=#{settlementNo},
        settle_source=#{settleSource},
        last_update_date = sysdate
        WHERE uuid in
        <foreach collection="uuids" index="index" item="uuid" open="(" separator="," close=")">
            #{uuid}
        </foreach>
    </update>
    <update id="saveSettlementNo" databaseId="mysql">
        UPDATE t_dx_invoice
        SET
        settlement_no=#{settlementNo},
        settle_source=#{settleSource},
        update_date = now()
        WHERE uuid in
        <foreach collection="uuids" index="index" item="uuid" open="(" separator="," close=")">
            #{uuid}
        </foreach>
    </update>
    <update id="saveSettlementNo" databaseId="oracle">
        UPDATE t_dx_invoice
        SET
        settlement_no=#{settlementNo},
        settle_source=#{settleSource},
        update_date = sysdate
        WHERE uuid in
        <foreach collection="uuids" index="index" item="uuid" open="(" separator="," close=")">
            #{uuid}
        </foreach>
    </update>
    <update id="updateRecodUser" databaseId="mysql">
        UPDATE t_dx_record_invoice
        SET
        qs_name=#{userName},
        last_update_date = now()
        WHERE uuid in
        <foreach collection="uuids" index="index" item="uuid" open="(" separator="," close=")">
            #{uuid}
        </foreach>
    </update>
    <update id="updateRecodUser" databaseId="oracle">
        UPDATE t_dx_record_invoice
        SET
        qs_name=#{userName},
        last_update_date = sysdate
        WHERE uuid in
        <foreach collection="uuids" index="index" item="uuid" open="(" separator="," close=")">
            #{uuid}
        </foreach>
    </update>
    <update id="updateUser" databaseId="mysql">
        UPDATE t_dx_invoice
        SET
        user_account=#{userId},
        user_name=#{userName},
        update_date = now(),
        qs_name=#{userName}
        WHERE uuid in
        <foreach collection="uuids" index="index" item="uuid" open="(" separator="," close=")">
            #{uuid}
        </foreach>
    </update>
    <update id="updateUser" databaseId="oracle">
        UPDATE t_dx_invoice
        SET
        user_account=#{userId},
        user_name=#{userName},
        update_date = sysdate,
        qs_name=#{userName}
        WHERE uuid in
        <foreach collection="uuids" index="index" item="uuid" open="(" separator="," close=")">
            #{uuid}
        </foreach>
    </update>
    <update id="qxqs" databaseId="mysql">
        UPDATE t_dx_invoice
        SET qs_status='0',
            settle_source=null,
            settlement_no=null,
            settlement_status='0',
            notes=#{notes},
            update_date = now()
        WHERE uuid = #{uuid}
    </update>
    <update id="qxqs" databaseId="oracle">
        UPDATE t_dx_invoice
        SET qs_status='0',
            settle_source=null,
            settlement_no=null,
            settlement_status='0',
            notes=#{notes},
            update_date = sysdate
        WHERE uuid = #{uuid}
    </update>
</mapper>
