/**Begin D:\PDM_UPGRADE\PDM1\HRCS_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_RELATEENTITY') 
 CREATE TABLE T_HRCS_RELATEENTITY (
FID BIGINT DEFAULT 0 NOT NULL,
FCONTEMPID BIGINT DEFAULT 0 NOT NULL,
FMAINENTITY VARCHAR(36) DEFAULT ' ' NOT NULL,
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_HRCS_RELATEENTITYENTRY') 
 CREATE TABLE T_HRCS_RELATEENTITYENTRY (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FENTITYNAME VARCHAR(36) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_ENTITYMAPENTRY') 
 CREATE TABLE T_HRCS_ENTITYMAPENTRY (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FPARENTENTITY VARCHAR(36) DEFAULT ' ' NOT NULL,
FENTITY VARCHAR(36) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_ENTITYMAPSUBENTRY') 
 CREATE TABLE T_HRCS_ENTITYMAPSUBENTRY (
FDETAILID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FPARENTENTITYFIELD VARCHAR(50) DEFAULT ' ' NOT NULL,
FENTITYFIELD VARCHAR(50) DEFAULT ' ' NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL
);



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