/**Begin D:\PDM_UPGRADE\PDM1\HAOS_table.sql **/

IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HAOS_STAFFPERSON') 
 CREATE TABLE T_HAOS_STAFFPERSON (
FID BIGINT DEFAULT 0 NOT NULL,
FCANDIDATEID BIGINT DEFAULT 0 NOT NULL,
FPERSONID 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
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HAOS_PERCHANGEEVENT') 
 CREATE TABLE T_HAOS_PERCHANGEEVENT (
FEID BIGINT DEFAULT 0 NOT NULL,
FPEREVENTID BIGINT DEFAULT 0 NOT NULL,
FCHANGEEVENTID BIGINT DEFAULT 0 NOT NULL,
FEVENTTYPEID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FUID BIGINT DEFAULT 0 NOT NULL,
FEFFDT DATETIME,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HAOS_ORGUSESTAFF') 
 CREATE TABLE T_HAOS_ORGUSESTAFF (
FUID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FUSEORG BIGINT DEFAULT 0 NOT NULL,
FORGPERID BIGINT DEFAULT 0 NOT NULL,
FTYPE VARCHAR(2) DEFAULT ' ' 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
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HAOS_MULDIMUSESTAFF') 
 CREATE TABLE T_HAOS_MULDIMUSESTAFF (
FMUID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FUID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FTYPE VARCHAR(2) DEFAULT ' ' 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
);





/**End D:\PDM_UPGRADE\PDM1\HAOS_table.sql **/
