/**Begin D:\PDM_UPGRADE\PDM1\HRCS_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_PERMAPPLYASSIGN_L') 
 CREATE TABLE T_HRCS_PERMAPPLYASSIGN_L (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FPKID VARCHAR(18) DEFAULT ' ' NOT NULL,
FASSIGNDESC NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_PERMAPPLYCANCEL_L') 
 CREATE TABLE T_HRCS_PERMAPPLYCANCEL_L (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FPKID VARCHAR(18) DEFAULT ' ' NOT NULL,
FCANCELDESC NVARCHAR(255) DEFAULT ' ' NOT NULL,
FCANCELREASON NVARCHAR(1000) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_PERMAPPLYCANCEL') 
 CREATE TABLE T_HRCS_PERMAPPLYCANCEL (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FPERMFILEID BIGINT DEFAULT 0 NOT NULL,
FROLEID VARCHAR(36) DEFAULT ' ' NOT NULL,
FSCHEMEID BIGINT DEFAULT 0 NOT NULL,
FVALIDSTART DATETIME,
FVALIDEND DATETIME,
FCANCELDESC NVARCHAR(255) DEFAULT ' ' NOT NULL,
FCANCELREASON NVARCHAR(1000) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_PERMAPPLYBILL') 
 CREATE TABLE T_HRCS_PERMAPPLYBILL (
FID BIGINT DEFAULT 0 NOT NULL,
FBILLNO VARCHAR(30) DEFAULT ' ' NOT NULL,
FBILLSTATUS VARCHAR(10) DEFAULT ' ' NOT NULL,
FAUDITORID BIGINT DEFAULT 0 NOT NULL,
FAUDITDATE DATETIME,
FBARCODE VARCHAR(60) DEFAULT ' ' NOT NULL,
FEVENTEFFECTDATE DATETIME,
FISEXISTSWORKFLOW CHAR(1) DEFAULT '0' NOT NULL,
FINPUTDEVICETYPE VARCHAR(100) DEFAULT ' ' NOT NULL,
FAUDITSTATUS VARCHAR(10) DEFAULT ' ' NOT NULL,
FUSERID BIGINT DEFAULT 0 NOT NULL,
FMSGPUBLISHERID BIGINT DEFAULT 0 NOT NULL,
FSCENEID BIGINT DEFAULT 0 NOT NULL,
FAUTHACTION VARCHAR(10) DEFAULT ' ' NOT NULL,
FMESSAGEID BIGINT DEFAULT 0 NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FCREATETIME DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_PERMAPPLYASSIGN') 
 CREATE TABLE T_HRCS_PERMAPPLYASSIGN (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FROLEENTRYID BIGINT DEFAULT 0 NOT NULL,
FROLEID VARCHAR(36) DEFAULT ' ' NOT NULL,
FSCHEMEID BIGINT DEFAULT 0 NOT NULL,
FVALIDSTART DATETIME,
FVALIDEND DATETIME,
FDEALWAY VARCHAR(10) DEFAULT ' ' NOT NULL,
FFILECHANGETYPE VARCHAR(10) DEFAULT ' ' NOT NULL,
FPERMFILEID BIGINT DEFAULT 0 NOT NULL,
FASSIGNDESC NVARCHAR(255) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL
);



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