/**Begin D:\PDMTOOLS\PDM_UPGRADE_1.3\PDM_UPGRADE\PDM1\TCTB_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCTB_REMIND_ASSIST') 
 CREATE TABLE T_TCTB_REMIND_ASSIST (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(30) DEFAULT ' ' NOT NULL,
FNAME VARCHAR(50) DEFAULT ' ' NOT NULL,
FSTATUS VARCHAR(50) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FENABLE VARCHAR(50) DEFAULT ' ' NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FGROUPID BIGINT DEFAULT 0 NOT NULL,
FDESC VARCHAR(200) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCTB_REMIND_ASSIST_DET') 
 CREATE TABLE T_TCTB_REMIND_ASSIST_DET (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FVALUE VARCHAR(50) DEFAULT ' ' NOT NULL,
FSUBSTATUS CHAR(1) DEFAULT '0' NOT NULL,
FDESCRIPTION VARCHAR(2000) DEFAULT ' ' NOT NULL,
FSUBNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL
);


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCTB_REMIND_BIZSYSROLE') 
 CREATE TABLE T_TCTB_REMIND_BIZSYSROLE (
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_TCTB_REMIND_CCUSER') 
 CREATE TABLE T_TCTB_REMIND_CCUSER (
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_TCTB_REMIND_COMMSYSROLE') 
 CREATE TABLE T_TCTB_REMIND_COMMSYSROLE (
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_TCTB_REMIND_ORG_RANGE') 
 CREATE TABLE T_TCTB_REMIND_ORG_RANGE (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCTB_REMIND_RULE') 
 CREATE TABLE T_TCTB_REMIND_RULE (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FBIZNAME VARCHAR(100) DEFAULT ' ' NOT NULL,
FTABLE BIGINT DEFAULT 0 NOT NULL,
FFILTERCONDITION NCLOB,
FFCONDITIONJSON NCLOB
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCTB_REMIND_TASK') 
 CREATE TABLE T_TCTB_REMIND_TASK (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(30) DEFAULT ' ' NOT NULL,
FNAME VARCHAR(200) DEFAULT ' ' NOT NULL,
FSTATUS VARCHAR(50) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FENABLE VARCHAR(50) DEFAULT ' ' NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FREMINDTYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FSUBSCRIBE BIGINT DEFAULT 0 NOT NULL,
FEXCEPLANDESC VARCHAR(1000) DEFAULT ' ' NOT NULL,
FROLETYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FPOSITION VARCHAR(50) DEFAULT ' ' NOT NULL,
FSHEDULEPLANID VARCHAR(50) DEFAULT ' ' NOT NULL,
FENDTIME DATETIME
);


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCTB_REMIND_TREE') 
 CREATE TABLE T_TCTB_REMIND_TREE (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(30) DEFAULT ' ' NOT NULL,
FNAME VARCHAR(50) DEFAULT ' ' NOT NULL,
FSTATUS VARCHAR(50) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FENABLE VARCHAR(50) DEFAULT ' ' NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FLONGNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FLEVEL BIGINT DEFAULT 0 NOT NULL,
FISLEAF CHAR(1) DEFAULT '0' NOT NULL,
FPARENTID BIGINT DEFAULT 0 NOT NULL
);


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



/**End D:\PDMTOOLS\PDM_UPGRADE_1.3\PDM_UPGRADE\PDM1\TCTB_table.sql **/
