update invoicePlan set recyclingTime = (select max(recyclingTime) from RecyclingRecord where recyclingApplication_id=invoicePlan.id) where recyclingTime is null;
update Invoice set recyclingTime = (select recyclingTime from invoicePlan where id=Invoice.invoicePlan_ID) where recyclingTime is null and invoicePlan_ID is not null;