/*  
T_ORG_VIEWSCHEMA ID改为原来的ID
********************************************************************* 
 */ 
 DELETE FROM T_ORG_VIEWSCHEMA WHERE FID=111010;
 INSERT INTO T_ORG_VIEWSCHEMA(FID,FNUMBER,FTREETYPE,FUSAGE,FISDEFAULT,FCHECKERID,FCHECKDATE,FSTATUS,FENABLE,FCREATORID,FCREATETIME,FMODIFIERID,FMODIFYTIME,FSTARTDATE,FENDDATE,FMASTERID)
 VALUES(111010,'111010','11',' ','0',0,null,'C','1',1,{ts'2018-08-08 18:08:08'},1,{ts'2018-08-08 18:08:08'},null,null,111010);
  DELETE FROM T_ORG_VIEWSCHEMA WHERE FID=1020;
    DELETE FROM T_ORG_VIEWSCHEMA WHERE FID=111020;
 INSERT INTO T_ORG_VIEWSCHEMA(FID,FNUMBER,FTREETYPE,FUSAGE,FISDEFAULT,FCHECKERID,FCHECKDATE,FSTATUS,FENABLE,FCREATORID,FCREATETIME,FMODIFIERID,FMODIFYTIME,FSTARTDATE,FENDDATE,FMASTERID)
 VALUES(111020,'111020','11',' ','0',0,null,'C','1',1,{ts'2018-08-08 18:08:08'},1,{ts'2018-08-08 18:08:08'},null,null,111020);
  DELETE FROM T_ORG_VIEWSCHEMA WHERE FID=1030;
    DELETE FROM T_ORG_VIEWSCHEMA WHERE FID=111030;
 INSERT INTO T_ORG_VIEWSCHEMA(FID,FNUMBER,FTREETYPE,FUSAGE,FISDEFAULT,FCHECKERID,FCHECKDATE,FSTATUS,FENABLE,FCREATORID,FCREATETIME,FMODIFIERID,FMODIFYTIME,FSTARTDATE,FENDDATE,FMASTERID)
 VALUES(111030,'111030','11',' ','0',0,null,'C','1',1,{ts'2018-08-08 18:08:08'},1,{ts'2018-08-08 18:08:08'},null,null,111030);
 
   DELETE FROM T_ORG_VIEWSCHEMA_L WHERE FPKID='0JPS4WBB9S0F';
 INSERT INTO T_ORG_VIEWSCHEMA_L(FPKID,FID,FLOCALEID,FNAME,FCOMMENT)
 VALUES('0JPS4WBB9S0F',111010,'zh_CN','人力资源管控架构',' ');
  DELETE FROM T_ORG_VIEWSCHEMA_L WHERE FPKID='06ULYWQCR+ZC';
 INSERT INTO T_ORG_VIEWSCHEMA_L(FPKID,FID,FLOCALEID,FNAME,FCOMMENT)
 VALUES('06ULYWQCR+ZC',111020,'zh_CN','人事业务单元架构',' ');
  DELETE FROM T_ORG_VIEWSCHEMA_L WHERE FPKID='06UOID86AWB5';
 INSERT INTO T_ORG_VIEWSCHEMA_L(FPKID,FID,FLOCALEID,FNAME,FCOMMENT)
 VALUES('06UOID86AWB5',111030,'zh_CN','薪酬业务单元架构',' ');
 
  DELETE FROM T_ORG_STRUCTURE WHERE FID=111010;
 INSERT INTO T_ORG_STRUCTURE(FID,FNUMBER,FENABLE,FSTATUS,FCREATEORGID,FCREATORID,FCREATETIME,FMODIFYORGID,FMODIFIERID,FMODIFYTIME,FVIEWID,FORGID,FYZJORGID,FPARENTID,FYZJPARENTORGID,FISLEAF,FLONGNUMBER,FLEVEL,FISSTATSUM,FISFREEZE,FSEALUPTIME,FSORTCODE,FISCTRLUNIT,FISHR,FSTARTDATE,FENDDATE,FMASTERID,FISBIZUNIT)
 VALUES(111010,' ','1','C',100000,1,{ts'2018-08-08 18:08:08'},0,1,{ts'2018-08-08 18:08:08'},111010,100000,' ',0,' ','0',' ',1,'1','0',null,'0','1','0',null,null,111010,'0');
  DELETE FROM T_ORG_STRUCTURE WHERE FID=111020;
 INSERT INTO T_ORG_STRUCTURE(FID,FNUMBER,FENABLE,FSTATUS,FCREATEORGID,FCREATORID,FCREATETIME,FMODIFYORGID,FMODIFIERID,FMODIFYTIME,FVIEWID,FORGID,FYZJORGID,FPARENTID,FYZJPARENTORGID,FISLEAF,FLONGNUMBER,FLEVEL,FISSTATSUM,FISFREEZE,FSEALUPTIME,FSORTCODE,FISCTRLUNIT,FISHR,FSTARTDATE,FENDDATE,FMASTERID,FISBIZUNIT)
 VALUES(111020,' ','1','C',100000,1,{ts'2018-08-08 18:08:08'},0,1,{ts'2018-08-08 18:08:08'},111020,100000,' ',0,' ','0',' ',1,'1','0',null,'0','1','0',null,null,111020,'0');
  DELETE FROM T_ORG_STRUCTURE WHERE FID=111030;
 INSERT INTO T_ORG_STRUCTURE(FID,FNUMBER,FENABLE,FSTATUS,FCREATEORGID,FCREATORID,FCREATETIME,FMODIFYORGID,FMODIFIERID,FMODIFYTIME,FVIEWID,FORGID,FYZJORGID,FPARENTID,FYZJPARENTORGID,FISLEAF,FLONGNUMBER,FLEVEL,FISSTATSUM,FISFREEZE,FSEALUPTIME,FSORTCODE,FISCTRLUNIT,FISHR,FSTARTDATE,FENDDATE,FMASTERID,FISBIZUNIT)
 VALUES(111030,' ','1','C',100000,1,{ts'2018-08-08 18:08:08'},0,1,{ts'2018-08-08 18:08:08'},111030,100000,' ',0,' ','1',' ',1,'0','0',null,'0','1','0',null,null,111030,'1');
 
   DELETE FROM T_ORG_STRUCTURE_L WHERE FPKID='0JPS4WEZOZJF';
 INSERT INTO T_ORG_STRUCTURE_L(FPKID,FID,FLOCALEID,FFULLNAME,FNAME)
 VALUES('0JPS4WEZOZJF',111010,'zh_CN','环宇国际集团有限公司',' ');
  DELETE FROM T_ORG_STRUCTURE_L WHERE FPKID='06UM/+6M2GY+';
 INSERT INTO T_ORG_STRUCTURE_L(FPKID,FID,FLOCALEID,FFULLNAME,FNAME)
 VALUES('06UM/+6M2GY+',111020,'zh_CN','环宇国际集团有限公司',' ');
  DELETE FROM T_ORG_STRUCTURE_L WHERE FPKID='06UOIDHP1T33';
 INSERT INTO T_ORG_STRUCTURE_L(FPKID,FID,FLOCALEID,FFULLNAME,FNAME)
 VALUES('06UOIDHP1T33',111030,'zh_CN','环宇国际集团有限公司',' ');
 
-- update t_org_structure set FLONGNUMBER = (SELECT fnumber from t_org_org where fid = 100000) where FORGID = 100000 AND FPARENTID = 0;
-- update t_org_structure_l sl set sl.FFULLNAME = (SELECT ol.FNAME from t_org_org_l ol where ol.FID = 100000 and sl.FLOCALEID = ol.FLOCALEID) where FID in (SELECT FID from t_org_structure where FORGID = 100000 AND FPARENTID = 0);
--IF EXISTS (SELECT fnumber from t_org_org where fid = 100000) 
-- update t_org_structure set FLONGNUMBER = (SELECT fnumber from t_org_org where fid = 100000) where FID IN (111010, 111020, 111030);
-- IF EXISTS (SELECT FNAME from t_org_org_l where fid = 100000) 
-- update t_org_structure_l set FFULLNAME = (SELECT FNAME from t_org_org_l where t_org_org_l.FID = 100000 and t_org_structure_l.FLOCALEID = t_org_org_l.FLOCALEID) where FID IN (111010, 111020, 111030);