/**Begin D:\PDM_UPGRADE\PDM1\HRCS_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HRCS_DIMENSION' AND KSQL_COL_NAME IN ('FBUCAFUNCID')) 
 ALTER TABLE T_HRCS_DIMENSION ADD (FBUCAFUNCID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_ADMINGROUPFILE') 
 CREATE TABLE T_HRCS_ADMINGROUPFILE (
FID BIGINT DEFAULT 0 NOT NULL,
FADMINGROUPID BIGINT DEFAULT 0 NOT NULL,
FORGID BIGINT DEFAULT 0 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_ADMINGROUPORG') 
 CREATE TABLE T_HRCS_ADMINGROUPORG (
FID BIGINT DEFAULT 0 NOT NULL,
FADMINGROUPID BIGINT DEFAULT 0 NOT NULL,
FADMINORGID BIGINT DEFAULT 0 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_ADMINGROUPFUNC') 
 CREATE TABLE T_HRCS_ADMINGROUPFUNC (
FID BIGINT DEFAULT 0 NOT NULL,
FADMINGROUPID BIGINT DEFAULT 0 NOT NULL,
FBUCAFUNCID BIGINT DEFAULT 0 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_ADMINGROUPFUNCORG') 
 CREATE TABLE T_HRCS_ADMINGROUPFUNCORG (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL
);



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