/**Begin D:\PDM_UPGRADE\PDM1\BOS_table.sql **/

IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BD_AUTOASSIGN') 
 CREATE TABLE T_BD_AUTOASSIGN (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(36) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FENTITYID VARCHAR(36) DEFAULT ' ' NOT NULL,
FCTRLSTRATEGY VARCHAR(10) DEFAULT ' ' NOT NULL,
FEXECUTETIME DATETIME,
FAPPID VARCHAR(255) DEFAULT ' ' NOT NULL,
FENABLE CHAR(1) DEFAULT '1' NOT NULL,
FSTATUS VARCHAR(30) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FDISABLERID BIGINT DEFAULT 0 NOT NULL,
FDISABLEDATE DATETIME,
FMASTERID BIGINT DEFAULT 0 NOT NULL
);


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BD_AUTOASSIGN_ASSIGNORG') 
 CREATE TABLE T_BD_AUTOASSIGN_ASSIGNORG (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FASSIGNORGID BIGINT DEFAULT 0 NOT NULL,
FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL,
FFILTERCONDITION BIGINT DEFAULT 0 NOT NULL,
FISCONCLUDESUB CHAR(1) DEFAULT '0' NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL
);


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BD_FILTERCONDITION') 
 CREATE TABLE T_BD_FILTERCONDITION (
FID BIGINT DEFAULT 0 NOT NULL,
FENTITYID VARCHAR(36) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FFILTERCONDITION NCLOB DEFAULT ' ',
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME
);


/**End D:\PDM_UPGRADE\PDM1\BOS_table.sql **/
