IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_MSPLAN_ADJUSTSUG_ENTITY') 
 CREATE TABLE T_MSPLAN_ADJUSTSUG_ENTITY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FBILLTYPE NVARCHAR(36) DEFAULT ' ' NOT NULL,
FCHANGEBILL NVARCHAR(36) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_MSPLAN_ADJUSTSUG_REL') 
 CREATE TABLE T_MSPLAN_ADJUSTSUG_REL (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER NVARCHAR(30) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(80) DEFAULT ' ' NOT NULL,
FSTATUS NVARCHAR(30) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FENABLE NVARCHAR(30) DEFAULT ' ' NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FRELEASEPLUGIN BIGINT DEFAULT 0 NOT NULL,
FSYSTEMPRESET CHAR(1) DEFAULT '0' NOT NULL,
FRELCONFIGBASEDATA NVARCHAR(36) DEFAULT ' ' NOT NULL
);


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_MSPLAN_ADJUSTSUG_SUBEN') 
 CREATE TABLE T_MSPLAN_ADJUSTSUG_SUBEN (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FDETAILID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FADJUSTSUGFIELDNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FADJUSTSUGFIELDSIGN NVARCHAR(50) DEFAULT ' ' NOT NULL,
FCHANGEBILLFIELDNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FCHANGEBILLFIELDSIGN NVARCHAR(50) DEFAULT ' ' NOT NULL
);
