<iftest="companyCode != null and companyCode != '99' and companyCode != '88' and companyCode != '' and companyCode != 'null'">
and t.comp_code = #{companyCode}
</if>
<iftest="companyCode != null and companyCode != '' and companyCode == '88'">
and (t.comp_code = '' or t.comp_code is null)
</if>
<iftest="inAccountStatus != null and inAccountStatus != '' and inAccountStatus != 'null' and inAccountStatus != '99' and inAccountStatus == '0'.toString()">
and t.inaccount_status = '1'
</if>
<iftest="qsflag != null and qsflag != '' and qsflag != 'null' and qsflag == '1'.toString()">
<iftest="companyCode != null and companyCode != '99' and companyCode != '88' and companyCode != '' and companyCode != 'null'">
and t.comp_code = #{companyCode}
</if>
@ -1366,92 +1455,17 @@
and (t.comp_code = '' or t.comp_code is null)
</if>
<iftest="inAccountStatus != null and inAccountStatus != '' and inAccountStatus != 'null' and inAccountStatus == '0'.toString()">
<iftest="inAccountStatus != null and inAccountStatus != '' and inAccountStatus != 'null' and inAccountStatus != '99' and inAccountStatus == '0'.toString()">
and t.inaccount_status = '1'
</if>
<iftest="qsksrq != null and qsksrq != '' and qsksrq != 'null' and qsjsrq != null and qsjsrq != '' and qsjsrq != 'null'">
and date_format(t.qs_date,'%Y-%m-%d') between #{qsksrq} and #{qsjsrq}
</if>
<iftest="voucherNumber != null and voucherNumber != ''">
and t.voucher_number like concat('%',concat(#{voucherNumber},'%'))
</if>
<iftest="paymentDateStart != null and paymentDateStart != '' and paymentDateStart != 'null' ">
<![CDATA[ AND date_format(t.payment_date,'%Y-%m-%d') >= #{paymentDateStart} ]]>
</if>
<iftest="paymentDateEnd != null and paymentDateEnd != '' and paymentDateEnd != 'null' ">
<![CDATA[ AND date_format(t.payment_date,'%Y-%m-%d') <= #{paymentDateEnd} ]]>
</if>
<iftest="paymentStatus != null and paymentStatus != '' and paymentStatus != '99'">
and t.payment_status = #{paymentStatus}
</if>
<iftest="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>
<iftest="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType != '14' ">
and t.invoice_type = #{invoiceType}
</if>
<iftest="invoiceSource!=null and invoiceSource!='' and invoiceSource!='null' and invoiceSource!='99'">
and t.invoice_source = #{invoiceSource}
</if>
<iftest="fpzt != null and fpzt != '' and fpzt != 'null'">
and t.invoice_status = #{fpzt}
</if>
<iftest="qsfs != null and qsfs != '' and qsfs != 'null' ">
and t.qs_type = #{qsfs}
</if>
<iftest="xfmc != null and xfmc != '' and xfmc != 'null' ">
and t.xf_name like concat(#{xfmc},'%')
</if>
<iftest="qsr != null and qsr != '' and qsr != 'null' ">
and t.qs_name = #{qsr}
</if>
<iftest="settlementNo != null and settlementNo != ''">
and t.settlement_no like concat(#{settlementNo},'%')
</if>
<iftest="invoiceNo != null and invoiceNo != '' and invoiceNo != 'null' ">
and t.invoice_no = #{invoiceNo}
</if>
<!-- 按签收人查询 -->
<iftest="position != null and position != '' and position != 'null' and position == '1'.toString()">
and t.qs_name = #{username}
</if>
<iftest="businessCode != '99' and businessCode != null and businessCode != '' and businessCode != 'null' ">
and t.dept_id = #{businessCode}
</if>
<iftest="businessCode==''">
and (t.dept_id is null or t.dept_id='' or t.dept_id='99')
</if>
<iftest='businessCode == "99" and business != null and business.size()>0'>
) or (t.dept_id is null or t.dept_id='' or t.dept_id='99'))
</if>
<iftest="eleInvoiceNo!=null and eleInvoiceNo!='' and eleInvoiceNo!='null'">
and t.ele_invoice_no = #{eleInvoiceNo}
</if>
<iftest="snVoucherNumber != null and snVoucherNumber != '' and snVoucherNumber != 'null' and snVoucherNumber != '99'">
and t.sn_voucher_number = #{snVoucherNumber}
</if>
<iftest="postingTimeStart != null and postingTimeStart != '' and postingTimeStart != 'null' and postingTimeStart != '99' and postingTimeEnd != null and postingTimeEnd != '' and postingTimeEnd != 'null' and postingTimeEnd != '99'">
and t.posting_time between #{postingTimeStart} and #{postingTimeEnd}
</if>
<iftest="imageNumber != null and imageNumber != '' and imageNumber != 'null' and imageNumber != '99'">
and t.image_id = #{imageNumber}
</if>
<iftest="accountPeriod != null and accountPeriod != '' and accountPeriod != 'null' and accountPeriod != '99'">
and t.account_period = #{accountPeriod}
</if>
<iftest="qsksrq != null and qsksrq != '' and qsksrq != 'null' and qsjsrq != null and qsjsrq != '' and qsjsrq != 'null'">
order by t.qs_date desc,t.invoice_date desc
</if>
<iftest="qsksrq==null or qsksrq=='' or qsjsrq==null or qsjsrq==''">
order by t.invoice_date desc
<iftest="qsflag != null and qsflag != '' and qsflag != 'null' and qsflag == '1'.toString()">