/**Begin D:\PDM_UPGRADE\PDM1\HRCS_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_ECONTEMPLATETYPE') 
 CREATE TABLE T_HRCS_ECONTEMPLATETYPE (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(60) 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,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FSIMPLENAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_ECONTEMPLATETYPE_L') 
 CREATE TABLE T_HRCS_ECONTEMPLATETYPE_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,
FSIMPLENAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_ECONTEMPLATE') 
 CREATE TABLE T_HRCS_ECONTEMPLATE (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(60) DEFAULT ' ' NOT NULL,
FSTATUS VARCHAR(2) DEFAULT 'C' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FINDEX INT DEFAULT 0 NOT NULL,
FISSYSPRESET CHAR(1) DEFAULT '0' NOT NULL,
FDISABLERID BIGINT DEFAULT 0 NOT NULL,
FDISABLEDATE DATETIME,
FCLOUDTEMP VARCHAR(60) DEFAULT ' ' NOT NULL,
FSIGNTYPE VARCHAR(2) DEFAULT '0' NOT NULL,
FOFFSETX DECIMAL(19,6) DEFAULT 0 NOT NULL,
FOFFSETY DECIMAL(19,6) DEFAULT 0 NOT NULL,
FACROSSPAGESIGN CHAR(1) DEFAULT '0' NOT NULL,
FISSHOWDATE CHAR(1) DEFAULT '0' NOT NULL,
FONLYFIRSTAUTH CHAR(1) DEFAULT '0' NOT NULL,
FPERSONALAUTH CHAR(1) DEFAULT '0' NOT NULL,
FISSIGNTRAGECTORY CHAR(1) DEFAULT '0' NOT NULL,
FOFFSETXDOUBLE DECIMAL(19,6) DEFAULT 0 NOT NULL,
FOFFSETYDOUBLE DECIMAL(19,6) DEFAULT 0 NOT NULL,
FKEYWORD VARCHAR(255) DEFAULT ' ' NOT NULL,
FKEYWORDDOUBLE VARCHAR(255) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FSIMPLENAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FENABLE VARCHAR(2) DEFAULT '1' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_ECONTEMPLATE_L') 
 CREATE TABLE T_HRCS_ECONTEMPLATE_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,
FSIMPLENAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_SIGNRECORD') 
 CREATE TABLE T_HRCS_SIGNRECORD (
FID BIGINT DEFAULT 0 NOT NULL,
FECONNUMBER VARCHAR(100) DEFAULT ' ' NOT NULL,
FSIGNSTATUS VARCHAR(2) DEFAULT '0' NOT NULL,
FEMPSINGTIME DATETIME,
FPERSIGNTIME DATETIME,
FECONTEMPLATEID BIGINT DEFAULT 0 NOT NULL,
FKDAPPID BIGINT DEFAULT 0 NOT NULL,
FUSERID VARCHAR(60) DEFAULT ' ' NOT NULL,
FTEMPLATETYPE BIGINT DEFAULT 0 NOT NULL,
FCLOUD VARCHAR(60) DEFAULT ' ' NOT NULL,
FAPPNUM VARCHAR(60) DEFAULT ' ' NOT NULL,
FSIGNFLAG INT DEFAULT 0 NOT NULL,
FSIGNATRUEID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_KEYWORDMAPPING') 
 CREATE TABLE T_HRCS_KEYWORDMAPPING (
FID BIGINT DEFAULT 0 NOT NULL,
FCONTEMPID BIGINT DEFAULT 0 NOT NULL,
FFORMNUMBER VARCHAR(60) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_PERAUTHRECORD') 
 CREATE TABLE T_HRCS_PERAUTHRECORD (
FID BIGINT DEFAULT 0 NOT NULL,
FUSERID VARCHAR(60) DEFAULT ' ' NOT NULL,
FPERSONID BIGINT DEFAULT 0 NOT NULL,
FSUCCESSTIME DATETIME,
FENABLE VARCHAR(2) DEFAULT '1' NOT NULL,
FHCFPERID BIGINT DEFAULT 0 NOT NULL,
FCLOUD VARCHAR(60) DEFAULT ' ' NOT NULL,
FAPPNUM VARCHAR(60) DEFAULT ' ' NOT NULL,
FAUTHURL VARCHAR(500) DEFAULT ' ' NOT NULL,
FCREATEUSERIDTIME DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_KEYMAPPINGENTRY') 
 CREATE TABLE T_HRCS_KEYMAPPINGENTRY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FENTITYNUMBER VARCHAR(60) DEFAULT ' ' NOT NULL,
FENTITYFIELD VARCHAR(60) DEFAULT ' ' NOT NULL,
FWORDFIELD VARCHAR(255) DEFAULT ' ' NOT NULL,
FENTITYNAME VARCHAR(60) DEFAULT ' ' NOT NULL,
FENTITYFIELDNAME VARCHAR(60) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_ECTEMPLATETYPEMAP') 
 CREATE TABLE T_HRCS_ECTEMPLATETYPEMAP (
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_ECONTNOTIFY') 
 CREATE TABLE T_HRCS_ECONTNOTIFY (
FID BIGINT DEFAULT 0 NOT NULL,
FCLOUD VARCHAR(60) DEFAULT ' ' NOT NULL,
FAPPNUM VARCHAR(60) DEFAULT ' ' NOT NULL,
FSERVNAME VARCHAR(60) DEFAULT ' ' NOT NULL,
FSERVTYPE VARCHAR(2) DEFAULT '1' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_SKIPAUTH') 
 CREATE TABLE T_HRCS_SKIPAUTH (
FID BIGINT DEFAULT 0 NOT NULL,
FCLOUD VARCHAR(60) DEFAULT ' ' NOT NULL,
FAPPNUM VARCHAR(60) DEFAULT ' ' NOT NULL,
FBUSINESSID VARCHAR(60) DEFAULT ' ' NOT NULL
);



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