/**Begin D:\utils\PDM_UPGRADE\PDM_UPGRADE\PDM1\HRCS_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_APISOURCE')
 CREATE TABLE T_HRCS_APISOURCE (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(60) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FSTATUS VARCHAR(2) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FENABLE VARCHAR(2) DEFAULT ' ' NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FSIMPLENAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FINDEX INT DEFAULT 0 NOT NULL,
FISSYSPRESET CHAR(1) DEFAULT '0' NOT NULL,
FDISABLERID BIGINT DEFAULT 0 NOT NULL,
FDISABLEDATE DATETIME,
FBIZCLOUDID VARCHAR(36) DEFAULT ' ' NOT NULL,
FBIZAPPID VARCHAR(36) DEFAULT ' ' NOT NULL,
FKEY VARCHAR(255) DEFAULT ' ' NOT NULL,
FMAINENTITY VARCHAR(36) DEFAULT ' ' NOT NULL,
FVERSION BIGINT DEFAULT 0 NOT NULL,
FSERVICEID VARCHAR(255) DEFAULT ' ' NOT NULL,
FMETHODID VARCHAR(255) DEFAULT ' ' NOT NULL,
FPUBERID BIGINT DEFAULT 0 NOT NULL,
FPARAM NCLOB,
FTYPE VARCHAR(10) DEFAULT ' ' NOT NULL,
FINPUTPARAM NCLOB,
FOUTPUTPARAMTYPE VARCHAR(20) DEFAULT ' ' NOT NULL,
FOUTPUTPARAM NCLOB
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_APISOURCE_L')
 CREATE TABLE T_HRCS_APISOURCE_L (
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FPKID VARCHAR(18) 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_APISOURCE_A')
 CREATE TABLE T_HRCS_APISOURCE_A (
FID BIGINT DEFAULT 0 NOT NULL,
FAPIXML NCLOB,
FNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_APIENTITY')
 CREATE TABLE T_HRCS_APIENTITY (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FENTITYKEY VARCHAR(255) DEFAULT ' ' NOT NULL,
FENTITY VARCHAR(255) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_APIFIELD')
 CREATE TABLE T_HRCS_APIFIELD (
FAPIFIELDID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FDISPLAYNAME VARCHAR(255) DEFAULT ' ' NOT NULL,
FQUERYFIELDENTITY VARCHAR(255) DEFAULT ' ' NOT NULL,
FAPIFIELDKEY VARCHAR(255) DEFAULT ' ' NOT NULL,
FAPIFIELDNAME VARCHAR(255) DEFAULT ' ' NOT NULL,
FAPIFIELDTYPE VARCHAR(255) DEFAULT ' ' NOT NULL,
FISSYSPRESET CHAR(1) DEFAULT '0' NOT NULL,
FENABLEFIELD VARCHAR(10) DEFAULT ' ' NOT NULL,
FISPARAM CHAR(1) DEFAULT '0' NOT NULL,
FQUERYFIELD VARCHAR(255) DEFAULT ' ' NOT NULL,
FMAINRNTITY VARCHAR(255) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_APIINPUT')
 CREATE TABLE T_HRCS_APIINPUT (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FINPUTFIELDKEY VARCHAR(50) DEFAULT ' ' NOT NULL,
FINPUTFIELDDESC NVARCHAR(255) DEFAULT ' ' NOT NULL,
FINPUTFIELDTYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FINPUTFIELDNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FINPUTFIELDDEFAULT VARCHAR(50) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_APIINPUT_L')
 CREATE TABLE T_HRCS_APIINPUT_L (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FPKID VARCHAR(18) DEFAULT ' ' NOT NULL,
FINPUTFIELDDESC NVARCHAR(255) DEFAULT ' ' NOT NULL,
FINPUTFIELDNAME NVARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_APIOUTPUT')
 CREATE TABLE T_HRCS_APIOUTPUT (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FOUTPUTFIELDKEY VARCHAR(50) DEFAULT ' ' NOT NULL,
FOUTPUTFIELDNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FOUTPUTFIELDTYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FOUTPUTFIELDDESC NVARCHAR(255) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_APIOUTPUT_L')
 CREATE TABLE T_HRCS_APIOUTPUT_L (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FPKID VARCHAR(18) DEFAULT ' ' NOT NULL,
FOUTPUTFIELDNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FOUTPUTFIELDDESC NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_MSGCENTER')
 CREATE TABLE T_HRCS_MSGCENTER (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(60) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FSTATUS VARCHAR(2) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FENABLE VARCHAR(2) DEFAULT ' ' NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FSIMPLENAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FINDEX INT DEFAULT 0 NOT NULL,
FISSYSPRESET CHAR(1) DEFAULT '0' NOT NULL,
FDISABLERID BIGINT DEFAULT 0 NOT NULL,
FDISABLEDATE DATETIME,
FSENDERID BIGINT DEFAULT 0 NOT NULL,
FMSGGROUPID BIGINT DEFAULT 0 NOT NULL,
FSENDTIME DATETIME,
FMSGPUBLISHERID BIGINT DEFAULT 0 NOT NULL,
FACTIONEVENTID BIGINT DEFAULT 0 NOT NULL,
FACTIONID BIGINT DEFAULT 0 NOT NULL,
FMSGTITLE VARCHAR(50) DEFAULT ' ' NOT NULL,
FMSGTAG VARCHAR(50) DEFAULT ' ' NOT NULL,
FMSGDESC VARCHAR(255) DEFAULT ' ' NOT NULL,
FMSGPARAMS NCLOB
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_MSGCENTER_L')
 CREATE TABLE T_HRCS_MSGCENTER_L (
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FPKID VARCHAR(18) 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_MSGCENTERENTRY')
 CREATE TABLE T_HRCS_MSGCENTERENTRY (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FCONSUMERID BIGINT DEFAULT 0 NOT NULL,
FCONSUMERSTATUS VARCHAR(10) DEFAULT ' ' NOT NULL,
FSUBSCRIBEID BIGINT DEFAULT 0 NOT NULL,
FCONSUMERTIME DATETIME,
FSUBSCRIBEBDID BIGINT DEFAULT 0 NOT NULL,
FDESCRIPTION VARCHAR(255) DEFAULT ' ' NOT NULL,
FRECSTATUS VARCHAR(10) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL
);


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_MSGPROBO_L')
 CREATE TABLE T_HRCS_MSGPROBO_L (
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FPKID VARCHAR(18) 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_MSGPUBLISHER')
 CREATE TABLE T_HRCS_MSGPUBLISHER (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(60) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FSTATUS VARCHAR(2) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FENABLE VARCHAR(2) DEFAULT ' ' NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FSIMPLENAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FINDEX INT DEFAULT 0 NOT NULL,
FISSYSPRESET CHAR(1) DEFAULT '0' NOT NULL,
FDISABLERID BIGINT DEFAULT 0 NOT NULL,
FDISABLEDATE DATETIME,
FPUBLISHBDID BIGINT DEFAULT 0 NOT NULL,
FACTIONTYPEID BIGINT DEFAULT 0 NOT NULL,
FPUBLISHDATE DATETIME,
FOFFLINEDATE DATETIME,
FSUBSTATUS VARCHAR(10) DEFAULT ' ' NOT NULL,
FISSUBSCRIBE VARCHAR(10) DEFAULT ' ' NOT NULL,
FPUBERID BIGINT DEFAULT 0 NOT NULL,
FPUBSTATUS VARCHAR(10) DEFAULT ' ' NOT NULL,
FUSESTATUS VARCHAR(10) DEFAULT ' ' NOT NULL,
FMSGPUBNO VARCHAR(60) DEFAULT ' ' NOT NULL,
FACTIONCLOUD VARCHAR(36) DEFAULT ' ' NOT NULL,
FACTIONAPP VARCHAR(36) DEFAULT ' ' NOT NULL,
FMSGTAG NVARCHAR(100) DEFAULT ' ' NOT NULL,
FACTIONID BIGINT DEFAULT 0 NOT NULL,
FMSGPROBOID BIGINT DEFAULT 0 NOT NULL
);


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


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_MSGPUBLISHAPI')
 CREATE TABLE T_HRCS_MSGPUBLISHAPI (
FPUBAPIID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FISSYSPRESET CHAR(1) DEFAULT '0' NOT NULL,
FENABLE VARCHAR(10) DEFAULT ' ' NOT NULL,
FAPIPUBSTATUS VARCHAR(10) DEFAULT ' ' NOT NULL,
FAPIPUBERID BIGINT DEFAULT 0 NOT NULL,
FAPINO VARCHAR(60) DEFAULT ' ' NOT NULL,
FAPISOURCEID BIGINT DEFAULT 0 NOT NULL,
FNAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FAPIPUBSERVICE VARCHAR(255) DEFAULT ' ' NOT NULL,
FAPIPUBMETHOD VARCHAR(255) DEFAULT ' ' NOT NULL,
FAPITYPE VARCHAR(10) DEFAULT ' ' NOT NULL,
FNUMBER VARCHAR(60) DEFAULT ' ' NOT NULL,
FAPIPUBCLOUDID VARCHAR(36) DEFAULT ' ' NOT NULL,
FAPIPUBAPPID VARCHAR(36) DEFAULT ' ' NOT NULL,
FPARAMS NCLOB,
FINPUTPARAM NCLOB,
FOUTPUTTYPE VARCHAR(20) DEFAULT ' ' NOT NULL,
FOUTPUTPARAM NCLOB,
FID BIGINT DEFAULT 0 NOT NULL
);


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_MSGSUBSCRIBER')
 CREATE TABLE T_HRCS_MSGSUBSCRIBER (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(60) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FSTATUS VARCHAR(2) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FENABLE VARCHAR(2) DEFAULT ' ' NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FSIMPLENAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FINDEX INT DEFAULT 0 NOT NULL,
FISSYSPRESET CHAR(1) DEFAULT '0' NOT NULL,
FDISABLERID BIGINT DEFAULT 0 NOT NULL,
FDISABLEDATE DATETIME,
FSUBSCRIBEBDID BIGINT DEFAULT 0 NOT NULL,
FSUBERID BIGINT DEFAULT 0 NOT NULL,
FMSGPUBLISHERID BIGINT DEFAULT 0 NOT NULL,
FACTIONTYPEID BIGINT DEFAULT 0 NOT NULL,
FMSGSUBNO VARCHAR(60) DEFAULT ' ' NOT NULL,
FSUBSTATUS VARCHAR(10) DEFAULT ' ' NOT NULL,
FSUBTIME DATETIME,
FCONSUMERSERVICE VARCHAR(255) DEFAULT ' ' NOT NULL,
FCONSUMERMETHOD VARCHAR(255) DEFAULT ' ' NOT NULL,
FCONSUMERCLOUD VARCHAR(36) DEFAULT ' ' NOT NULL,
FCONSUMERAPP VARCHAR(36) DEFAULT ' ' NOT NULL,
FACTIONID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_MSGSUBSCRIBER_L')
 CREATE TABLE T_HRCS_MSGSUBSCRIBER_L (
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FPKID VARCHAR(18) 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_MSGSUBSCRIBEAPI')
 CREATE TABLE T_HRCS_MSGSUBSCRIBEAPI (
FSUBSCRIBEAPIID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FAPIPUBERID BIGINT DEFAULT 0 NOT NULL,
FAPIENABLE VARCHAR(10) DEFAULT ' ' NOT NULL,
FISSYSSET CHAR(1) DEFAULT '0' NOT NULL,
FAPISUBSTATUS VARCHAR(10) DEFAULT ' ' NOT NULL,
FAPIPUBERDATE DATETIME,
FAPISUBERID BIGINT DEFAULT 0 NOT NULL,
FAPISOURCEID BIGINT DEFAULT 0 NOT NULL,
FAPIID BIGINT DEFAULT 0 NOT NULL,
FAPINAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FAPIDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FNUMBER VARCHAR(60) DEFAULT ' ' NOT NULL,
FAPISERVICE VARCHAR(255) DEFAULT ' ' NOT NULL,
FAPIMETHOD VARCHAR(255) DEFAULT ' ' NOT NULL,
FAPITYPE VARCHAR(10) DEFAULT ' ' NOT NULL,
FAPIPUBCLOUDID VARCHAR(36) DEFAULT ' ' NOT NULL,
FAPIPUBAPPID VARCHAR(36) DEFAULT ' ' NOT NULL,
FOUTPUTTYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FPARAMS NCLOB,
FINPUTPARAM NCLOB,
FOUTPUTPARAM NCLOB,
FID BIGINT DEFAULT 0 NOT NULL
);


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


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_MSGPUBLOG_L')
 CREATE TABLE T_HRCS_MSGPUBLOG_L (
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FPKID VARCHAR(18) 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_MODIFYITEMLOG')
 CREATE TABLE T_HRCS_MODIFYITEMLOG (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FMODIFYITEM NVARCHAR(100) DEFAULT ' ' NOT NULL,
FBEFOREMODIFY VARCHAR(255) DEFAULT ' ' NOT NULL,
FMODIFYFIELD NVARCHAR(100) DEFAULT ' ' NOT NULL,
FAFTERMODIFY VARCHAR(255) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_MODIFYITEMLOG_L')
 CREATE TABLE T_HRCS_MODIFYITEMLOG_L (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FPKID VARCHAR(18) DEFAULT ' ' NOT NULL,
FMODIFYITEM NVARCHAR(100) DEFAULT ' ' NOT NULL,
FMODIFYFIELD NVARCHAR(100) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_MSGPUBAPILOG')
 CREATE TABLE T_HRCS_MSGPUBAPILOG (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FOPERTYPE VARCHAR(10) DEFAULT ' ' NOT NULL,
FNUMBER VARCHAR(60) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_MSGPUBAPILOG_L')
 CREATE TABLE T_HRCS_MSGPUBAPILOG_L (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FPKID VARCHAR(18) 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_MSGSUBLOGENTRY')
 CREATE TABLE T_HRCS_MSGSUBLOGENTRY (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(60) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FSTATUS VARCHAR(2) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FENABLE VARCHAR(2) DEFAULT ' ' NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FSIMPLENAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FINDEX INT DEFAULT 0 NOT NULL,
FISSYSPRESET CHAR(1) DEFAULT '0' NOT NULL,
FDISABLERID BIGINT DEFAULT 0 NOT NULL,
FDISABLEDATE DATETIME,
FSUBSCRIBERID BIGINT DEFAULT 0 NOT NULL,
FSUBDATE DATETIME,
FSUBTYPE VARCHAR(10) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_MSGSUBLOGENTRY_L')
 CREATE TABLE T_HRCS_MSGSUBLOGENTRY_L (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FPKID VARCHAR(18) 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_MSGSUBLOG')
 CREATE TABLE T_HRCS_MSGSUBLOG (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(60) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FSTATUS VARCHAR(2) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FENABLE VARCHAR(2) DEFAULT ' ' NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FSIMPLENAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FINDEX INT DEFAULT 0 NOT NULL,
FISSYSPRESET CHAR(1) DEFAULT '0' NOT NULL,
FDISABLERID BIGINT DEFAULT 0 NOT NULL,
FDISABLEDATE DATETIME,
FPUBDOMAINID BIGINT DEFAULT 0 NOT NULL,
FACTIONTYPEID BIGINT DEFAULT 0 NOT NULL,
FPUBLISHERID BIGINT DEFAULT 0 NOT NULL,
FPUBDATE DATETIME,
FMSGSENDERID BIGINT DEFAULT 0 NOT NULL,
FSUBDATE DATETIME,
FCONSUMERID BIGINT DEFAULT 0 NOT NULL,
FSUBTYPE VARCHAR(10) DEFAULT ' ' NOT NULL,
FPUBERID BIGINT DEFAULT 0 NOT NULL,
FSUBERID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_MSGSUBLOG_L')
 CREATE TABLE T_HRCS_MSGSUBLOG_L (
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FPKID VARCHAR(18) 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_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HRCS_MSGCENTER' AND KSQL_COL_NAME ='FPUBERID')
ALTER TABLE T_HRCS_MSGCENTER ADD (FPUBERID BIGINT DEFAULT 0 NOT NULL );

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