--更新工艺路线的生效失效时间（默认值）
--更新生效时间为工艺路线的创建时间
--更新失效时间为2999-12-31
UPDATE T_PDM_ROUTEOPERATION SET FVALIDDATE = (SELECT H.FCREATETIME FROM T_PDM_ROUTE H WHERE H.FID =T_PDM_ROUTEOPERATION.FID )  WHERE FVALIDDATE IS NULL;
UPDATE T_PDM_ROUTEOPERATION SET FINVALIDDATE = {TS'2999-12-31  00:00:00'}  WHERE FINVALIDDATE IS NULL;



--对工艺路线分录的原始单据分录ID进行初始化
UPDATE T_PDM_ROUTEOPERATION SET FSRCOPENTRYID = FENTRYID WHERE FSRCOPENTRYID = 0 OR FSRCOPENTRYID IS NULL;

