/**Begin D:\PDM_UPGRADE\PDM1\kd_1.5.133_ai_asstacttype.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_AI_STANDARDEVENTENTITY') 
 CREATE TABLE T_AI_STANDARDEVENTENTITY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 1 NOT NULL,
FBILLTYPENAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FFULLFIELD NVARCHAR(255) DEFAULT ' ' NOT NULL,
FEXPDESC VARCHAR(255) DEFAULT ' ' NOT NULL,
FEXP VARCHAR(255) DEFAULT ' ' NOT NULL,
FBILLNO NVARCHAR(50) DEFAULT ' ' NOT NULL,
FASSTACTTYPEID BIGINT DEFAULT 0 NOT NULL,
FFIELD NVARCHAR(255) DEFAULT ' ' NOT NULL,
FROWFIELD NVARCHAR(50) DEFAULT ' ' NOT NULL
);


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_AI_STANDARDEVENT') 
 CREATE TABLE T_AI_STANDARDEVENT (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER NVARCHAR(50) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FSTATUS CHAR(1) DEFAULT 'C' 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,
FISSYSTEM CHAR(1) DEFAULT '0' NOT NULL
);


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_AI_MOREASSTACTTYPE') 
 CREATE TABLE T_AI_MOREASSTACTTYPE (
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_AI_ASSTACTTYPE') 
 CREATE TABLE T_AI_ASSTACTTYPE (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER NVARCHAR(50) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FSTATUS CHAR(1) DEFAULT 'C' 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,
FASSTACTTYPE CHAR(1) DEFAULT ' ' NOT NULL,
FDATATYPE CHAR(1) DEFAULT ' ' NOT NULL,
FVALUESOURCE NVARCHAR(50) DEFAULT ' ' NOT NULL,
FASSISTANTTYPE BIGINT DEFAULT 0 NOT NULL,
FDISPLAYPROPERTY CHAR(1) DEFAULT ' ' NOT NULL,
FISSYSTEM CHAR(1) DEFAULT '0' NOT NULL,
FFLEXFILED NVARCHAR(50) DEFAULT ' ' NOT NULL,
FINDEX INT DEFAULT 0 NOT NULL
);


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



/**End D:\PDM_UPGRADE\PDM1\kd_1.5.133_ai_asstacttype.sql **/
