Index: ssts-web/src/main/webapp/dataUpdater/sqls/4.2.7_4.2.8.sql =================================================================== diff -u -r14438 -r36579 --- ssts-web/src/main/webapp/dataUpdater/sqls/4.2.7_4.2.8.sql (.../4.2.7_4.2.8.sql) (revision 14438) +++ ssts-web/src/main/webapp/dataUpdater/sqls/4.2.7_4.2.8.sql (.../4.2.7_4.2.8.sql) (revision 36579) @@ -1,5 +1,5 @@ update invoicePlan set recyclingStatus = '待接收' where id in (select id from ForeignTousseApplication f where f.packagestatus = '待接收') and type = '外来器械包申请单' and endStatus is null; update invoicePlan set recyclingStatus = '已接收' where id in (select id from ForeignTousseApplication f where f.packagestatus = '已接收') and type = '外来器械包申请单' and deliverstatus = '待发货' and endStatus is null; -update invoicePlan set recyclingStatus = '待回收' where id in (select id from ForeignTousseApplication f where f.packagestatus = '已接收') and type = '外来器械包申请单' and deliverstatus = '已发货' and endStatus is null; +update invoicePlan set recyclingStatus = '待回收' where id in (select id from ForeignTousseApplication f where f.packagestatus = '已接收') and type = '外来器械包申请单' and deliverstatus = '已发货' and endStatus is null and (recyclingStatus is null or recyclingStatus<>'已回收' and recyclingStatus<>'待回收'); update invoicePlan set recyclingStatus = '已回收' where id in (select id from ForeignTousseApplication f where (f.packagestatus = '已回收' or f.packagestatus = '已归还')) and type = '外来器械包申请单' and deliverstatus = '已发货' and endStatus is null; update tousseitem set toussedefinitionid = (select min(t.id) from toussedefinition t where t.invoiceplanid = tousseitem.recyclingapplication_id) where toussetype = '外来器械包' and toussedefinitionid is null;