select t1.id, t1.order_code, t1.biz_charge_date, t1.finance_charge_date,
t1.income_with_tax_total, t1.income_without_tax_total,
t1.cost_software_without_tax, t1.cost_software_with_tax,
t1.cost_hardware_without_tax, t1.cost_hardware_with_tax,
t1.cost_software_maint_without_tax, t1.cost_software_maint_with_tax,
t1.cost_hardware_maint_without_tax, t1.cost_hardware_maint_with_tax,
t1.cost_province_service_with_tax, t1.cost_province_service_without_tax,
t1.cost_other_with_tax, t1.cost_other_without_tax,
t1.remark, t1.create_time, t1.update_time,t1.update_by, t1.charge_status
,t3.project_code,t3.project_name,t2.order_channel,t2.supplier,t2.partner_code,t4.partner_name
from oms_finance_charge t1
left join project_order_info t2 on t1.order_code=t2.order_code
left join project_info t3 on t2.project_id=t3.id
left join partner_info t4 on t2.partner_code=t4.partner_code
insert into oms_finance_charge
order_code,
biz_charge_date,
finance_charge_date,
income_with_tax_total,
income_without_tax_total,
cost_software_without_tax,
cost_software_with_tax,
cost_hardware_without_tax,
cost_hardware_with_tax,
cost_software_maint_without_tax,
cost_software_maint_with_tax,
cost_hardware_maint_without_tax,
cost_hardware_maint_with_tax,
cost_province_service_with_tax,
cost_province_service_without_tax,
cost_other_with_tax,
cost_other_without_tax,
remark,
charge_status,
create_time,
update_time
#{orderCode},
#{bizChargeDate},
#{financeChargeDate},
#{incomeWithTaxTotal},
#{incomeWithoutTaxTotal},
#{costSoftwareWithoutTax},
#{costSoftwareWithTax},
#{costHardwareWithoutTax},
#{costHardwareWithTax},
#{costSoftwareMaintWithoutTax},
#{costSoftwareMaintWithTax},
#{costHardwareMaintWithoutTax},
#{costHardwareMaintWithTax},
#{costProvinceServiceWithTax},
#{costProvinceServiceWithoutTax},
#{costOtherWithTax},
#{costOtherWithoutTax},
#{remark},
#{chargeStatus},
now(),
now()
on duplicate key update charge_status=values(charge_status)
update oms_finance_charge
order_code = #{orderCode},
biz_charge_date = #{bizChargeDate},
finance_charge_date = #{financeChargeDate},
income_with_tax_total = #{incomeWithTaxTotal},
income_without_tax_total = #{incomeWithoutTaxTotal},
cost_software_without_tax = #{costSoftwareWithoutTax},
cost_software_with_tax = #{costSoftwareWithTax},
cost_hardware_without_tax = #{costHardwareWithoutTax},
cost_hardware_with_tax = #{costHardwareWithTax},
cost_software_maint_without_tax = #{costSoftwareMaintWithoutTax},
cost_software_maint_with_tax = #{costSoftwareMaintWithTax},
cost_hardware_maint_without_tax = #{costHardwareMaintWithoutTax},
cost_hardware_maint_with_tax = #{costHardwareMaintWithTax},
cost_province_service_with_tax = #{costProvinceServiceWithTax},
cost_province_service_without_tax = #{costProvinceServiceWithoutTax},
cost_other_with_tax = #{costOtherWithTax},
cost_other_without_tax = #{costOtherWithoutTax},
remark = #{remark},
charge_status = #{chargeStatus},
update_by = #{updateBy},
update_time = now()
where id = #{id}
update oms_finance_charge
biz_charge_date = #{bizChargeDate},
finance_charge_date = #{financeChargeDate},
income_with_tax_total = #{incomeWithTaxTotal},
income_without_tax_total = #{incomeWithoutTaxTotal},
cost_software_without_tax = #{costSoftwareWithoutTax},
cost_software_with_tax = #{costSoftwareWithTax},
cost_hardware_without_tax = #{costHardwareWithoutTax},
cost_hardware_with_tax = #{costHardwareWithTax},
cost_software_maint_without_tax = #{costSoftwareMaintWithoutTax},
cost_software_maint_with_tax = #{costSoftwareMaintWithTax},
cost_hardware_maint_without_tax = #{costHardwareMaintWithoutTax},
cost_hardware_maint_with_tax = #{costHardwareMaintWithTax},
cost_province_service_with_tax = #{costProvinceServiceWithTax},
cost_province_service_without_tax = #{costProvinceServiceWithoutTax},
cost_other_with_tax = #{costOtherWithTax},
cost_other_without_tax = #{costOtherWithoutTax},
remark = #{remark},
charge_status = #{chargeStatus},
update_by = #{updateBy},
update_time = now()
where order_code = #{orderCode}
update oms_finance_charge
set charge_status=#{chargeStatus},
biz_charge_date=null,
update_time=now()
where order_code = #{orderCode}
update oms_finance_charge set
finance_charge_date = #{financeChargeDate},
income_with_tax_total = #{incomeWithTaxTotal},
income_without_tax_total = #{incomeWithoutTaxTotal},
cost_software_without_tax = #{costSoftwareWithoutTax},
cost_software_with_tax = #{costSoftwareWithTax},
cost_hardware_without_tax = #{costHardwareWithoutTax},
cost_hardware_with_tax = #{costHardwareWithTax},
cost_software_maint_without_tax = #{costSoftwareMaintWithoutTax},
cost_software_maint_with_tax = #{costSoftwareMaintWithTax},
cost_hardware_maint_without_tax = #{costHardwareMaintWithoutTax},
cost_hardware_maint_with_tax = #{costHardwareMaintWithTax},
cost_province_service_with_tax = #{costProvinceServiceWithTax},
cost_province_service_without_tax = #{costProvinceServiceWithoutTax},
cost_other_with_tax = #{costOtherWithTax},
cost_other_without_tax = #{costOtherWithoutTax},
remark = #{remark},
charge_status = #{chargeStatus},
update_by = #{updateBy},
update_time = now()
where id = #{id}
delete from oms_finance_charge where id = #{id}
delete from oms_finance_charge where id in
#{id}