/**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_DATAROLECONFIG') 
 CREATE TABLE T_HRCS_DATAROLECONFIG (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(60) DEFAULT ' ' NOT NULL,
FNAME VARCHAR(100) DEFAULT ' ' NOT NULL,
FSTATUS CHAR(1) DEFAULT 'C' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FENABLE CHAR(1) DEFAULT '1' NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FDISABLERID BIGINT DEFAULT 0 NOT NULL,
FDISABLEDATE DATETIME,
FINDEX INT DEFAULT 0 NOT NULL,
FISSYSPRESET CHAR(1) DEFAULT '0' NOT NULL,
FSIMPLENAME VARCHAR(100) DEFAULT ' ' NOT NULL,
FDESCRIPTION VARCHAR(255) DEFAULT ' ' NOT NULL,
FBUSINESSOBJECT VARCHAR(50) DEFAULT ' ' NOT NULL,
FSTARTDATEFIELD VARCHAR(50) DEFAULT ' ' NOT NULL,
FBEFOREDAYS INT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_DATASORTENTRY') 
 CREATE TABLE T_HRCS_DATASORTENTRY (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FNAME VARCHAR(100) DEFAULT ' ' NOT NULL,
FDESCRIPTION VARCHAR(255) DEFAULT ' ' NOT NULL,
FCONDITIONS NCLOB DEFAULT ' ',
FID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_RETENTIONCONFIG') 
 CREATE TABLE T_HRCS_RETENTIONCONFIG (
FID BIGINT DEFAULT 0 NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FENABLE CHAR(1) DEFAULT '1' NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FDISABLERID BIGINT DEFAULT 0 NOT NULL,
FDISABLEDATE DATETIME,
FROLEID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_RETENTIONPERSON') 
 CREATE TABLE T_HRCS_RETENTIONPERSON (
FID BIGINT DEFAULT 0 NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FDATASUBJECTID BIGINT DEFAULT 0 NOT NULL,
FDATASUBJECTTYPE VARCHAR(2) DEFAULT ' ' NOT NULL,
FROLEID BIGINT DEFAULT 0 NOT NULL,
FROLESORTID BIGINT DEFAULT 0 NOT NULL,
FBIZAPPID VARCHAR(50) DEFAULT ' ' NOT NULL,
FPLANEXECDATE DATETIME,
FACTUALEXECDATE DATETIME,
FEXECSTATUS CHAR(1) DEFAULT '1' NOT NULL,
FBATCHNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL
);


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


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_RETCONFIGENTRY') 
 CREATE TABLE T_HRCS_RETCONFIGENTRY (
FPKID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FROLESORTID BIGINT DEFAULT 0 NOT NULL,
FRETENTIONPERIOD INT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL
);


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_PRIVACYSIGNING') 
 CREATE TABLE T_HRCS_PRIVACYSIGNING (
FID BIGINT DEFAULT 0 NOT NULL,
FUSERID BIGINT DEFAULT 0 NOT NULL,
FUSERTYPEID BIGINT DEFAULT 0 NOT NULL,
FPRIVACYSTMTID BIGINT DEFAULT 0 NOT NULL,
FVERSION VARCHAR(50) DEFAULT ' ' NOT NULL,
FFORMID VARCHAR(32) DEFAULT ' ' NOT NULL,
FLOCALEID BIGINT DEFAULT 0 NOT NULL,
FCOUNTRYID BIGINT DEFAULT 0 NOT NULL,
FCLIENT VARCHAR(50) DEFAULT ' ' NOT NULL,
FISAGREE VARCHAR(2) DEFAULT ' ' NOT NULL,
FMODIFYTIME DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_PRIVACYUSERTYPE') 
 CREATE TABLE T_HRCS_PRIVACYUSERTYPE (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(60) DEFAULT ' ' NOT NULL,
FNAME VARCHAR(100) DEFAULT ' ' NOT NULL,
FSTATUS CHAR(1) DEFAULT 'C' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FENABLE CHAR(1) DEFAULT '1' NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FDISABLERID BIGINT DEFAULT 0 NOT NULL,
FDISABLEDATE DATETIME,
FINDEX INT DEFAULT 0 NOT NULL,
FISSYSPRESET CHAR(1) DEFAULT '0' NOT NULL,
FSIMPLENAME VARCHAR(100) DEFAULT ' ' NOT NULL,
FDESCRIPTION VARCHAR(255) DEFAULT ' ' NOT NULL
);



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