-- 同步事务日志表
If not exists (select 1 from KSQL_USERTABLES where KSQL_TABNAME='CT_LOG_SyncLog')
Create Table CT_LOG_SyncLog ( FCreatorID VARCHAR(44),FCreateTime DateTime,FLastUpdateUserID VARCHAR(44),FLastUpdateTime DateTime,FControlUnitID VARCHAR(44),FNumber NVARCHAR(80),FBizDate DateTime,FHandlerID VARCHAR(44),FDescription NVARCHAR(80),FHasEffected INT,FAuditorID VARCHAR(44),FSourceBillID NVARCHAR(80),FSourceFunction NVARCHAR(80),FID VARCHAR(44) DEFAULT '' NOT NULL ,FFivouchered INT,CFEntityName VARCHAR(100),CFDataDirection VARCHAR(100),CFDockingSystem VARCHAR(100),CFSyncStatus VARCHAR(100),CFSyncResult NCLOB(1000),CFSynctime DateTime,CFSyncCount INT,CFSuccessNum INT,CFFailNum INT,CFRequestParams NCLOB(1000),CONSTRAINT CPK_LOG_SyncLog1h1 PRIMARY KEY (FID));

-- 面谈记录表
If not exists (select 1 from KSQL_USERTABLES where KSQL_TABNAME='CT_PER_InterviewRecord')
Create Table CT_PER_InterviewRecord ( FCreatorID VARCHAR(44),FCreateTime DateTime,FLastUpdateUserID VARCHAR(44),FLastUpdateTime DateTime,FControlUnitID VARCHAR(44),FNumber NVARCHAR(80),FBizDate DateTime,FHandlerID VARCHAR(44),FDescription NVARCHAR(80),FHasEffected INT,FAuditorID VARCHAR(44),FSourceBillID NVARCHAR(80),FSourceFunction NVARCHAR(80),FID VARCHAR(44) DEFAULT '' NOT NULL ,CFInterviewTime DateTime,CFInterviewResult NCLOB(2000),CFInterviewerID VARCHAR(44),CFGradeLevel NVARCHAR(100),CFEvaResultID VARCHAR(44),CONSTRAINT CPK_PER_IntrvRIrht PRIMARY KEY (FID));


-- 考勤异常提醒记录
CREATE TABLE T_Remind_Record (
    ID INT IDENTITY(1,1) PRIMARY KEY,  -- 自增主键
    yearMonth VARCHAR(10) NOT NULL,
    personNumber VARCHAR(50) NOT NULL
);