IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HAOS_ORGUSESTAFF' AND KSQL_COL_NAME IN ('FORGPERID')) 
ALTER TABLE T_HAOS_ORGUSESTAFF ADD (FORGPERID BIGINT DEFAULT 0 NOT NULL );
 
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HAOS_STAFFDIMPERSON') 
 CREATE TABLE T_HAOS_STAFFDIMPERSON (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FCANDIDATEID BIGINT DEFAULT 0 NOT NULL,
FPERID BIGINT DEFAULT 0 NOT NULL,
FORGPERID BIGINT DEFAULT 0 NOT NULL,
FORGTEAMID BIGINT DEFAULT 0 NOT NULL,
FDUTYWORKROLEID BIGINT DEFAULT 0 NOT NULL,
FJOBID BIGINT DEFAULT 0 NOT NULL,
FJOBLEVELID BIGINT DEFAULT 0 NOT NULL,
FLABORRELTYPEID BIGINT DEFAULT 0 NOT NULL,
FBASICDATA1 BIGINT DEFAULT 0 NOT NULL,
FBASICDATA2 BIGINT DEFAULT 0 NOT NULL,
FSTATUS VARCHAR(2) DEFAULT ' ' NOT NULL,
FEFFDT DATETIME,
FLEFFDT DATETIME,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME
);

