/**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_LABELPOLICY') 
 CREATE TABLE T_HRCS_LABELPOLICY (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(60) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) 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,
FLABELOBJECTID BIGINT DEFAULT 0 NOT NULL,
FLABELID BIGINT DEFAULT 0 NOT NULL,
FWORKTYPE VARCHAR(10) DEFAULT ' ' NOT NULL,
FFREQUENCY VARCHAR(100) DEFAULT ' ' NOT NULL,
FSTARTTIME DATETIME,
FENDTIME DATETIME,
FHASFILTER CHAR(1) DEFAULT '0' NOT NULL,
FPUBLISHTYPE CHAR(1) DEFAULT '0' NOT NULL,
FLASTTASKNUMBER BIGINT DEFAULT 0 NOT NULL,
FLASTTASKTIME DATETIME,
FNEXTTASKTIME DATETIME,
FBRMPOLICYID BIGINT DEFAULT 0 NOT NULL,
FLABELRESULTOBJ VARCHAR(100) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_LABELPOLICYRULE') 
 CREATE TABLE T_HRCS_LABELPOLICYRULE (
FID BIGINT DEFAULT 0 NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FLABELPOLICYID BIGINT DEFAULT 0 NOT NULL,
FLABELID BIGINT DEFAULT 0 NOT NULL,
FLABELVALUEID BIGINT DEFAULT 0 NOT NULL,
FCONDITIONS NCLOB,
FRESULTS NCLOB,
FBRMRULEID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_LABELPOLICY_L') 
 CREATE TABLE T_HRCS_LABELPOLICY_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
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_LABELPOLICYTASK') 
 CREATE TABLE T_HRCS_LABELPOLICYTASK (
FID BIGINT DEFAULT 0 NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FLABELPOLICYID BIGINT DEFAULT 0 NOT NULL,
FTASKSTATUS CHAR(1) DEFAULT '0' NOT NULL,
FTASKMESSAGE VARCHAR(2000) DEFAULT ' ' NOT NULL,
FTASKNUMBER BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_LBLSCENEREL') 
 CREATE TABLE T_HRCS_LBLSCENEREL (
FPKID BIGINT DEFAULT 0 NOT NULL,
FBASEDATAID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_LBLSTRATEGYORG') 
 CREATE TABLE T_HRCS_LBLSTRATEGYORG (
FPKID BIGINT DEFAULT 0 NOT NULL,
FBASEDATAID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_LBLPOLICYFILTER') 
 CREATE TABLE T_HRCS_LBLPOLICYFILTER (
FID BIGINT DEFAULT 0 NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FLBLPOLICYID BIGINT DEFAULT 0 NOT NULL,
FLBLFACTORID BIGINT DEFAULT 0 NOT NULL,
FVALUE VARCHAR(2000) DEFAULT ' ' NOT NULL
);



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