update MaterialEntry set totalprice = (select sum(cost*amount) from MaterialEntryItem where materialEntry_id=MaterialEntry.id) where totalPrice is null; update foreigntousseapplication set suppliername = (select min(i.suppliername) from invoiceplan p,tousseitem i where p.id = i.recyclingapplication_id and foreigntousseapplication.id = p.id); update ForeignProxyDisinfection set hasPrinted='是' where (select count(*) from TousseInstance po where po.foreignProxyItem_id in(select fi.id from ForeignProxyItem fi where fi.foreignProxyDisinfection_id=ForeignProxyDisinfection.id ))>0; update ForeignProxyDisinfection set hasPrinted='否' where hasPrinted is null or hasPrinted!='是'; update ForeignProxyDisinfection set hasPacked='是' where (select count(*) from TousseInstance po where po.foreignProxyItem_id in(select fi.id from ForeignProxyItem fi where fi.foreignProxyDisinfection_id=ForeignProxyDisinfection.id ))>0; update ForeignProxyDisinfection set hasPacked='否' where hasPacked is null or hasPacked!='是'; update ForeignProxyItem set tousseItemId=(select id from TousseItem where recyclingApplication_ID=ForeignProxyItem.foreignProxyDisinfection_id and tousseDefinitionId=ForeignProxyItem.tousseDefinitionId) where tousseItemId is null;