/**Begin D:\PDM_UPGRADE\PDM1\HRCS_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_ACTSCHEME') 
 CREATE TABLE T_HRCS_ACTSCHEME (
FID BIGINT DEFAULT 0 NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FNUMBER VARCHAR(60) DEFAULT ' ' NOT NULL,
FCREATEORGID BIGINT DEFAULT 0 NOT NULL,
FBIZOBJID BIGINT DEFAULT 0 NOT NULL,
FAPPID BIGINT DEFAULT 0 NOT NULL,
FCTRLSTRATEGY VARCHAR(50) DEFAULT ' ' NOT NULL,
FVERSION VARCHAR(50) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMOFIFYTIME DATETIME,
FENABLE VARCHAR(2) DEFAULT '2' NOT NULL,
FSTATUS VARCHAR(2) DEFAULT 'C' NOT NULL,
FDISABLERID BIGINT DEFAULT 0 NOT NULL,
FDISABLEDATE DATETIME,
FISSYSPRESET CHAR(1) DEFAULT '0' NOT NULL,
FINDEX INT DEFAULT 0 NOT NULL,
FISLATEST CHAR(1) DEFAULT '0' NOT NULL,
FSIMPLENAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FUSEORG BIGINT DEFAULT 0 NOT NULL,
FSOURCEDATAID BIGINT DEFAULT 0 NOT NULL,
FBITINDEX BIGINT DEFAULT 0 NOT NULL,
FSOURCEBITINDEX BIGINT DEFAULT 0 NOT NULL,
FVERSIONDATE BIGINT DEFAULT 0 NOT NULL,
FVERSIONSEQ BIGINT DEFAULT 0 NOT NULL,
FSEQUENCE BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_ACTSCHEMEENTRY') 
 CREATE TABLE T_HRCS_ACTSCHEMEENTRY (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_ACTSCHEMEPARAM') 
 CREATE TABLE T_HRCS_ACTSCHEMEPARAM (
FDETAILID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FPARAMNAME VARCHAR(100) DEFAULT ' ' NOT NULL,
FPARAMNUMBER VARCHAR(100) DEFAULT ' ' NOT NULL,
FPARAMVALUE VARCHAR(100) DEFAULT ' ' NOT NULL
);


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_ACTSCHEMEACTINFO') 
 CREATE TABLE T_HRCS_ACTSCHEMEACTINFO (
FDETAILID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FACTBIZOBJID BIGINT DEFAULT 0 NOT NULL,
FBINDINGLAYOUTID BIGINT DEFAULT 0 NOT NULL,
FTASKCREATETYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FTASKTHEME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FTASKASSIGNMENTTYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FSLA INT DEFAULT 0 NOT NULL,
FFLOWPARAM VARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_ACTIVITYCLIENT') 
 CREATE TABLE T_HRCS_ACTIVITYCLIENT (
FID BIGINT DEFAULT 0 NOT NULL,
FCLOUDID BIGINT DEFAULT 0 NOT NULL,
FBIZOBJID BIGINT DEFAULT 0 NOT NULL,
FQUEUENAME VARCHAR(100) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_ACTIVITY') 
 CREATE TABLE T_HRCS_ACTIVITY (
FID BIGINT DEFAULT 0 NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FNUMBER VARCHAR(60) DEFAULT ' ' NOT NULL,
FBIZOBJID BIGINT DEFAULT 0 NOT NULL,
FBIZCLASSIFY VARCHAR(100) DEFAULT ' ' NOT NULL,
FAPPID BIGINT DEFAULT 0 NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMOFIFYTIME DATETIME,
FENABLE VARCHAR(2) DEFAULT '2' NOT NULL,
FSTATUS VARCHAR(2) DEFAULT 'C' NOT NULL,
FDISABLERID BIGINT DEFAULT 0 NOT NULL,
FDISABLEDATE DATETIME,
FLONGNUMBER VARCHAR(200) DEFAULT ' ' NOT NULL,
FLEVEL INT DEFAULT 0 NOT NULL,
FFULLNAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FISLEAF CHAR(1) DEFAULT '0' NOT NULL,
FPARENTID BIGINT DEFAULT 0 NOT NULL,
FISSYSPRESET CHAR(1) DEFAULT '0' NOT NULL,
FINDEX INT DEFAULT 0 NOT NULL,
FSIMPLENAME NVARCHAR(100) DEFAULT ' ' NOT NULL
);


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_ACTIVITYINS') 
 CREATE TABLE T_HRCS_ACTIVITYINS (
FID BIGINT DEFAULT 0 NOT NULL,
FAPPLIERID BIGINT DEFAULT 0 NOT NULL,
FBIZOBJID VARCHAR(20) DEFAULT ' ' NOT NULL,
FBIZNUM VARCHAR(60) DEFAULT ' ' NOT NULL,
FBIZKEY VARCHAR(20) DEFAULT ' ' NOT NULL,
FBINDBIZBILLID VARCHAR(20) DEFAULT ' ' NOT NULL,
FBINDBIZNUM VARCHAR(60) DEFAULT ' ' NOT NULL,
FBINDBIZKEY VARCHAR(20) DEFAULT ' ' NOT NULL,
FBINDINGLAYOUTID BIGINT DEFAULT 0 NOT NULL,
FACTTHEMESTR NVARCHAR(255) DEFAULT ' ' NOT NULL,
FTASKSTATUS VARCHAR(10) DEFAULT ' ' NOT NULL,
FCREATETIME DATETIME,
FWFCURTASKID BIGINT DEFAULT 0 NOT NULL,
FWFPROCESSINSID BIGINT DEFAULT 0 NOT NULL,
FWFPROCESSDEFINITIONID BIGINT DEFAULT 0 NOT NULL,
FACTSCHEMEID BIGINT DEFAULT 0 NOT NULL,
FSHCEMENUMBER VARCHAR(60) DEFAULT ' ' NOT NULL,
FSCHEMEVERSION VARCHAR(60) DEFAULT ' ' NOT NULL,
FACTIVITYID BIGINT DEFAULT 0 NOT NULL,
FHANDLETIME DATETIME
);


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


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


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_ACTINSHANDLER') 
 CREATE TABLE T_HRCS_ACTINSHANDLER (
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_ACTOPREC') 
 CREATE TABLE T_HRCS_ACTOPREC (
FID BIGINT DEFAULT 0 NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FACTIVITYINSID BIGINT DEFAULT 0 NOT NULL,
FASSIGNTYPE VARCHAR(10) DEFAULT ' ' NOT NULL,
FCREATETIME DATETIME,
FAUDITMESSAGE NVARCHAR(255) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_ACTINSOPORI') 
 CREATE TABLE T_HRCS_ACTINSOPORI (
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_ACTINSOPNEW') 
 CREATE TABLE T_HRCS_ACTINSOPNEW (
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_ACTOPREC_L') 
 CREATE TABLE T_HRCS_ACTOPREC_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,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FAUDITMESSAGE NVARCHAR(255) DEFAULT ' ' NOT NULL
);



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