/**Begin D:\software\PDM_UPGRADE\PDM1\FPM_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FPM_INSPECTION_CONFIG')
CREATE TABLE T_FPM_INSPECTION_CONFIG (
                                         FID BIGINT DEFAULT 0 NOT NULL,
                                         FNUMBER NVARCHAR(30) DEFAULT ' ' NOT NULL,
                                         FSTATUS NVARCHAR(5) DEFAULT ' ' NOT NULL,
                                         FCREATORID BIGINT DEFAULT 0 NOT NULL,
                                         FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
                                         FENABLE NVARCHAR(5) DEFAULT ' ' NOT NULL,
                                         FCREATETIME DATETIME,
                                         FMODIFYTIME DATETIME,
                                         FMASTERID BIGINT DEFAULT 0 NOT NULL,
                                         FDISABLERID BIGINT DEFAULT 0 NOT NULL,
                                         FENABLERID BIGINT DEFAULT 0 NOT NULL,
                                         FENABLEDATE DATETIME,
                                         FDISABLEDATE DATETIME,
                                         FBODYSYSID BIGINT DEFAULT 0 NOT NULL,
                                         FINSPECTIONTYPE NVARCHAR(50) DEFAULT ' ' NOT NULL,
                                         FINSPECTIONSCOPE NVARCHAR(50) DEFAULT ' ' NOT NULL,
                                         FNOTIFIEDSTAFF BIGINT DEFAULT 0 NOT NULL,
                                         FINSPECTIONINFO NVARCHAR(1026) DEFAULT ' ' NOT NULL,
                                         FSYSTEMPRESET CHAR(1) DEFAULT '0' NOT NULL,
                                         FHANDLETYPE NVARCHAR(50) DEFAULT ' ' NOT NULL,
                                         FCOMMENT NVARCHAR(1026) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FPM_INSPECTION_CONFIG_L')
CREATE TABLE T_FPM_INSPECTION_CONFIG_L (
                                           FPKID NVARCHAR(36) DEFAULT ' ' NOT NULL,
                                           FID BIGINT DEFAULT 0 NOT NULL,
                                           FLOCALEID NVARCHAR(10) DEFAULT ' ' NOT NULL,
                                           FNAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
                                           FCOMMENT NVARCHAR(1026) DEFAULT ' ' NOT NULL,
                                           FINSPECTIONINFO NVARCHAR(1026) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FPM_INSPECTACTUALCONFIG')
CREATE TABLE T_FPM_INSPECTACTUALCONFIG (
                                           FID BIGINT DEFAULT 0 NOT NULL,
                                           FENTRYID BIGINT DEFAULT 0 NOT NULL,
                                           FSEQ INT DEFAULT 0 NOT NULL,
                                           FACTUALOBJ NVARCHAR(36) DEFAULT ' ' NOT NULL,
                                           FINSPECTACTUAL NVARCHAR(1024) DEFAULT ' ' NOT NULL,
                                           FINSPECTCANCELACTUAL NVARCHAR(1024) DEFAULT ' ' NOT NULL,
                                           FINSPECTRELEASEACTUAL NVARCHAR(1024) DEFAULT ' ' NOT NULL,
                                           FACTMATCHRULE BIGINT DEFAULT 0 NOT NULL,
                                           FINSPECTACTUALREAL NVARCHAR(255) DEFAULT ' ' NOT NULL,
                                           FINSPECTACTUALREAL_TAG NCLOB,
                                           FINSPECTCANCELACTUALREAL NVARCHAR(255) DEFAULT ' ' NOT NULL,
                                           FINSPECTCANCELACTUALREAL_TAG NCLOB,
                                           FINSPECTRELEASEACTUALREAL NVARCHAR(255) DEFAULT ' ' NOT NULL,
                                           FINSPECTRELEASEACTUALREAL_TAG NCLOB,
                                           FACTLINKENTITY NVARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FPM_INSPECTPREOCPCONFIG')
CREATE TABLE T_FPM_INSPECTPREOCPCONFIG (
                                           FID BIGINT DEFAULT 0 NOT NULL,
                                           FENTRYID BIGINT DEFAULT 0 NOT NULL,
                                           FSEQ INT DEFAULT 0 NOT NULL,
                                           FPREOBJ NVARCHAR(36) DEFAULT ' ' NOT NULL,
                                           FINSPECTRELEASEPRE NVARCHAR(1024) DEFAULT ' ' NOT NULL,
                                           FINSPECTPRE NVARCHAR(1024) DEFAULT ' ' NOT NULL,
                                           FINSPECTCANCELPRE NVARCHAR(1024) DEFAULT ' ' NOT NULL,
                                           FPREMATCHRULE BIGINT DEFAULT 0 NOT NULL,
                                           FINSPECTPREREAL NVARCHAR(255) DEFAULT ' ' NOT NULL,
                                           FINSPECTPREREAL_TAG NCLOB,
                                           FINSPECTRELEASEPREREAL NVARCHAR(255) DEFAULT ' ' NOT NULL,
                                           FINSPECTRELEASEPREREAL_TAG NCLOB,
                                           FINSPECTCANCELPREREAL NVARCHAR(255) DEFAULT ' ' NOT NULL,
                                           FINSPECTCANCELPREREAL_TAG NCLOB,
                                           FPRELINKENTITY NVARCHAR(50) DEFAULT ' ' NOT NULL
);



/**End D:\software\PDM_UPGRADE\PDM1\FPM_table.sql **/
