/**Begin C:\PDM_UPGRADE\PDM1\SRC_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_EXPORT' AND KSQL_COL_NAME IN ('FSRCBILLTYPE')) 
 ALTER TABLE T_SRC_EXPORT ADD (FSRCBILLTYPE CHAR(1) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_EXPORT' AND KSQL_COL_NAME IN ('FEXPERTAWARDID')) 
 ALTER TABLE T_SRC_EXPORT ADD (FEXPERTAWARDID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_EXPORT' AND KSQL_COL_NAME IN ('FEXPERTPUNISHID')) 
 ALTER TABLE T_SRC_EXPORT ADD (FEXPERTPUNISHID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_EXPERTAPTITUDE' AND KSQL_COL_NAME IN ('FEXPERTTRAINID')) 
 ALTER TABLE T_SRC_EXPERTAPTITUDE ADD (FEXPERTTRAINID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRC_EXPERTATTEND') 
 CREATE TABLE T_SRC_EXPERTATTEND (
FID BIGINT DEFAULT 0 NOT NULL,
FBILLNO NVARCHAR(30) DEFAULT ' ' NOT NULL,
FITEMNAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FEXPERTID BIGINT DEFAULT 0 NOT NULL,
FPROJECTID BIGINT DEFAULT 0 NOT NULL,
FDATEFROM DATETIME,
FDATETO DATETIME,
FSIGNDATEFROM DATETIME,
FSIGNDATETO DATETIME,
FNUMBER DECIMAL(19,6) DEFAULT 0 NOT NULL,
FITEMTYPEID BIGINT DEFAULT 0 NOT NULL,
FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL,
FBILLSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FLASTUPDATEUSERID BIGINT DEFAULT 0 NOT NULL,
FLASTUPDATETIME DATETIME,
FAUDITORID BIGINT DEFAULT 0 NOT NULL,
FAUDITDATE DATETIME,
FSUBMITTERID BIGINT DEFAULT 0 NOT NULL,
FSUBMITDATE DATETIME,
FUNSUBMITTERID BIGINT DEFAULT 0 NOT NULL,
FUNSUBMITDATE DATETIME,
FUNAUDITORID BIGINT DEFAULT 0 NOT NULL,
FUNAUDITDATE DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRC_EXPERTAWARD') 
 CREATE TABLE T_SRC_EXPERTAWARD (
FID BIGINT DEFAULT 0 NOT NULL,
FBILLNO NVARCHAR(30) DEFAULT ' ' NOT NULL,
FITEMNAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FITEMTYPEID BIGINT DEFAULT 0 NOT NULL,
FEXPERTID BIGINT DEFAULT 0 NOT NULL,
FBILLDATE DATETIME,
FBIZORG NVARCHAR(255) DEFAULT ' ' NOT NULL,
FPROJECTID BIGINT DEFAULT 0 NOT NULL,
FGRADEID BIGINT DEFAULT 0 NOT NULL,
FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL,
FBILLSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FLASTUPDATEUSERID BIGINT DEFAULT 0 NOT NULL,
FLASTUPDATETIME DATETIME,
FAUDITORID BIGINT DEFAULT 0 NOT NULL,
FAUDITDATE DATETIME,
FSUBMITTERID BIGINT DEFAULT 0 NOT NULL,
FSUBMITDATE DATETIME,
FUNSUBMITTERID BIGINT DEFAULT 0 NOT NULL,
FUNSUBMITDATE DATETIME,
FUNAUDITORID BIGINT DEFAULT 0 NOT NULL,
FUNAUDITDATE DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRC_EXPERTPUNISH') 
 CREATE TABLE T_SRC_EXPERTPUNISH (
FID BIGINT DEFAULT 0 NOT NULL,
FBILLNO NVARCHAR(30) DEFAULT ' ' NOT NULL,
FITEMNAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FITEMTYPEID BIGINT DEFAULT 0 NOT NULL,
FEXPERTID BIGINT DEFAULT 0 NOT NULL,
FBILLDATE DATETIME,
FBIZORG NVARCHAR(255) DEFAULT ' ' NOT NULL,
FPROJECTID BIGINT DEFAULT 0 NOT NULL,
FGRADEID BIGINT DEFAULT 0 NOT NULL,
FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL,
FBILLSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FLASTUPDATEUSERID BIGINT DEFAULT 0 NOT NULL,
FLASTUPDATETIME DATETIME,
FAUDITORID BIGINT DEFAULT 0 NOT NULL,
FAUDITDATE DATETIME,
FSUBMITTERID BIGINT DEFAULT 0 NOT NULL,
FSUBMITDATE DATETIME,
FUNSUBMITTERID BIGINT DEFAULT 0 NOT NULL,
FUNSUBMITDATE DATETIME,
FUNAUDITORID BIGINT DEFAULT 0 NOT NULL,
FUNAUDITDATE DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRC_EXPERTLEAVE') 
 CREATE TABLE T_SRC_EXPERTLEAVE (
FID BIGINT DEFAULT 0 NOT NULL,
FBILLNO NVARCHAR(30) DEFAULT ' ' NOT NULL,
FITEMNAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FITEMTYPEID BIGINT DEFAULT 0 NOT NULL,
FEXPERTID BIGINT DEFAULT 0 NOT NULL,
FDATEFROM DATETIME,
FDATETO DATETIME,
FNUMBER DECIMAL(19,6) DEFAULT 0 NOT NULL,
FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL,
FBILLSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FLASTUPDATEUSERID BIGINT DEFAULT 0 NOT NULL,
FLASTUPDATETIME DATETIME,
FAUDITORID BIGINT DEFAULT 0 NOT NULL,
FAUDITDATE DATETIME,
FSUBMITTERID BIGINT DEFAULT 0 NOT NULL,
FSUBMITDATE DATETIME,
FUNSUBMITTERID BIGINT DEFAULT 0 NOT NULL,
FUNSUBMITDATE DATETIME,
FUNAUDITORID BIGINT DEFAULT 0 NOT NULL,
FUNAUDITDATE DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRC_EXPERTTRAIN') 
 CREATE TABLE T_SRC_EXPERTTRAIN (
FID BIGINT DEFAULT 0 NOT NULL,
FBILLNO NVARCHAR(30) DEFAULT ' ' NOT NULL,
FITEMNAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FITEMTYPEID BIGINT DEFAULT 0 NOT NULL,
FEXPERTID BIGINT DEFAULT 0 NOT NULL,
FBIZORG NVARCHAR(255) DEFAULT ' ' NOT NULL,
FBEGINDATE DATETIME,
FENDDATE DATETIME,
FADDRESS NVARCHAR(255) DEFAULT ' ' NOT NULL,
FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(1020) DEFAULT ' ' NOT NULL,
FISCHANGED CHAR(1) DEFAULT '0' NOT NULL,
FAPTITUDETYPEID BIGINT DEFAULT 0 NOT NULL,
FAPTITUDENUMBER NVARCHAR(50) DEFAULT ' ' NOT NULL,
FAPTITUDENAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FISSUEORG NVARCHAR(255) DEFAULT ' ' NOT NULL,
FGRADE NVARCHAR(50) DEFAULT ' ' NOT NULL,
FISSUEDATE DATETIME,
FDATETO DATETIME,
FAPTITUDENOTE NVARCHAR(50) DEFAULT ' ' NOT NULL,
FBILLSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FLASTUPDATEUSERID BIGINT DEFAULT 0 NOT NULL,
FLASTUPDATETIME DATETIME,
FAUDITORID BIGINT DEFAULT 0 NOT NULL,
FAUDITDATE DATETIME,
FSUBMITTERID BIGINT DEFAULT 0 NOT NULL,
FSUBMITDATE DATETIME,
FUNSUBMITTERID BIGINT DEFAULT 0 NOT NULL,
FUNSUBMITDATE DATETIME,
FUNAUDITORID BIGINT DEFAULT 0 NOT NULL,
FUNAUDITDATE DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRC_EXPERTTRAIN_FJ') 
 CREATE TABLE T_SRC_EXPERTTRAIN_FJ (
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_SRC_EXPERTWORK') 
 CREATE TABLE T_SRC_EXPERTWORK (
FID BIGINT DEFAULT 0 NOT NULL,
FBILLNO NVARCHAR(30) DEFAULT ' ' NOT NULL,
FITEMNAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FITEMTYPEID BIGINT DEFAULT 0 NOT NULL,
FEXPERTID BIGINT DEFAULT 0 NOT NULL,
FPROJECTID BIGINT DEFAULT 0 NOT NULL,
FDATEFROM DATETIME,
FDATETO DATETIME,
FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL,
FBILLSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FLASTUPDATEUSERID BIGINT DEFAULT 0 NOT NULL,
FLASTUPDATETIME DATETIME,
FAUDITORID BIGINT DEFAULT 0 NOT NULL,
FAUDITDATE DATETIME,
FSUBMITTERID BIGINT DEFAULT 0 NOT NULL,
FSUBMITDATE DATETIME,
FUNSUBMITTERID BIGINT DEFAULT 0 NOT NULL,
FUNSUBMITDATE DATETIME,
FUNAUDITORID BIGINT DEFAULT 0 NOT NULL,
FUNAUDITDATE DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRC_EXPERTUPDATELOG') 
 CREATE TABLE T_SRC_EXPERTUPDATELOG (
FID BIGINT DEFAULT 0 NOT NULL,
FEXPERTID BIGINT DEFAULT 0 NOT NULL,
FSRCBILLTYPE CHAR(1) DEFAULT ' ' NOT NULL,
FEVALUATEDATE DATETIME,
FEVALUATEGRADEID BIGINT DEFAULT 0 NOT NULL,
FPAUSEFROM DATETIME,
FPAUSETO DATETIME,
FEVALUATEID BIGINT DEFAULT 0 NOT NULL,
FEXPERTAWARDID BIGINT DEFAULT 0 NOT NULL,
FEXPERTPUNISHID BIGINT DEFAULT 0 NOT NULL,
FEVALUATETYPEID BIGINT DEFAULT 0 NOT NULL,
FPERIODID BIGINT DEFAULT 0 NOT NULL,
FEVALUATEFROM DATETIME,
FEVALUATETO DATETIME,
FEVALUATESCORE DECIMAL(23,10) DEFAULT 0 NOT NULL
);


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



/**End C:\PDM_UPGRADE\PDM1\SRC_table.sql **/
