/**Begin D:\DBA\1.4\PDM_UPGRADE\PDM1\BCM_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BCM_TASKTEMPLATE') 
 CREATE TABLE T_BCM_TASKTEMPLATE (
FID BIGINT DEFAULT 0 NOT NULL,
FMODELID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(200) DEFAULT ' ' NOT NULL,
FTYPE CHAR(1) DEFAULT '1' NOT NULL,
FDISDIMENSIONENTITY VARCHAR(50) DEFAULT ' ' NOT NULL,
FREMARK NVARCHAR(250) DEFAULT ' ' NOT NULL,
FENABLE CHAR(1) DEFAULT '0' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FENABLEUSERID BIGINT DEFAULT 0 NOT NULL,
FENABLETIME DATETIME,
FCOMEFROMID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BCM_TASKTEMPLATE_L') 
 CREATE TABLE T_BCM_TASKTEMPLATE_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,
FREMARK NVARCHAR(250) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BCM_TASKTPLFILTERDIM') 
 CREATE TABLE T_BCM_TASKTPLFILTERDIM (
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_BCM_TASKTPLDISDIMENSION') 
 CREATE TABLE T_BCM_TASKTPLDISDIMENSION (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FDISDIMENSIONID BIGINT DEFAULT 0 NOT NULL,
FMEMBERID BIGINT DEFAULT 0 NOT NULL,
FPROPERTYVALUE BIGINT DEFAULT 0 NOT NULL,
FRANGE INT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BCM_TASKTPLSCENE') 
 CREATE TABLE T_BCM_TASKTPLSCENE (
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_BCM_TASKTPLACTENTRY') 
 CREATE TABLE T_BCM_TASKTPLACTENTRY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FACTIVITYID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BCM_TASKTPLACTIVITY') 
 CREATE TABLE T_BCM_TASKTPLACTIVITY (
FID BIGINT DEFAULT 0 NOT NULL,
FTASKTEMPLATEID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(200) DEFAULT ' ' NOT NULL,
FTYPE VARCHAR(2) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(250) DEFAULT ' ' NOT NULL,
FISAPPLYDETAIL CHAR(1) DEFAULT '0' NOT NULL,
FISAPPLYMERGE CHAR(1) DEFAULT '0' NOT NULL,
FISDEPENDLAST CHAR(1) DEFAULT '0' NOT NULL,
FRELEVANTOP VARCHAR(2) DEFAULT '0' NOT NULL,
FISNOTICE CHAR(1) DEFAULT '0' NOT NULL,
FNOTICEDISMODE CHAR(1) DEFAULT '0' NOT NULL,
FMESSAGECHANNEL VARCHAR(10) DEFAULT ' ' NOT NULL,
FNOTICECONTENT NVARCHAR(300) DEFAULT ' ' NOT NULL,
FPARAMLOCK VARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BCM_TASKTPLACTIVITY_L') 
 CREATE TABLE T_BCM_TASKTPLACTIVITY_L (
FPKID VARCHAR(36) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(200) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(250) DEFAULT ' ' NOT NULL,
FNOTICECONTENT NVARCHAR(300) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BCM_TASKTPLACTMSG') 
 CREATE TABLE T_BCM_TASKTPLACTMSG (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FUSERTYPE BIGINT DEFAULT 0 NOT NULL,
FUSERID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BCM_TASKTPLACTTEMPLATE') 
 CREATE TABLE T_BCM_TASKTPLACTTEMPLATE (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FTEMPLATENUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FTEMPLATEID BIGINT DEFAULT 0 NOT NULL,
FISCYCLETABLE CHAR(1) DEFAULT '0' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BCM_TASKRECORD') 
 CREATE TABLE T_BCM_TASKRECORD (
FID BIGINT DEFAULT 0 NOT NULL,
FMODELID BIGINT DEFAULT 0 NOT NULL,
FTASKTPLID BIGINT DEFAULT 0 NOT NULL,
FSTATUS CHAR(1) DEFAULT '0' NOT NULL,
FISDELETE CHAR(1) DEFAULT '0' NOT NULL,
FSTARTMODE CHAR(1) DEFAULT '1' NOT NULL,
FISFORCECLOSE CHAR(1) DEFAULT '0' NOT NULL,
FBEGINTIME DATETIME,
FENDTIME DATETIME,
FISNOTICE CHAR(1) DEFAULT '0' NOT NULL,
FMESSAGECHANNEL VARCHAR(10) DEFAULT ' ' NOT NULL,
FNOTICECONTENT NVARCHAR(300) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FSCHEDULEID VARCHAR(36) DEFAULT ' ' NOT NULL,
FTOTALNUM INT DEFAULT 0 NOT NULL,
FFINISHNUM INT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BCM_TASKRECORDFILTERMEM') 
 CREATE TABLE T_BCM_TASKRECORDFILTERMEM (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FDIMENSIONID BIGINT DEFAULT 0 NOT NULL,
FMEMBERID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BCM_TASKRECORDTEMPL') 
 CREATE TABLE T_BCM_TASKRECORDTEMPL (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FACTIVITYID BIGINT DEFAULT 0 NOT NULL,
FTEMPLATEID BIGINT DEFAULT 0 NOT NULL,
FISCYCLETABLE CHAR(1) DEFAULT '0' NOT NULL
);


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BCM_USERTASK') 
 CREATE TABLE T_BCM_USERTASK (
FID BIGINT DEFAULT 0 NOT NULL,
FTASKRECORDID BIGINT DEFAULT 0 NOT NULL,
FDIMENSIONID BIGINT DEFAULT 0 NOT NULL,
FDIMENSIONTYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FMEMBERID BIGINT DEFAULT 0 NOT NULL,
FACTIVITYID BIGINT DEFAULT 0 NOT NULL,
FSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FTOTALNUM INT DEFAULT 0 NOT NULL,
FFINISHNUM INT DEFAULT 0 NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BCM_USERTASKINFO') 
 CREATE TABLE T_BCM_USERTASKINFO (
FID BIGINT DEFAULT 0 NOT NULL,
FUSERTASKID BIGINT DEFAULT 0 NOT NULL,
FACTIVITYID BIGINT DEFAULT 0 NOT NULL,
FSTATUS CHAR(1) DEFAULT '0' NOT NULL,
FEXECUTESEQ INT DEFAULT 0 NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME
);



/**End D:\DBA\1.4\PDM_UPGRADE\PDM1\BCM_table.sql **/
