demand: 红冲发票相关需求

This commit is contained in:
aike 2026-02-05 11:07:10 +08:00
parent 98d5a8f965
commit 88bca9debc

View File

@ -531,6 +531,17 @@
on rel.settle_bill_no = b.settle_bill_no and b.del_flag = '0'
left join emis_settle_invoice_rel r
on a.apply_seq_no = r.apply_seq_no and r.del_flag = '0'
left join (
select ch1.*
from emis_settle_invoice_ch_record ch1
inner join (
select apply_seq_no, max(id) as max_id
from emis_settle_invoice_ch_record
where del_flag = '0'
group by apply_seq_no
) ch2 on ch1.apply_seq_no = ch2.apply_seq_no and ch1.id = ch2.max_id
where ch1.del_flag = '0'
) ch on a.apply_seq_no = ch.apply_seq_no
where a.del_flag = '0'
<if test="applySeqNo != null and applySeqNo != ''">
and find_in_set(a.apply_seq_no, #{applySeqNo})