/**Begin D:\work\kuaijishijian\pdm\PDM_UPGRADE\PDM1\AI_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_AI_NEWBUILDREPORTHEAD') 
 CREATE TABLE T_AI_NEWBUILDREPORTHEAD (
FID BIGINT DEFAULT 0 NOT NULL,
FUSERNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FOPNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FOPDESC NVARCHAR(200) DEFAULT ' ' NOT NULL,
FOPDATE DATETIME,
FTRANSID NVARCHAR(50) DEFAULT ' ' NOT NULL,
FGLVOUCHER BIGINT DEFAULT 0 NOT NULL,
FGLVOUCHERNO NVARCHAR(50) DEFAULT ' ' NOT NULL,
FBIZVOUCHERID BIGINT DEFAULT 0 NOT NULL,
FBIZVOUCHERNO NVARCHAR(80) DEFAULT ' ' NOT NULL,
FPERIODID BIGINT DEFAULT 0 NOT NULL,
FPERIOD NVARCHAR(50) DEFAULT ' ' NOT NULL,
FSOURCESYS NVARCHAR(50) DEFAULT ' ' NOT NULL,
FSOURCEBILLNUMBER NVARCHAR(50) DEFAULT ' ' NOT NULL,
FSOURCEBILL NVARCHAR(50) DEFAULT ' ' NOT NULL,
FSOURCEBILLNO NVARCHAR(50) DEFAULT ' ' NOT NULL,
FSOURCEBILLID BIGINT DEFAULT 0 NOT NULL,
FBUILDSTATE CHAR(1) DEFAULT ' ' NOT NULL,
FBOOKID BIGINT DEFAULT 0 NOT NULL,
FACCOUNTBOOK NVARCHAR(50) DEFAULT ' ' NOT NULL,
FVCHTEMPLATEID BIGINT DEFAULT 0 NOT NULL,
FVCHTEMPLATENO NVARCHAR(50) DEFAULT ' ' NOT NULL,
FVCHTEMPLATE NVARCHAR(50) DEFAULT ' ' NOT NULL,
FBUILDTYPE CHAR(1) DEFAULT ' ' NOT NULL,
FERRORRESULT NVARCHAR(200) DEFAULT ' ' NOT NULL,
FBUILDVOUCHERTYPE CHAR(1) DEFAULT ' ' NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FORG NVARCHAR(50) DEFAULT ' ' NOT NULL,
FEXCEPTIONINFO NCLOB,
FEXCEPTIONINFO_TAG NCLOB,
FISEXCEPTIONREPORT CHAR(1) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_AI_NEWBUILDREPORTENTRY') 
 CREATE TABLE T_AI_NEWBUILDREPORTENTRY (
FID BIGINT DEFAULT 0 NOT NULL,
FUSERNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FOPNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FOPDESC NVARCHAR(200) DEFAULT ' ' NOT NULL,
FOPDATE DATETIME,
FCHECKITEM NVARCHAR(5) DEFAULT ' ' NOT NULL,
FERRLEVEL CHAR(1) DEFAULT ' ' NOT NULL,
FMESSAGE NVARCHAR(50) DEFAULT ' ' NOT NULL,
FBUILDREPORTHEADID BIGINT DEFAULT 0 NOT NULL
);



/**End D:\work\kuaijishijian\pdm\PDM_UPGRADE\PDM1\AI_table.sql **/
