select t1.id, t1.write_off_code, t1.write_off_type, t1.receipt_bill_code, t1.partner_code,
t1.write_off_amount, t1.write_off_amount_without_tax, t1.write_off_tax_amount, t1.write_off_time,
t1.remark, t1.create_by, t1.create_time, t1.update_by, t1.update_time,
t1.partner_name,t3.user_name as create_by_name
from oms_receivable_write_off t1
left join sys_user t3 on t1.create_by=t3.user_id
insert into oms_receivable_write_off
write_off_code,write_off_type,receipt_bill_code,partner_code,partner_name,write_off_amount,write_off_amount_without_tax,write_off_tax_amount,write_off_time,remark,create_by,create_time,update_by,update_time,#{writeOffCode},#{writeOffType},#{receiptBillCode},#{partnerCode},#{partnerName},#{writeOffAmount},#{writeOffAmountWithoutTax},#{writeOffTaxAmount},#{writeOffTime},#{remark},#{createBy},#{createTime},#{updateBy},#{updateTime},
update oms_receivable_write_off
write_off_code = #{writeOffCode},write_off_type = #{writeOffType},receipt_bill_code = #{receiptBillCode},partner_code = #{partnerCode},write_off_amount = #{writeOffAmount},write_off_amount_without_tax = #{writeOffAmountWithoutTax},write_off_tax_amount = #{writeOffTaxAmount},write_off_time = #{writeOffTime},remark = #{remark},update_by = #{updateBy},update_time = #{updateTime},
where id = #{id}
delete from oms_receivable_write_off where id = #{id}
delete from oms_receivable_write_off where id in
#{id}