/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\BASE_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BD_BILLOPCONTROL') 
 CREATE TABLE T_BD_BILLOPCONTROL (
FID BIGINT DEFAULT 0 NOT NULL,
FENABLE CHAR(1) DEFAULT '1' NOT NULL,
FSTATUS VARCHAR(50) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FOBJECT NVARCHAR(100) DEFAULT ' ' NOT NULL,
FISPRESET CHAR(1) DEFAULT '0' NOT NULL,
FNUMBER NVARCHAR(80) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL
);


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BD_BILLOPCTROLENTITY') 
 CREATE TABLE T_BD_BILLOPCTROLENTITY (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FCONDITION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FCONDITIONJSON NVARCHAR(255) DEFAULT ' ' NOT NULL,
FCONDITIONJSON_TAG NCLOB,
FBILLOPERATION NVARCHAR(50) DEFAULT ' ' NOT NULL,
FMATACHNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FMATACHFILED NVARCHAR(255) DEFAULT ' ' NOT NULL,
FBASEDATATYPE NVARCHAR(100) DEFAULT ' ' NOT NULL,
FSTATUSFIELD NVARCHAR(100) DEFAULT ' ' NOT NULL,
FPRIORITY BIGINT DEFAULT 0 NOT NULL
);


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


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



/**End E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\BASE_table.sql **/
