/**Begin D:\PDM_UPGRADE\PDM1\FCS_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FCS_BANKQUERYDETAIL')
 CREATE TABLE T_FCS_BANKQUERYDETAIL (
FID BIGINT DEFAULT 0 NOT NULL,
FBILLNO NVARCHAR(60) DEFAULT ' ' NOT NULL,
FBILLSTATUS NVARCHAR(30) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FAUDITORID BIGINT DEFAULT 0 NOT NULL,
FAUDITDATE DATETIME,
FMODIFYTIME DATETIME,
FCREATETIME DATETIME,
FRUNTIMES INT DEFAULT 0 NOT NULL,
FACCOUNTID BIGINT DEFAULT 0 NOT NULL,
FCURRENCYID BIGINT DEFAULT 0 NOT NULL,
FLASTRUNTIME DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FCS_SAFETYINSPECT')
 CREATE TABLE T_FCS_SAFETYINSPECT (
FID BIGINT DEFAULT 0 NOT NULL,
FBILLNO NVARCHAR(30) DEFAULT ' ' NOT NULL,
FBILLSTATUS NVARCHAR(30) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FAUDITORID BIGINT DEFAULT 0 NOT NULL,
FAUDITDATE DATETIME,
FMODIFYTIME DATETIME,
FCREATETIME DATETIME,
FBIZDATE DATETIME,
FFLOWINGCOUNT BIGINT DEFAULT 0 NOT NULL,
FEXCESSCOUNT BIGINT DEFAULT 0 NOT NULL,
FSUSPECTCOUNT BIGINT DEFAULT 0 NOT NULL,
FDEATAILCOUNT BIGINT DEFAULT 0 NOT NULL,
FBALANCECOUNT BIGINT DEFAULT 0 NOT NULL,
FRECEIPTCOUNT BIGINT DEFAULT 0 NOT NULL,
FISFIRSTSTAT CHAR(1) DEFAULT '0' NOT NULL,
FCUSTOMER NVARCHAR(50) DEFAULT ' ' NOT NULL,
FISREPORT CHAR(1) DEFAULT '0' NOT NULL,
FREPEATCOUNT BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FCS_SAFETYINSPECT_D')
 CREATE TABLE T_FCS_SAFETYINSPECT_D (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FBILLID BIGINT DEFAULT 0 NOT NULL,
FDETAILID BIGINT DEFAULT 0 NOT NULL,
FCHECKFLAG NVARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FCS_SAFETYINSPECT_U')
 CREATE TABLE T_FCS_SAFETYINSPECT_U (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FBILLENTITY NVARCHAR(50) DEFAULT ' ' NOT NULL,
FCHECKCOUNT BIGINT DEFAULT 0 NOT NULL,
FCHECKRATE DECIMAL(23,10) DEFAULT 0 NOT NULL
);


/**End D:\PDM_UPGRADE\PDM1\FCS_table.sql **/