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;