CREATE TABLE JCL_ORG_ONJOB (
   ID SERIAL NOT NULL,
   DATA_ID INT NULL,
   SUPER_ID INT NULL,
   TYPE INT NULL,
   ON_JOB_NUM INT NULL,
   STAFF_NUM INT NULL,
   CREATOR INT NULL,
   DIMENSION INT NULL,
   CREATE_TIME varchar(100) NULL,
   UPDATE_TIME varchar(100) NULL,
   PRIMARY KEY (ID)
);
/

INSERT INTO JCL_ORG_ONJOB(DATA_ID,SUPER_ID,TYPE,ON_JOB_NUM,STAFF_NUM,CREATOR,CREATE_TIME,UPDATE_TIME)
SELECT id,supsubcomid,1,0,0,1,NOW(),NOW() from hrmsubcompany;
/

INSERT INTO JCL_ORG_ONJOB(DATA_ID,SUPER_ID,TYPE,ON_JOB_NUM,STAFF_NUM,CREATOR,CREATE_TIME,UPDATE_TIME)
SELECT id,supdepid,2,0,0,1,NOW(),NOW() from hrmdepartment;
/