/**Begin D:\文档\DBA\PDM_UPGRADE\pdm1\SYS_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SVC_PARAMETERCOPY') 
 CREATE TABLE T_SVC_PARAMETERCOPY (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(80) DEFAULT ' ' NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FSTATUS CHAR(1) DEFAULT 'A' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FENABLE CHAR(1) DEFAULT '0' NOT NULL,
FCREATETIME DATETIME DEFAULT GETDATE() NOT NULL,
FMODIFYTIME DATETIME,
FCREATEORGID BIGINT DEFAULT 0 NOT NULL,
FSOURCEORG BIGINT DEFAULT 0 NOT NULL,
FPARAMSCOPE CHAR(1) DEFAULT '0' NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FCTRLSTRATEGY VARCHAR(50) DEFAULT ' ' NOT NULL,
FSOURCEDATAID BIGINT DEFAULT 0 NOT NULL,
FBITINDEX BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SVC_PARAMETERCOPY_L') 
 CREATE TABLE T_SVC_PARAMETERCOPY_L (
FPKID VARCHAR(36) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SVC_PARAMCOPY_TARGETORG') 
 CREATE TABLE T_SVC_PARAMCOPY_TARGETORG (
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_SVC_PARAMCOPY_DETAIL') 
 CREATE TABLE T_SVC_PARAMCOPY_DETAIL (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FPARAMFIELDAPP VARCHAR(36) DEFAULT ' ' NOT NULL,
FPARAMNAME VARCHAR(100) DEFAULT ' ' NOT NULL,
FPARAMVALUE VARCHAR(50) DEFAULT ' ' NOT NULL,
FPARAMFIELDKEY VARCHAR(50) DEFAULT ' ' NOT NULL,
FPARAMID VARCHAR(50) DEFAULT ' ' NOT NULL
);


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SVC_PARAMCOPY_RESULT')
 CREATE TABLE T_SVC_PARAMCOPY_RESULT (
FID BIGINT DEFAULT 0 NOT NULL,
FBILLNO VARCHAR(30) DEFAULT ' ' NOT NULL,
FBILLSTATUS CHAR(1) 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 DEFAULT GETDATE() NOT NULL,
FCOPYAPP VARCHAR(50) DEFAULT ' ' NOT NULL,
FSOURCEORG BIGINT DEFAULT 0 NOT NULL,
FCOPYBASEDATAID BIGINT DEFAULT 0 NOT NULL,
FSTART DATETIME,
FEND DATETIME,
FCOPYSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255)
);

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

/**End D:\文档\DBA\PDM_UPGRADE\pdm1\SYS_table.sql **/
