
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,
FLABELOBJECTID BIGINT DEFAULT 0 NOT NULL,
FLABELID BIGINT DEFAULT 0 NOT NULL,
FDIMENSIONID 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,
FFILTER VARCHAR(2000) DEFAULT ' ' NOT NULL,
FPUBLISHTYPE CHAR(1) DEFAULT '0' NOT NULL,
FPUBLISHRANGE VARCHAR(2000) 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,
FLASTTASKNUMBER BIGINT DEFAULT 0 NOT NULL,
FLASTTASKTIME DATETIME,
FNEXTTASKTIME DATETIME,
FBRMPOLICYID BIGINT DEFAULT 0 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_LABELRESULT')
 CREATE TABLE T_HRCS_LABELRESULT (
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,
FTASKMESSAGE VARCHAR(2000) DEFAULT ' ' NOT NULL,
FTASKNUMBER BIGINT DEFAULT 0 NOT NULL,
FLABELOBJECTID BIGINT DEFAULT 0 NOT NULL,
FDIMENSIONID BIGINT DEFAULT 0 NOT NULL,
FLABELID BIGINT DEFAULT 0 NOT NULL,
FOBJECTLABELVALUE NVARCHAR(200) DEFAULT ' ' NOT NULL,
FLABELVALUEID BIGINT DEFAULT 0 NOT NULL,
FLABELFIELDVALUES NCLOB,
FLABELSCENEID BIGINT DEFAULT 0 NOT NULL,
FBIZOBJID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_LABEL')
 CREATE TABLE T_HRCS_LABEL (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(60) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FTYPE VARCHAR(2) DEFAULT ' ' NOT NULL,
FGROUPID BIGINT DEFAULT 0 NOT NULL,
FSTATUS VARCHAR(2) DEFAULT 'C' NOT NULL,
FENABLE VARCHAR(2) DEFAULT '1' NOT NULL,
FISSYSPRESET VARCHAR(1) DEFAULT '0' NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FINDEX BIGINT 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_LABEL_L')
 CREATE TABLE T_HRCS_LABEL_L (
FPKID VARCHAR(18) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_LABELGROUP')
 CREATE TABLE T_HRCS_LABELGROUP (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(60) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FLEVEL INT DEFAULT 0 NOT NULL,
FPARENTID BIGINT DEFAULT 0 NOT NULL,
FISLEAF VARCHAR(1) DEFAULT '1' NOT NULL,
FSTATUS VARCHAR(2) DEFAULT 'C' NOT NULL,
FENABLE VARCHAR(2) DEFAULT '1' NOT NULL,
FISSYSPRESET VARCHAR(1) DEFAULT '0' NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FINDEX BIGINT 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_LABELGROUP_L')
 CREATE TABLE T_HRCS_LABELGROUP_L (
FPKID VARCHAR(18) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_LABELOBJECTREL')
 CREATE TABLE T_HRCS_LABELOBJECTREL (
FID BIGINT DEFAULT 0 NOT NULL,
FLABELID BIGINT DEFAULT 0 NOT NULL,
FLABELDIMENSIONID BIGINT DEFAULT 0 NOT NULL,
FLABELOBJECTID BIGINT DEFAULT 0 NOT NULL,
FBRMSCENEID BIGINT DEFAULT 0 NOT NULL,
FINDEX BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_LABELVALUE')
 CREATE TABLE T_HRCS_LABELVALUE (
FID BIGINT DEFAULT 0 NOT NULL,
FVALUE NVARCHAR(100) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FLABELID BIGINT DEFAULT 0 NOT NULL
);


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_LABELVALUERULE')
 CREATE TABLE T_HRCS_LABELVALUERULE (
FID BIGINT DEFAULT 0 NOT NULL,
FEXPRESSION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FANALYSISEXPRESSION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FLABELVALUEID BIGINT DEFAULT 0 NOT NULL,
FLABELOBJECTID BIGINT DEFAULT 0 NOT NULL,
FBRMTARGETID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_LABELPARAM')
 CREATE TABLE T_HRCS_LABELPARAM (
FID BIGINT DEFAULT 0 NOT NULL,
FPARAMID BIGINT DEFAULT 0 NOT NULL,
FSOURCE VARCHAR(10) DEFAULT ' ' NOT NULL,
FLABELID BIGINT DEFAULT 0 NOT NULL,
FLABELVALUE BIGINT DEFAULT 0 NOT NULL,
FLABELOBJECTID BIGINT DEFAULT 0 NOT NULL,
FBRMSCENEID BIGINT DEFAULT 0 NOT NULL,
FBRMIPUTPARAMID BIGINT DEFAULT 0 NOT NULL
);
