/**Begin C:\PDM_UPGRADE\PDM1\SRC_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRC_EXPORTCHG') 
 CREATE TABLE T_SRC_EXPORTCHG (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER NVARCHAR(30) DEFAULT ' ' NOT NULL,
FSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FENABLE CHAR(1) DEFAULT ' ' NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FCREATEORGID BIGINT DEFAULT 0 NOT NULL,
FUSEORGID BIGINT DEFAULT 0 NOT NULL,
FCTRLSTRATEGY CHAR(1) DEFAULT ' ' NOT NULL,
FSEX CHAR(1) DEFAULT ' ' NOT NULL,
FBIRTHDATE DATETIME,
FIDNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FEVALUATETIME DATETIME,
FQUALIFYTIME DATETIME,
FWORKTIME DATETIME,
FTYPE CHAR(1) DEFAULT ' ' NOT NULL,
FUSERID BIGINT DEFAULT 0 NOT NULL,
FOFFICEPHONE NVARCHAR(50) DEFAULT ' ' NOT NULL,
FTELEPHONE NVARCHAR(50) DEFAULT ' ' NOT NULL,
FEMAIL NVARCHAR(50) DEFAULT ' ' NOT NULL,
FPOLITICALSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FPROFICIENTLEVELID BIGINT DEFAULT 0 NOT NULL,
FPROFICIENTTYPEID BIGINT DEFAULT 0 NOT NULL,
FISSYSPRESET CHAR(1) DEFAULT '0' NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FNAME NVARCHAR(300) DEFAULT ' ' NOT NULL,
FOFFICE NVARCHAR(300) DEFAULT ' ' NOT NULL,
FJOB NVARCHAR(300) DEFAULT ' ' NOT NULL,
FJOBTITLE NVARCHAR(300) DEFAULT ' ' NOT NULL,
FVOCATIONALQUALIFICATION NVARCHAR(300) DEFAULT ' ' NOT NULL,
FWORKINGMAJOR NVARCHAR(300) DEFAULT ' ' NOT NULL,
FREMARK NVARCHAR(300) DEFAULT ' ' NOT NULL,
FOFFICEADDRESS NVARCHAR(300) DEFAULT ' ' NOT NULL,
FLASTUPDATEUSERID BIGINT DEFAULT 0 NOT NULL,
FLASTUPDATETIME DATETIME,
FCITYID BIGINT DEFAULT 0 NOT NULL,
FEVALUATEDATE DATETIME,
FEVALUATETYPEID BIGINT DEFAULT 0 NOT NULL,
FEVALUATEFROM DATETIME,
FEVALUATETO DATETIME,
FEVALUATESCORE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FEVALUATEGRADEID BIGINT DEFAULT 0 NOT NULL,
FPAUSEFROM DATETIME,
FPAUSETO DATETIME,
FPERIODID BIGINT DEFAULT 0 NOT NULL,
FMATCHFIELD INT DEFAULT 0 NOT NULL,
FPRIORITY INT DEFAULT 0 NOT NULL,
FEVALUATEID BIGINT DEFAULT 0 NOT NULL,
FSRCBILLTYPE CHAR(1) DEFAULT ' ' NOT NULL,
FEXPERTAWARDID BIGINT DEFAULT 0 NOT NULL,
FEXPERTPUNISHID BIGINT DEFAULT 0 NOT NULL,
FBILLNO NVARCHAR(30) DEFAULT ' ' NOT NULL,
DESCRIPTION NVARCHAR(510) DEFAULT ' ' NOT NULL,
FEXPERTLD BIGINT DEFAULT 0 NOT NULL,
FISCONFIRM CHAR(1) DEFAULT '0' NOT NULL,
FISSELFHELP CHAR(1) DEFAULT '0' NOT NULL
);

IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRC_EXPORTCHG_L') 
 CREATE TABLE T_SRC_EXPORTCHG_L (
FPKID VARCHAR(18) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(300) DEFAULT ' ' NOT NULL,
FOFFICE NVARCHAR(300) DEFAULT ' ' NOT NULL,
FJOB NVARCHAR(300) DEFAULT ' ' NOT NULL,
FJOBTITLE NVARCHAR(300) DEFAULT ' ' NOT NULL,
FVOCATIONALQUALIFICATION NVARCHAR(300) DEFAULT ' ' NOT NULL,
FWORKINGMAJOR NVARCHAR(300) DEFAULT ' ' NOT NULL,
FREMARK NVARCHAR(300) DEFAULT ' ' NOT NULL,
FOFFICEADDRESS NVARCHAR(300) DEFAULT ' ' NOT NULL
);



IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRC_EXPERTAPTITUDECHG') 
 CREATE TABLE T_SRC_EXPERTAPTITUDECHG (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FAPTITUDETYPEID BIGINT DEFAULT 0 NOT NULL,
FAPTITUDENAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FISSUEORG NVARCHAR(255) DEFAULT ' ' NOT NULL,
FAPTITUDENUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FGRADE VARCHAR(20) DEFAULT ' ' NOT NULL,
FISSUEDATE DATETIME,
FDATETO DATETIME,
FCHECKDATE DATETIME,
FAPTITUDENOTE NVARCHAR(255) DEFAULT ' ' NOT NULL,
FEXPERTTRAINID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRC_EXPORTSUPPLIERCHG') 
 CREATE TABLE T_SRC_EXPORTSUPPLIERCHG (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FSUPPLIERNOTE NVARCHAR(510) DEFAULT ' ' NOT NULL,
FSUPPLIERID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRC_EXPORTPROJECTCHG') 
 CREATE TABLE T_SRC_EXPORTPROJECTCHG (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FPARTICIPATETIME DATETIME,
FBIDUNIT NVARCHAR(100) DEFAULT ' ' NOT NULL,
FBIDPROJECT NVARCHAR(100) DEFAULT ' ' NOT NULL,
FNOTE NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRC_EXPORTEDUCATIONCHG') 
 CREATE TABLE T_SRC_EXPORTEDUCATIONCHG (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FMAJOR NVARCHAR(50) DEFAULT ' ' NOT NULL,
FEDUCATIONDEGREE NVARCHAR(50) DEFAULT ' ' NOT NULL,
FDATEFROM DATETIME,
FDATETO DATETIME,
FGRADUATESCHOOL NVARCHAR(100) DEFAULT ' ' NOT NULL,
FNOTE NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRC_EXPORTWORKCHG') 
 CREATE TABLE T_SRC_EXPORTWORKCHG (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FDATEFROM DATETIME,
FDATETO DATETIME,
FWORKUNIT NVARCHAR(100) DEFAULT ' ' NOT NULL,
FDUTY NVARCHAR(50) DEFAULT ' ' NOT NULL,
FNOTE NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRC_EXPERTCHANGE') 
 CREATE TABLE T_SRC_EXPERTCHANGE (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FFIELDNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FOLDVALUE NVARCHAR(2000) DEFAULT ' ' NOT NULL,
FNEWVALUE NVARCHAR(2000) DEFAULT ' ' NOT NULL,
FFIELDID VARCHAR(50) DEFAULT ' ' NOT NULL
);

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_EXPERTAPTITUDECHG' AND KSQL_COL_NAME IN ('FSRCENTRYID')) 
 ALTER TABLE T_SRC_EXPERTAPTITUDECHG ADD (FSRCENTRYID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_EXPORTSUPPLIERCHG' AND KSQL_COL_NAME IN ('FSRCENTRYID')) 
 ALTER TABLE T_SRC_EXPORTSUPPLIERCHG ADD (FSRCENTRYID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_EXPORTPROJECTCHG' AND KSQL_COL_NAME IN ('FSRCENTRYID')) 
 ALTER TABLE T_SRC_EXPORTPROJECTCHG ADD (FSRCENTRYID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_EXPORTEDUCATIONCHG' AND KSQL_COL_NAME IN ('FSRCENTRYID')) 
 ALTER TABLE T_SRC_EXPORTEDUCATIONCHG ADD (FSRCENTRYID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_EXPORTWORKCHG' AND KSQL_COL_NAME IN ('FSRCENTRYID')) 
 ALTER TABLE T_SRC_EXPORTWORKCHG ADD (FSRCENTRYID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_EXPERTCHANGE' AND KSQL_COL_NAME IN ('FCHANGETYPE')) 
 ALTER TABLE T_SRC_EXPERTCHANGE ADD (FCHANGETYPE CHAR(1) DEFAULT '3' NOT NULL );


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