-- 处理历史数据 生产工单行号为空
IF EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 't_im_mdc_mqbentry_m') 
delete from t_im_mdc_mqbentry_m  where fmanuentryid =0;

IF EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 't_im_mdc_mqbentry_m') 
update t_im_mdc_mqbentry_m m  set fmanuentry = ( select fseq from t_pom_mftorderentry t where  t.fentryid= m.fmanuentryid ) where m.fmanuentry = ' ' and exists (select 1 from t_pom_mftorderentry t where  t.fentryid= m.fmanuentryid ) ;
