select thisTab.id, thisTab.system_no, thisTab.bill_name, thisTab.settle_amount, thisTab.settle_rate, thisTab.dispatch_count, thisTab.settled_amount, thisTab.invoice_status, thisTab.status, thisTab.create_by, thisTab.create_time, thisTab.update_by, thisTab.update_time, thisTab.deduction_amount, thisTab.actual_settlement_amount, thisTab.service_provider_id, thisTab.service_provider_name, thisTab.service_provider_type, thisTab.push_status, thisTab.push_time, thisTab.source_system_id from tms_ap_bill AS thisTab
select count(0) from tms_ap_bill as thisTab
and thisTab.system_no = #{systemNo}
and thisTab.service_provider_type = #{serviceProviderType}
and thisTab.bill_name like concat('%', #{billName}, '%')
and thisTab.service_provider_name like concat('%', #{serviceProviderName}, '%')
and thisTab.settle_amount = #{settleAmount}
and thisTab.settle_rate = #{settleRate}
and thisTab.dispatch_count = #{dispatchCount}
and thisTab.settled_amount = #{settledAmount}
and thisTab.invoice_status = #{invoiceStatus}
and thisTab.status = #{status}
and thisTab.service_provider_id = #{serviceProviderId}
and thisTab.deduction_amount = #{deductionAmount}
and thisTab.actual_settlement_amount = #{actualSettlementAmount}
and thisTab.push_status = #{pushStatus}
and thisTab.source_system_id = #{sourceSystemId}
insert into tms_ap_bill
system_no,
bill_name,
settle_amount,
settle_rate,
dispatch_count,
settled_amount,
invoice_status,
status,
create_by,
create_time,
update_by,
update_time,
deduction_amount,
actual_settlement_amount,
service_provider_id,
service_provider_name,
service_provider_type,
push_status,
push_time,
source_system_id,
#{systemNo},
#{billName},
#{settleAmount},
#{settleRate},
#{dispatchCount},
#{settledAmount},
#{invoiceStatus},
#{status},
#{createBy},
#{createTime},
#{updateBy},
#{updateTime},
#{deductionAmount},
#{actualSettlementAmount},
#{serviceProviderId},
#{serviceProviderName},
#{serviceProviderType},
#{pushStatus},
#{pushTime},
#{sourceSystemId},
insert into tms_ap_bill
system_no,bill_name,settle_amount,settle_rate,dispatch_count,settled_amount,invoice_status,status,create_by,create_time,update_by,update_time,deduction_amount,actual_settlement_amount,push_status,push_time,source_system_id,
#{item.systemNo},#{item.billName},#{item.settleAmount},#{item.settleRate},#{item.dispatchCount},#{item.settledAmount},#{item.invoiceStatus},#{item.status},#{item.createBy},#{item.createTime},#{item.updateBy},#{item.updateTime},#{item.deductionAmount},#{item.actualSettlementAmount},#{item.pushStatus},#{item.pushTime},#{item.sourceSystemId},
update tms_ap_bill
system_no = #{systemNo},
bill_name = #{billName},
settle_amount = #{settleAmount},
settle_rate = #{settleRate},
dispatch_count = #{dispatchCount},
settled_amount = #{settledAmount},
invoice_status = #{invoiceStatus},
status = #{status},
create_by = #{createBy},
create_time = #{createTime},
update_by = #{updateBy},
update_time = #{updateTime},
deduction_amount = #{deductionAmount},
actual_settlement_amount = #{actualSettlementAmount},
service_provider_id = #{serviceProviderId},
service_provider_name = #{serviceProviderName},
service_provider_type = #{serviceProviderType},
push_status = #{pushStatus},
push_time = #{pushTime},
source_system_id = #{sourceSystemId},
where id = #{id}
update tms_ap_bill
system_no = #{item.systemNo},
bill_name = #{item.billName},
settle_amount = #{item.settleAmount},
settle_rate = #{item.settleRate},
dispatch_count = #{item.dispatchCount},
settled_amount = #{item.settledAmount},
invoice_status = #{item.invoiceStatus},
status = #{item.status},
create_by = #{item.createBy},
create_time = #{item.createTime},
update_by = #{item.updateBy},
update_time = #{item.updateTime},
deduction_amount = #{item.deductionAmount},
actual_settlement_amount = #{item.actualSettlementAmount},
service_provider_id = #{item.serviceProviderId},
service_provider_name = #{item.serviceProviderName},
service_provider_type = #{item.serviceProviderType},
push_status = #{item.pushStatus},
push_time = #{item.pushTime},
source_system_id = #{item.sourceSystemId},
where id = #{item.id}
delete from tms_ap_bill where id = #{id}
delete from tms_ap_bill where id in
#{id}