-- 处理历史数据 车间赋值生产部门
update t_im_mdc_prblentry_m set fproducedept = fworkshopid where fworkshopid not in (select fid from t_mpdm_workshopsetup where 1=1);

update t_im_mdc_prblentry_m set fproducedept = (select fworkshoporgid from t_mpdm_workshopsetup where fid =t_im_mdc_prblentry_m.fworkshopid) where fworkshopid in (select fid from t_mpdm_workshopsetup);
 