/**Begin C:\Users\rd_jin_gu\Documents\work\PDM_UPGRADE\PDM1\HRCS_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_LABELOBJECT') 
 CREATE TABLE T_HRCS_LABELOBJECT (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(60) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FTYPE VARCHAR(1) DEFAULT '0' NOT NULL,
FPARENTID BIGINT DEFAULT 0 NOT NULL,
FCONDITION NCLOB DEFAULT ' ',
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FRESULTTABLE VARCHAR(50) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FENABLE VARCHAR(2) DEFAULT '1' NOT NULL,
FSTATUS VARCHAR(2) DEFAULT 'C' NOT NULL,
FDISABLERID BIGINT DEFAULT 0 NOT NULL,
FDISABLEDATE DATETIME,
FINDEX INT DEFAULT 0 NOT NULL,
FISSYSPRESET CHAR(1) DEFAULT '0' NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FSIMPLENAME NVARCHAR(100) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_LBLJOINENTITY') 
 CREATE TABLE T_HRCS_LBLJOINENTITY (
FID BIGINT DEFAULT 0 NOT NULL,
FINDEX INT DEFAULT 0 NOT NULL,
FENTITYNUMBER VARCHAR(60) DEFAULT ' ' NOT NULL,
FENTITYALIAS VARCHAR(100) DEFAULT ' ' NOT NULL,
FTYPE VARCHAR(20) DEFAULT 'sub' NOT NULL,
FLABELOBJECTID BIGINT DEFAULT 0 NOT NULL,
FISMAINBO CHAR(1) DEFAULT '0' 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_LBLENTITYRELATION') 
 CREATE TABLE T_HRCS_LBLENTITYRELATION (
FID BIGINT DEFAULT 0 NOT NULL,
FLABELOBJECTID BIGINT DEFAULT 0 NOT NULL,
FENTITYID BIGINT DEFAULT 0 NOT NULL,
FJOINENTITYID BIGINT DEFAULT 0 NOT NULL,
FJOINTYPE VARCHAR(20) DEFAULT 'LeftJoin' 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_LBLENTITYRELENTRY') 
 CREATE TABLE T_HRCS_LBLENTITYRELENTRY (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLEFTPROP VARCHAR(200) DEFAULT ' ' NOT NULL,
FCOMPARETYPE VARCHAR(10) DEFAULT '=' NOT NULL,
FRIGHTPROP VARCHAR(200) DEFAULT ' ' NOT NULL,
FRIGHTPROPTYPE VARCHAR(20) DEFAULT 'field' NOT NULL,
FRIGHTPROPVAL VARCHAR(200) DEFAULT ' ' NOT NULL,
FLOGICTYPE VARCHAR(10) DEFAULT 'and' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_LABELOBJECT_L') 
 CREATE TABLE T_HRCS_LABELOBJECT_L (
FPKID VARCHAR(18) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FSIMPLENAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL
);



/**End C:\Users\rd_jin_gu\Documents\work\PDM_UPGRADE\PDM1\HRCS_table.sql **/
