--物料
update t_bd_materialmftinfo_m ma1 set ma1.fmaterialid = nvl((select fmasterid from t_bd_materialmftinfo ma where ma.fid = ma1.fid),0) where fmaterialid = 0;
--倒冲
update t_bd_materialmftinfo_m ma1 set ma1.fisbackflush = 'A' where ma1.fisbackflush = '0';
--倒冲
update t_bd_materialmftinfo_m ma1 set ma1.fisbackflush = 'B' where ma1.fisbackflush = '1';
--当前组织为库存组织
update t_bd_materialmftinfo_m ma1 set fsupplyorgunitid = nvl((select ma.fcreateorgid from t_bd_materialmftinfo ma inner join t_org_org org on ma.fcreateorgid = org.fid where org.FIsInventory = '1' and ma1.fid = ma.fid),0) where ma1.fsupplyorgunitid = 0;
--供货库存组织,当前的创建组织就是库存组织的情况(当前情况为开发分支,到基线需要调整委托组织和受托组织的关系)(FToOrgID是受托组织,FFromOrgID是委托组织)
update t_bd_materialmftinfo_m ma1 set ma1.fsupplyorgunitid = nvl(( select FToOrgID from t_bd_materialmftinfo ma inner join T_ORG_OrgRelation org on org.FFromOrgID = ma.fcreateorgid where  org.ftyperelationid = 752105196531811328 and ma1.fid = ma.fid and org.FToOrgID is not null and rownum = 1),0)where ma1.fsupplyorgunitid = 0;