/**Begin D:\workspace\_workspace_\_workspace_doc_\工具\PDM_UPGRADE\PDMNEW\FPM_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FPM_SMARTCOLLECT') 
 CREATE TABLE T_FPM_SMARTCOLLECT (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER CHAR(50) DEFAULT ' ' NOT NULL,
FNAME CHAR(100) DEFAULT ' ' NOT NULL,
FSTATUS CHAR(5) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FENABLE CHAR(1) DEFAULT '1' NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FTARGETBILL VARCHAR(100) DEFAULT ' ' NOT NULL,
FSOURCEBILL VARCHAR(100) DEFAULT ' ' NOT NULL,
FLINKENTITY VARCHAR(100) DEFAULT ' ' NOT NULL,
FAPPLYCONDITION NVARCHAR(1024) DEFAULT ' ' NOT NULL,
FSAVEAPPLYCONDITION NVARCHAR(1024) DEFAULT ' ' NOT NULL,
FSAVEAPPLYCONDITION_TAG NCLOB,
FREMARK NVARCHAR(1024) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FPM_SMARTCOLLECT_L') 
 CREATE TABLE T_FPM_SMARTCOLLECT_L (
FPKID VARCHAR(36) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(50) DEFAULT ' ' NOT NULL,
FNAME VARCHAR(50) DEFAULT ' ' NOT NULL,
FREMARK VARCHAR(1024) DEFAULT ' ' NOT NULL
);


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FPM_FIELDMAPPING') 
 CREATE TABLE T_FPM_FIELDMAPPING (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FVALTYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FGETVALUEDESC NVARCHAR(1024) DEFAULT ' ' NOT NULL,
FGETVALUESAVE NVARCHAR(1024) DEFAULT ' ' NOT NULL,
FGETVALUESAVE_TAG NCLOB,
FSOURCEFIELDDESC VARCHAR(255) DEFAULT ' ' NOT NULL,
FSOURCEFIELDSAVE_TAG VARCHAR(255) DEFAULT ' ' NOT NULL,
FJUDGEUNIQUE CHAR(1) DEFAULT '1' NOT NULL,
FTARGETFIELDDESC VARCHAR(255) DEFAULT ' ' NOT NULL,
FTARGETFIELDPROP VARCHAR(255) DEFAULT ' ' NOT NULL
);



/**End D:\workspace\_workspace_\_workspace_doc_\工具\PDM_UPGRADE\PDMNEW\FPM_table.sql **/
