/**Begin D:\PDM_UPGRADE\PDM1\HRCS_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_PERMLOGBASEINFOA') 
 CREATE TABLE T_HRCS_PERMLOGBASEINFOA (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FCHANGEFIELD VARCHAR(50) DEFAULT ' ' NOT NULL,
FBEFOREDATA NCLOB DEFAULT ' ',
FAFTERDATA NCLOB DEFAULT ' ',
FDESCRIPTION VARCHAR(255) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_PERMLOGROLEFUNCA') 
 CREATE TABLE T_HRCS_PERMLOGROLEFUNCA (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FAPPID VARCHAR(36) DEFAULT ' ' NOT NULL,
FENTITYTYPEID VARCHAR(36) DEFAULT ' ' NOT NULL,
FPERMITEMID VARCHAR(36) DEFAULT ' ' NOT NULL,
FDESCRIPTION VARCHAR(255) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL
);


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_PERMLOGINFLUUSERA') 
 CREATE TABLE T_HRCS_PERMLOGINFLUUSERA (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FPERMFILEID BIGINT DEFAULT 0 NOT NULL,
FVALIDSTART DATETIME,
FVALIDEND DATETIME,
FROLEID VARCHAR(36) DEFAULT ' ' NOT NULL,
FDATAPROPERTY VARCHAR(10) DEFAULT ' ' NOT NULL,
FSCHEMEID BIGINT DEFAULT 0 NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FPERMITEMID VARCHAR(36) DEFAULT ' ' NOT NULL,
FENTITYTYPEID VARCHAR(36) DEFAULT ' ' NOT NULL,
FAPPID VARCHAR(36) DEFAULT ' ' NOT NULL,
FPROPKEY VARCHAR(50) DEFAULT ' ' NOT NULL,
FPROPNAME VARCHAR(100) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FROLENUMBER VARCHAR(100) DEFAULT ' ' NOT NULL,
FROLENAME VARCHAR(255) DEFAULT ' ' NOT NULL,
FISUSERFORBIDDEN CHAR(1) DEFAULT '0' NOT NULL,
FSCHEMENUMBER VARCHAR(100) DEFAULT ' ' NOT NULL,
FSCHEMENAME VARCHAR(255) DEFAULT ' ' NOT NULL,
FFILEORGNUMBER VARCHAR(100) DEFAULT ' ' NOT NULL,
FFILEORGNAME VARCHAR(255) DEFAULT ' ' NOT NULL,
FISINTERSECTION VARCHAR(10) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_PERMLOGRANGEFIELDA') 
 CREATE TABLE T_HRCS_PERMLOGRANGEFIELDA (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FAPPID VARCHAR(36) DEFAULT ' ' NOT NULL,
FENTITYTYPEID VARCHAR(36) DEFAULT ' ' NOT NULL,
FPROPKEY VARCHAR(50) DEFAULT ' ' NOT NULL,
FPROPNAME VARCHAR(100) DEFAULT ' ' NOT NULL,
FBEFOREDATA VARCHAR(255) DEFAULT ' ' NOT NULL,
FAFTERDATA VARCHAR(255) DEFAULT ' ' NOT NULL,
FDESCRIPTION VARCHAR(255) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL
);


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_PERMLOGRANGEBDDRA') 
 CREATE TABLE T_HRCS_PERMLOGRANGEBDDRA (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FAPPID VARCHAR(36) DEFAULT ' ' NOT NULL,
FENTITYTYPEID VARCHAR(36) DEFAULT ' ' NOT NULL,
FBEFOREDATARULEID BIGINT DEFAULT 0 NOT NULL,
FBEFOREDRDESC NCLOB DEFAULT ' ',
FAFTERDATARULEID BIGINT DEFAULT 0 NOT NULL,
FAFTERDRDESC NCLOB DEFAULT ' ',
FDESCRIPTION VARCHAR(255) DEFAULT ' ' NOT NULL,
FPROPKEY VARCHAR(50) DEFAULT ' ' NOT NULL,
FPROPNAME VARCHAR(100) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_PERMLOGINFLUROLEA') 
 CREATE TABLE T_HRCS_PERMLOGINFLUROLEA (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FAPPID VARCHAR(36) DEFAULT ' ' NOT NULL,
FENTITYTYPEID VARCHAR(36) DEFAULT ' ' NOT NULL,
FPERMITEMID VARCHAR(36) DEFAULT ' ' NOT NULL,
FROLEID VARCHAR(36) DEFAULT ' ' NOT NULL,
FINFLUTYPE VARCHAR(10) DEFAULT ' ' NOT NULL,
FPROPKEY VARCHAR(50) DEFAULT ' ' NOT NULL,
FPROPNAME VARCHAR(100) DEFAULT ' ' NOT NULL,
FBUCAFUNCID BIGINT DEFAULT 0 NOT NULL,
FDIMENSIONID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FDESCRIPTION VARCHAR(255) DEFAULT ' ' NOT NULL,
FROLENUMBER VARCHAR(100) DEFAULT ' ' NOT NULL,
FROLENAME VARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_PERMLOGROLEOPENA') 
 CREATE TABLE T_HRCS_PERMLOGROLEOPENA (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FADMINGROUPID BIGINT DEFAULT 0 NOT NULL,
FBEFOREDATA VARCHAR(255) DEFAULT ' ' NOT NULL,
FAFTERDATA VARCHAR(255) DEFAULT ' ' NOT NULL,
FDESCRIPTION VARCHAR(255) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FADMINGROUPNUMBER VARCHAR(100) DEFAULT ' ' NOT NULL,
FADMINGROUPNAME VARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_PERMLOGRANGEDRA') 
 CREATE TABLE T_HRCS_PERMLOGRANGEDRA (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FAPPID VARCHAR(36) DEFAULT ' ' NOT NULL,
FENTITYTYPEID VARCHAR(36) DEFAULT ' ' NOT NULL,
FPERMITEMID VARCHAR(36) DEFAULT ' ' NOT NULL,
FDESCRIPTION VARCHAR(255) DEFAULT ' ' NOT NULL,
FBEFOREDATARULEID BIGINT DEFAULT 0 NOT NULL,
FAFTERDATARULEID BIGINT DEFAULT 0 NOT NULL,
FBEFOREDRDESC NCLOB DEFAULT ' ',
FAFTERDRDESC NCLOB DEFAULT ' ',
FID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_PERMLOGROLEDIMA') 
 CREATE TABLE T_HRCS_PERMLOGROLEDIMA (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FAPPID VARCHAR(36) DEFAULT ' ' NOT NULL,
FENTITYTYPEID VARCHAR(36) DEFAULT ' ' NOT NULL,
FDIMENSIONID BIGINT DEFAULT 0 NOT NULL,
FDESCRIPTION VARCHAR(255) DEFAULT ' ' NOT NULL,
FBUCAFUNCID BIGINT DEFAULT 0 NOT NULL,
FPROPKEY VARCHAR(50) DEFAULT ' ' NOT NULL,
FPROPNAME VARCHAR(100) DEFAULT ' ' NOT NULL,
FBEFOREDATA VARCHAR(255) DEFAULT ' ' NOT NULL,
FAFTERDATA VARCHAR(255) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_PERMLOGARCHIVE') 
 CREATE TABLE T_HRCS_PERMLOGARCHIVE (
FID BIGINT DEFAULT 0 NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FNUMBER VARCHAR(60) DEFAULT ' ' NOT NULL,
FLOGTYPEID BIGINT DEFAULT 0 NOT NULL,
FOPERATORID BIGINT DEFAULT 0 NOT NULL,
FOPERATIONTIME DATETIME,
FINFLUUSERNUMBER INT DEFAULT 0 NOT NULL,
FCLIENTTYPE VARCHAR(10) DEFAULT ' ' NOT NULL,
FMSERVICENAME VARCHAR(100) DEFAULT ' ' NOT NULL,
FOPENTITYTYPEID VARCHAR(36) DEFAULT ' ' NOT NULL,
FOPBTNNAME VARCHAR(100) DEFAULT ' ' NOT NULL,
FBEFOREOPDATA NCLOB DEFAULT ' ',
FAFTEROPDATA NCLOB DEFAULT ' ',
FHASHANDLE CHAR(1) DEFAULT '0' NOT NULL,
FROLEID VARCHAR(36) DEFAULT ' ' NOT NULL,
FPERMFILEID BIGINT DEFAULT 0 NOT NULL,
FENTITYTYPEID VARCHAR(36) DEFAULT ' ' NOT NULL,
FDATARULEID BIGINT DEFAULT 0 NOT NULL,
FDATARULENUMBER VARCHAR(100) DEFAULT ' ' NOT NULL,
FDATARULENAME VARCHAR(255) DEFAULT ' ' NOT NULL,
FROLENUMBER VARCHAR(100) DEFAULT ' ' NOT NULL,
FROLENAME VARCHAR(255) 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_PERMLOGRANGEBIZA') 
 CREATE TABLE T_HRCS_PERMLOGRANGEBIZA (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FBUCAFUNCID BIGINT DEFAULT 0 NOT NULL,
FBEFOREBIZDATA NCLOB DEFAULT ' ',
FAFTERBIZDATA NCLOB DEFAULT ' ',
FDESCRIPTION VARCHAR(255) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_PERMLOGRANGEORGA') 
 CREATE TABLE T_HRCS_PERMLOGRANGEORGA (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FBUCAFUNCID BIGINT DEFAULT 0 NOT NULL,
FBEFOREORGS NCLOB DEFAULT ' ',
FAFTERORGS NCLOB DEFAULT ' ',
FDESCRIPTION VARCHAR(255) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL
);



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