/**Begin D:\PDM_UPGRADE\PDM1\BRM_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BRM_SCENE_HIS_L') 
 CREATE TABLE T_BRM_SCENE_HIS_L (
FPKID VARCHAR(18) 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_BRM_SCENE_L') 
 CREATE TABLE T_BRM_SCENE_L (
FPKID VARCHAR(18) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FSIMPLENAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BRM_SCENEINPUT_HIS_L') 
 CREATE TABLE T_BRM_SCENEINPUT_HIS_L (
FPKID VARCHAR(18) 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_BRM_SCENEINPUT_L') 
 CREATE TABLE T_BRM_SCENEINPUT_L (
FPKID VARCHAR(18) DEFAULT ' ' NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FSIMPLENAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BRM_SCENEOUTPUT_HIS_L') 
 CREATE TABLE T_BRM_SCENEOUTPUT_HIS_L (
FPKID VARCHAR(18) 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_BRM_SCENEOUTPUT_L') 
 CREATE TABLE T_BRM_SCENEOUTPUT_L (
FPKID VARCHAR(18) DEFAULT ' ' NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FSIMPLENAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BRM_TARGET_HIS') 
 CREATE TABLE T_BRM_TARGET_HIS (
FID BIGINT DEFAULT 0 NOT NULL,
FTARGETID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FOPERATE VARCHAR(10) DEFAULT ' ' NOT NULL,
FOPERATETIME DATETIME,
FOPERATORID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BRM_TARGETREF') 
 CREATE TABLE T_BRM_TARGETREF (
FID BIGINT DEFAULT 0 NOT NULL,
FTARGETID BIGINT DEFAULT 0 NOT NULL,
FDESIGNRULEID BIGINT DEFAULT 0 NOT NULL,
FPOLICYID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BRM_SCENE_HIS') 
 CREATE TABLE T_BRM_SCENE_HIS (
FID BIGINT DEFAULT 0 NOT NULL,
FSCENEID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FOPERATE VARCHAR(20) DEFAULT ' ' NOT NULL,
FOPERATETIME DATETIME,
FOPERATORID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BRM_SCENEINPUT_HIS') 
 CREATE TABLE T_BRM_SCENEINPUT_HIS (
FID BIGINT DEFAULT 0 NOT NULL,
FSCENEID BIGINT DEFAULT 0 NOT NULL,
FSCENENUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FSCENEINPUTID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FOPERATE VARCHAR(20) DEFAULT ' ' NOT NULL,
FOPERATETIME DATETIME,
FOPERATORID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BRM_SCENEOUTPUT_HIS') 
 CREATE TABLE T_BRM_SCENEOUTPUT_HIS (
FID BIGINT DEFAULT 0 NOT NULL,
FSCENEID BIGINT DEFAULT 0 NOT NULL,
FSCENENUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FSCENEOUTPUTID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FOPERATE VARCHAR(20) DEFAULT ' ' NOT NULL,
FOPERATETIME DATETIME,
FOPERATORID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BRM_POLICY_HIS') 
 CREATE TABLE T_BRM_POLICY_HIS (
FID BIGINT DEFAULT 0 NOT NULL,
FPOLICYID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FOPERATE VARCHAR(20) DEFAULT ' ' NOT NULL,
FOPERATETIME DATETIME,
FOPERATORID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BRM_POLICY_HIS_L') 
 CREATE TABLE T_BRM_POLICY_HIS_L (
FPKID VARCHAR(18) 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_BRM_RULE_HIS') 
 CREATE TABLE T_BRM_RULE_HIS (
FID BIGINT DEFAULT 0 NOT NULL,
FPOLICYID BIGINT DEFAULT 0 NOT NULL,
FPOLICYNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FRULEID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FOPERATE VARCHAR(20) DEFAULT ' ' NOT NULL,
FOPERATETIME DATETIME,
FOPERATORID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BRM_RULE_HIS_L') 
 CREATE TABLE T_BRM_RULE_HIS_L (
FPKID VARCHAR(18) 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_BRM_SCENE') 
 CREATE TABLE T_BRM_SCENE (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FBIZAPPID VARCHAR(18) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FSIMPLENAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FENABLE VARCHAR(2) DEFAULT '1' NOT NULL,
FSTATUS VARCHAR(2) DEFAULT 'C' NOT NULL,
FDISABLERID BIGINT DEFAULT 0 NOT NULL,
FDISABLEDATE DATETIME,
FINDEX INT DEFAULT 0 NOT NULL,
FISSYSPRESET CHAR(1) DEFAULT '0' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BRM_POLICYSCOPE') 
 CREATE TABLE T_BRM_POLICYSCOPE (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FENTITYBUID BIGINT DEFAULT 0 NOT NULL,
FCONTAINSSUB VARCHAR(1) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BRM_DRLFILTER') 
 CREATE TABLE T_BRM_DRLFILTER (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FCONDITIONS NCLOB,
FRESULTS NCLOB,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FRULEORDER BIGINT DEFAULT 0 NOT NULL,
FBIZAPPID VARCHAR(18) DEFAULT ' ' NOT NULL,
FSCENEID BIGINT DEFAULT 0 NOT NULL,
FTEMPLATENUMBER VARCHAR(100) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FENABLE VARCHAR(2) DEFAULT '1' NOT NULL,
FSTATUS VARCHAR(2) DEFAULT 'C' 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_BRM_SCENEINPUT') 
 CREATE TABLE T_BRM_SCENEINPUT (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(100) DEFAULT ' ' NOT NULL,
FPARAMSTYPE VARCHAR(20) DEFAULT ' ' NOT NULL,
FPARAMSOBJECT VARCHAR(100) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FENABLE VARCHAR(2) DEFAULT '1' NOT NULL,
FSTATUS VARCHAR(2) DEFAULT 'C' NOT NULL,
FDISABLERID BIGINT DEFAULT 0 NOT NULL,
FDISABLEDATE DATETIME,
FINDEX INT DEFAULT 0 NOT NULL,
FISSYSPRESET CHAR(1) DEFAULT '0' NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FSIMPLENAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BRM_SCENEOUTPUT') 
 CREATE TABLE T_BRM_SCENEOUTPUT (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(100) DEFAULT ' ' NOT NULL,
FPARAMSTYPE VARCHAR(20) DEFAULT ' ' NOT NULL,
FPARAMSOBJECT VARCHAR(100) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FENABLE VARCHAR(2) DEFAULT '1' NOT NULL,
FSTATUS VARCHAR(2) DEFAULT 'C' NOT NULL,
FDISABLERID BIGINT DEFAULT 0 NOT NULL,
FDISABLEDATE DATETIME,
FINDEX INT DEFAULT 0 NOT NULL,
FISSYSPRESET CHAR(1) DEFAULT '0' NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FSIMPLENAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BRM_POLICY') 
 CREATE TABLE T_BRM_POLICY (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FPOLICYMODE VARCHAR(20) DEFAULT ' ' NOT NULL,
FBIZAPPID VARCHAR(18) DEFAULT ' ' NOT NULL,
FPOLICYTYPE VARCHAR(20) DEFAULT ' ' NOT NULL,
FSCENEID BIGINT DEFAULT 0 NOT NULL,
FRETRUNDEFAULT CHAR(1) DEFAULT ' ' NOT NULL,
FRESULTS NCLOB,
FENABLELIST CHAR(1) DEFAULT ' ' NOT NULL,
FSTATUS VARCHAR(50) DEFAULT 'C' NOT NULL,
FCREATEBUID BIGINT DEFAULT 0 NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FENABLE VARCHAR(2) DEFAULT '1' NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FDISABLERID BIGINT DEFAULT 0 NOT NULL,
FDISABLEDATE DATETIME,
FINDEX INT DEFAULT 0 NOT NULL,
FISSYSPRESET CHAR(1) DEFAULT '0' NOT NULL,
FSIMPLENAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FROSTERCONDITION NCLOB,
FROSTERRESULT NCLOB
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BRM_TARGET') 
 CREATE TABLE T_BRM_TARGET (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FBUID BIGINT DEFAULT 0 NOT NULL,
FBIZAPPID VARCHAR(18) DEFAULT ' ' NOT NULL,
FSCENEID BIGINT DEFAULT 0 NOT NULL,
FTEMPLATENUMBER NVARCHAR(100) DEFAULT ' ' NOT NULL,
FRESULTS NCLOB,
FELSES NCLOB,
FRETURNTYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FRETURNPARAMFIELD VARCHAR(100) DEFAULT ' ' NOT NULL,
FTARGETTYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FDISPLAYFUNCTEXT NCLOB,
FAPPLICATIONSCOPE VARCHAR(20) DEFAULT ' ' NOT NULL,
FCONDITIONS NCLOB,
FSTATUS VARCHAR(2) DEFAULT 'C' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FENABLE VARCHAR(2) DEFAULT '1' NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FDISABLERID BIGINT DEFAULT 0 NOT NULL,
FDISABLEDATE DATETIME,
FINDEX BIGINT DEFAULT 0 NOT NULL,
FISSYSPRESET CHAR(1) DEFAULT '0' NOT NULL,
FSIMPLENAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL
);


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


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


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


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BRM_DRLRULE') 
 CREATE TABLE T_BRM_DRLRULE (
FID BIGINT DEFAULT 0 NOT NULL,
FKBASEKEY NVARCHAR(200) DEFAULT ' ' NOT NULL,
FBIZAPP VARCHAR(50) DEFAULT ' ' NOT NULL,
FSCENE VARCHAR(50) DEFAULT ' ' NOT NULL,
FRULEORDER INT DEFAULT 0 NOT NULL,
FRULENAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FPACKAGENAME VARCHAR(200) DEFAULT ' ' NOT NULL,
FTENANTID VARCHAR(100) DEFAULT ' ' NOT NULL,
FRULEDESIGNID BIGINT DEFAULT 0 NOT NULL,
FRULECONTENT NCLOB,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BRM_DRLKBASE') 
 CREATE TABLE T_BRM_DRLKBASE (
FID BIGINT DEFAULT 0 NOT NULL,
FKBASENAME VARCHAR(150) DEFAULT ' ' NOT NULL,
FKSESSIONNAME VARCHAR(150) DEFAULT ' ' NOT NULL,
FPACKAGENAME VARCHAR(200) DEFAULT ' ' NOT NULL,
FTENANTID VARCHAR(100) DEFAULT ' ' NOT NULL,
FKBASENUM INT DEFAULT 0 NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FKBASEKEY VARCHAR(200) DEFAULT ' ' NOT NULL
);


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BRM_SPECIAL_LIST') 
 CREATE TABLE T_BRM_SPECIAL_LIST (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FSTATUS VARCHAR(2) DEFAULT 'C' NOT NULL,
FENABLE VARCHAR(2) DEFAULT '1' 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,
FISSYSPRESET CHAR(1) DEFAULT '0' NOT NULL,
FSIMPLENAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FINDEX INT DEFAULT 0 NOT NULL,
FBUID BIGINT DEFAULT 0 NOT NULL,
FLISTTYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FLISTCATEGORY VARCHAR(50) DEFAULT ' ' NOT NULL,
FLISTNABLE VARCHAR(2) DEFAULT '1' NOT NULL,
FAPPLICATIONSCOPE VARCHAR(50) DEFAULT ' ' NOT NULL
);


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


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BRM_LIST_STRING') 
 CREATE TABLE T_BRM_LIST_STRING (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FINDEX INT DEFAULT 0 NOT NULL,
FLISTSTRINGNAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FSTRINGDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BRM_LIST_ORG') 
 CREATE TABLE T_BRM_LIST_ORG (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FINDEX INT DEFAULT 0 NOT NULL,
FENTITYORGID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BRM_LIST_PERSON') 
 CREATE TABLE T_BRM_LIST_PERSON (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FINDEX INT DEFAULT 0 NOT NULL,
FENTITYPERSONID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BRM_POLICY_TMP') 
 CREATE TABLE T_BRM_POLICY_TMP (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FPOLICYMODE VARCHAR(20) DEFAULT ' ' NOT NULL,
FBIZAPPID VARCHAR(18) DEFAULT ' ' NOT NULL,
FPOLICYTYPE VARCHAR(20) DEFAULT ' ' NOT NULL,
FSCENEID BIGINT DEFAULT 0 NOT NULL,
FRETRUNDEFAULT CHAR(1) DEFAULT ' ' NOT NULL,
FRESULTS NCLOB,
FENABLELIST CHAR(1) DEFAULT ' ' NOT NULL,
FCREATEBUID BIGINT DEFAULT 0 NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FENABLE VARCHAR(2) DEFAULT '1' NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FSIMPLENAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FROSTERCONDITION NCLOB,
FROSTERRESULT NCLOB,
FLOGID BIGINT DEFAULT 0 NOT NULL,
FBATCHNUMBER INT DEFAULT 0 NOT NULL,
FOPERATOR BIGINT DEFAULT 0 NOT NULL,
FOPERATETIME DATETIME
);


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BRM_POLICYSCOPE_TMP') 
 CREATE TABLE T_BRM_POLICYSCOPE_TMP (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FENTITYBUID BIGINT DEFAULT 0 NOT NULL,
FCONTAINSSUB VARCHAR(1) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BRM_RULE_TMP') 
 CREATE TABLE T_BRM_RULE_TMP (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FCONDITIONS NCLOB,
FRESULTS NCLOB,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FRULEORDER BIGINT DEFAULT 0 NOT NULL,
FBIZAPPID VARCHAR(18) DEFAULT ' ' NOT NULL,
FSCENEID BIGINT DEFAULT 0 NOT NULL,
FTEMPLATENUMBER VARCHAR(100) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FENABLE VARCHAR(2) DEFAULT '1' NOT NULL
);


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BRM_SCENEPARAM_TMP') 
 CREATE TABLE T_BRM_SCENEPARAM_TMP (
FID BIGINT DEFAULT 0 NOT NULL,
FSCENE BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FPARAMSTYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FPARAMSOBJECT BIGINT DEFAULT 0 NOT NULL,
FINOROUT VARCHAR(50) DEFAULT ' ' NOT NULL,
FLOGID BIGINT DEFAULT 0 NOT NULL,
FBATCHNUMBER INT DEFAULT 0 NOT NULL,
FOPERATOR BIGINT DEFAULT 0 NOT NULL,
FOPERATETIME DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BRM_SCENEPARAM_TMP_L') 
 CREATE TABLE T_BRM_SCENEPARAM_TMP_L (
FPKID VARCHAR(18) 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_BRM_TARGET_TMP') 
 CREATE TABLE T_BRM_TARGET_TMP (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FBUID BIGINT DEFAULT 0 NOT NULL,
FBIZAPPID VARCHAR(18) DEFAULT ' ' NOT NULL,
FSCENEID BIGINT DEFAULT 0 NOT NULL,
FTEMPLATENUMBER NVARCHAR(50) DEFAULT ' ' NOT NULL,
FRESULTS NCLOB,
FELSES NCLOB,
FRETURNTYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FRETURNPARAMFIELD VARCHAR(50) DEFAULT ' ' NOT NULL,
FTARGETTYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FDISPLAYFUNCTEXT NCLOB,
FAPPLICATIONSCOPE VARCHAR(20) DEFAULT ' ' NOT NULL,
FCONDITIONS NCLOB,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FENABLE VARCHAR(2) DEFAULT '1' NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FSIMPLENAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FLOGID BIGINT DEFAULT 0 NOT NULL,
FBATCHNUMBER INT DEFAULT 0 NOT NULL,
FOPERATOR BIGINT DEFAULT 0 NOT NULL,
FOPERATETIME DATETIME
);


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BRM_DECISIONTABLE') 
 CREATE TABLE T_BRM_DECISIONTABLE (
FID BIGINT DEFAULT 0 NOT NULL,
FPOLICYID BIGINT DEFAULT 0 NOT NULL,
FTABLEHEAD NCLOB,
FTABLEBODY NCLOB
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BRM_DECISIONTABTMP') 
 CREATE TABLE T_BRM_DECISIONTABTMP (
FID BIGINT DEFAULT 0 NOT NULL,
FPOLICYNUM VARCHAR(50) DEFAULT ' ' NOT NULL,
FTABLEBODY NCLOB,
FTABLEHEAD NCLOB,
FLOGID BIGINT DEFAULT 0 NOT NULL,
FBATCHNUMBER INT DEFAULT 0 NOT NULL,
FOPERATOR BIGINT DEFAULT 0 NOT NULL,
FOPERATETIME DATETIME
);



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