Delete from LeftMenuInfo where id=100156;
/
Delete from LeftMenuConfig where infoid=100156;
/

CREATE TABLE JCL_ORG_CHARTVERSION (
   ID SERIAL NOT NULL,
   RECORDDATE VARCHAR(100) NULL,
   DESCRIPTION VARCHAR(255) NULL,
   CREATOR INT NULL,
   DELETETYPE INT NULL,
   CREATETIME VARCHAR(100) NULL,
   FCLASS INT NULL,
   PRIMARY KEY (ID)
);
/

CREATE TABLE JCL_CHART_COMPANYVIRTUAL (
   ID SERIAL NOT NULL,
   COMPANYVIRTUALID INT NULL,
   CREATER VARCHAR(50) NULL,
   COMPANYNAME VARCHAR(255) NULL,
   COMPANYCODE VARCHAR(255) NULL,
   COMPANYDESC VARCHAR(255) NULL,
   SHOWORDER INT NULL,
   CANCELED INT NULL,
   VIRTUALTYPE VARCHAR(255) NULL,
   VIRTUALTYPEDESC VARCHAR(1000) NULL,
   VERSIONID INT NULL,
   VERSIONDATE VARCHAR(255) NULL,
   FONJOB INT NULL,
   PRIMARY KEY (ID)
);
/

CREATE TABLE JCL_CHART_DEPARTMENT (
   ID SERIAL NOT NULL,
   CREATER VARCHAR(50) NULL,
   DEPARTMENTID INT NULL,
   DEPARTMENTMARK VARCHAR(100) NULL,
   DEPARTMENTNAME VARCHAR(255) NULL,
   SUBCOMPANYID INT NULL,
   SUBCOMPANY VARCHAR(100) NULL,
   SUPDEPARTMENTID INT NULL,
   SUPDEPARTMENT VARCHAR(100) NULL,
   CANCELED INT NULL,
   DEPARTMENTCODE VARCHAR(255) NULL,
   COADJUTANT VARCHAR(100) NULL,
   TLEVEL INT NULL,
   VERSIONID INT NULL,
   VERSIONDATE VARCHAR(255) NULL,
   FONJOB INT NULL,
   ISVIRTUAL INT NULL,
   FLEADER VARCHAR(500) NULL,
   PRIMARY KEY (ID)
);
/

CREATE TABLE JCL_CHART_DEPARTMENTVIRTUAL (
   ID SERIAL NOT NULL,
   DEPARTMENTVIRTUALID INT NULL,
   CREATER VARCHAR(50) NULL,
   DEPARTMENTNAME VARCHAR(255) NULL,
   DEPARTMENTCODE VARCHAR(255) NULL,
   DEPARTMENTMARK VARCHAR(255) NULL,
   SUPDEPTMENT VARCHAR(100) NULL,
   SUPDEPID INT NULL,
   ALLSUPDEPID VARCHAR(1000) NULL,
   SUBCOMPANY VARCHAR(100) NULL,
   SUBCOMPANYID INT NULL,
   CANCELED INT NULL,
   VIRTUALTYPE VARCHAR(255) NULL,
   TLEVEL VARCHAR(255) NULL,
   SHOWORDER INT NULL,
   VERSIONID INT NULL,
   VERSIONDATE VARCHAR(255) NULL,
   FONJOB INT NULL,
   PRIMARY KEY (ID)
);
/

CREATE TABLE JCL_CHART_JOB (
   ID SERIAL NOT NULL,
   JOBID INT NULL,
   CREATER VARCHAR(50) NULL,
   JOBNAME VARCHAR(100) NULL,
   DEPARTMENTID INT NULL,
   DEPARTMENT VARCHAR(100) NULL,
   SUBCOMPANYID INT NULL,
   SUBCOMPANY VARCHAR(100) NULL,
   JOBRESPONSIBILITY VARCHAR(1000) NULL,
   CANCELED INT NULL,
   JOBCODE VARCHAR(255) NULL,
   DESCRIPTION VARCHAR(1000) NULL,
   VERSIONID INT NULL,
   VERSIONDATE VARCHAR(255) NULL,
   FONJOB INT NULL,
   PRIMARY KEY (ID)
);
/

CREATE TABLE JCL_CHART_RESOURCE (
   ID SERIAL NOT NULL,
   RESOURCEID INT NULL,
   LASTNAME VARCHAR(100) NULL,
   CREATER VARCHAR(50) NULL,
   WORKYEAR VARCHAR(50) NULL,
   COMPANYWORKYEAR VARCHAR(50) NULL,
   USEKIND VARCHAR(50) NULL,
   MANAGERSTR VARCHAR(500) NULL,
   STATUS INT NULL,
   SEX CHAR(1) NULL,
   ACCOUNTTYPE INT NULL,
   BELONGTO INT NULL,
   LOGINID VARCHAR(100) NULL,
   MARITALSTATUS VARCHAR(100) NULL,
   TELEPHONE VARCHAR(100) NULL,
   MOBILE VARCHAR(100) NULL,
   MOBILECALL VARCHAR(100) NULL,
   EMAIL VARCHAR(100) NULL,
   LOCATIONNAME VARCHAR(100) NULL,
   RESOURCETYPE VARCHAR(10) NULL,
   STARTDATE VARCHAR(100) NULL,
   ENDDATE VARCHAR(100) NULL,
   JOBTITLEID INT NULL,
   JOBTITLE VARCHAR(100) NULL,
   JOBLEVEL INT NULL,
   SECLEVEL INT NULL,
   DEPARTMENTID INT NULL,
   DEPARTMENT VARCHAR(100) NULL,
   SUBCOMPANYID INT NULL,
   SUBCOMPANY VARCHAR(100) NULL,
   COSTCENTER VARCHAR(100) NULL,
   MANAGER INT NULL,
   ASSISTANT INT NULL,
   WORKCODE VARCHAR(100) NULL,
   CLASSIFICATION VARCHAR(10) NULL,
   VERSIONID INT NULL,
   VERSIONDATE VARCHAR(255) NULL,
   POLICY VARCHAR(255) NULL,
   DEGREE VARCHAR(255) NULL,
   PRIMARY KEY (ID)
);
/

CREATE TABLE JCL_CHART_RESOURCEVIRTUAL (
   ID SERIAL NOT NULL,
   RESOURCEID INT NULL,
   MANAGERID INT NULL,
   SUBCOMPANYID INT NULL,
   DEPARTMENTID INT NULL,
   MANAGERSTR VARCHAR(1000) NULL,
   VIRTUALTYPE INT NULL,
   VERSIONID INT NULL,
   VERSIONDATE VARCHAR(255) NULL,
   PRIMARY KEY (ID)
);
/

CREATE TABLE JCL_CHART_SUBCOMPANY (
   ID SERIAL NOT NULL,
   CREATER VARCHAR(50) NULL,
   SUBCOMPANYID INT NULL,
   SUBCOMPANYNAME VARCHAR(100) NULL,
   SUBCOMPANYDESC VARCHAR(255) NULL,
   COMPANY VARCHAR(100) NULL,
   SUPSUBCOMPANYID INT NULL,
   SUPSUBCOMPANY VARCHAR(100) NULL,
   CANCELED INT NULL,
   SUBCOMPANYCODE VARCHAR(255) NULL,
   LIMITUSERS INT NULL,
   TLEVEL INT NULL,
   VERSIONID INT NULL,
   VERSIONDATE VARCHAR(255) NULL,
   FONJOB INT NULL,
   ISVIRTUAL INT NULL,
   PRIMARY KEY (ID)
);
/

CREATE TABLE JCL_CHART_SUBCOMPANYVIRTUAL (
   ID SERIAL NOT NULL,
   SUBCOMPANYVIRTUALID INT NULL,
   CREATER VARCHAR(50) NULL,
   SUBCOMPANYNAME VARCHAR(100) NULL,
   SUBCOMPANYCODE VARCHAR(255) NULL,
   SUBCOMPANYDESC VARCHAR(255) NULL,
   SUPSUBCOMPANY VARCHAR(100) NULL,
   SUPSUBCOMPANYID INT NULL,
   COMPANY VARCHAR(100) NULL,
   COMPANYID INT NULL,
   CANCELED INT NULL,
   VIRTUALTYPE VARCHAR(255) NULL,
   TLEVEL VARCHAR(255) NULL,
   SHOWORDER INT NULL,
   VERSIONID INT NULL,
   VERSIONDATE VARCHAR(255) NULL,
   FONJOB INT NULL,
   PRIMARY KEY (ID)
);
/

alter table  jcl_chart_subcompany add job_num int;
/

alter table jcl_chart_subcompany add staff_num int;
/

alter table jcl_chart_department add job_num int;
/

alter table jcl_chart_department add staff_num int;
/