select t1.id, t1.invoice_bill_code, t1.invoice_type, t1.invoice_bill_type,
t1.invoice_time, t1.partner_code,t1.partner_name, t1.total_price_with_tax, t1.total_price_without_tax,t1.invoice_price_with_tax,t1.invoice_price_without_tax,
t1.tax_rate, t1.create_by, t1.create_time, t1.update_by, t1.update_time,
t1.remark, t1.del_flag, t1.actual_invoice_time, t1.invoice_status,
t1.approve_status, t1.approve_time, t1.refund_status
, t1.original_bill_id, t1.invoice_apply_user, t1.buyer_name, t1.buyer_credit_code, t1.buyer_bank, t1.buyer_bank_account,
t1.seller_name, t1.seller_credit_code, t1.seller_bank, t1.seller_bank_account
from oms_invoice_bill t1
insert into oms_invoice_bill
invoice_bill_code,
invoice_type,
invoice_bill_type,
invoice_time,
partner_code,
partner_name,
total_price_with_tax,
total_price_without_tax,
invoice_price_with_tax,
invoice_price_without_tax,
tax_rate,
create_by,
create_time,
update_by,
update_time,
remark,
del_flag,
actual_invoice_time,
invoice_status,
approve_status,
approve_node,
approve_time,
refund_status,
original_bill_id,
buyer_name,
buyer_credit_code,
buyer_bank,
buyer_bank_account,
seller_name,
seller_credit_code,
seller_bank,
seller_bank_account,
invoice_apply_user,
#{invoiceBillCode},
#{invoiceType},
#{invoiceBillType},
#{invoiceTime},
#{partnerCode},
#{partnerName},
#{totalPriceWithTax},
#{totalPriceWithoutTax},
#{invoicePriceWithTax},
#{invoicePriceWithoutTax},
#{taxRate},
#{createBy},
#{createTime},
#{updateBy},
#{updateTime},
#{remark},
#{delFlag},
#{actualInvoiceTime},
#{invoiceStatus},
#{approveStatus},
#{approveNode},
#{approveTime},
#{refundStatus},
#{originalBillId},
#{buyerName},
#{buyerCreditCode},
#{buyerBank},
#{buyerBankAccount},
#{sellerName},
#{sellerCreditCode},
#{sellerBank},
#{sellerBankAccount},
#{invoiceApplyUser},
update oms_invoice_bill
invoice_bill_code = #{invoiceBillCode},
invoice_type = #{invoiceType},
invoice_bill_type = #{invoiceBillType},
invoice_time = #{invoiceTime},
partner_code = #{partnerCode},
total_price_with_tax = #{totalPriceWithTax},
total_price_without_tax = #{totalPriceWithoutTax},
invoice_price_with_tax = #{invoicePriceWithTax},
invoice_price_without_tax = #{invoicePriceWithoutTax},
tax_rate = #{taxRate},
create_by = #{createBy},
create_time = #{createTime},
update_by = #{updateBy},
remark = #{remark},
del_flag = #{delFlag},
actual_invoice_time = #{actualInvoiceTime},
invoice_status = #{invoiceStatus},
approve_status = #{approveStatus},
approve_node = #{approveNode},
approve_time = #{approveTime},
refund_status = #{refundStatus},
original_bill_id = #{originalBillId},
buyer_name = #{buyerName},
buyer_credit_code = #{buyerCreditCode},
buyer_bank = #{buyerBank},
buyer_bank_account = #{buyerBankAccount},
seller_name = #{sellerName},
seller_credit_code = #{sellerCreditCode},
seller_bank = #{sellerBank},
seller_bank_account = #{sellerBankAccount},
invoice_apply_user = #{invoiceApplyUser},
update_time = now()
where id = #{id}
update oms_invoice_bill
invoice_status = #{invoiceStatus},
approve_status = #{approveStatus},
approve_node = #{approveNode},
approve_time = #{approveTime},
actual_invoice_time = #{actualInvoiceTime},
refund_status = #{refundStatus},
update_time = now()
where invoice_bill_code = #{invoiceBillCode}
update oms_invoice_bill
set buyer_name = #{buyerName},
buyer_credit_code = #{buyerCreditCode},
buyer_bank = #{buyerBank},
buyer_bank_account = #{buyerBankAccount},
seller_name = #{sellerName},
seller_credit_code = #{sellerCreditCode},
seller_bank = #{sellerBank},
seller_bank_account = #{sellerBankAccount},
approve_status=#{approveStatus},
invoice_type=#{invoiceType},
remark=#{remark},
update_time=now()
where invoice_bill_code = #{invoiceBillCode}
update oms_invoice_bill
set approve_status=#{approveStatus},
approve_time=null,
update_time=now()
where id = #{id}
update oms_invoice_bill
set
invoice_status=#{item.invoiceStatus},
approve_status=#{item.approveStatus},
approve_time=null,
actual_invoice_time=null,
update_time=now()
where id = #{item.id}
delete from oms_invoice_bill where id = #{id}
delete from oms_invoice_bill where id in
#{id}
delete from oms_receivable_invoice_detail where invoice_bill_code=#{code}