update ForeignTousseApplication set packageStatus = '已使用' where packageStatus = '已接收' and (select count(ti.id) from TousseInstance ti where ti.invoicePlanID = ForeignTousseApplication.id and ti.useRecord_id is not null) > 0;
update ForeignTousseApplication set packageStatus = '待归还' where packageStatus = '已回收';
update InvoicePlan set recyclingStatus = '二次回收' where recyclingStatus = '已回收' and type = '外来器械包申请单';