/* 用户与管理员组关系表 */
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PERM_USERADMINGROUP')
 CREATE TABLE T_PERM_USERADMINGROUP (
FID BIGINT DEFAULT 0 NOT NULL,
FUSERID BIGINT DEFAULT 0 NOT NULL,
FADMINGROUPID BIGINT DEFAULT 0 NOT NULL
);

/* 管理员组表 */
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PERM_ADMINGROUP')
 CREATE TABLE T_PERM_ADMINGROUP (
FID BIGINT DEFAULT 0 NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FNUMBER NVARCHAR(80) DEFAULT ' ' NOT NULL,
FLEVEL INT DEFAULT 0 NOT NULL,
FLONGNUMBER NVARCHAR(255) DEFAULT ' ' NOT NULL,
FISLEAF CHAR(1) DEFAULT '1' NOT NULL,
FPARENTID BIGINT DEFAULT 0 NOT NULL,
FENABLE CHAR(1) DEFAULT '1' NOT NULL,
FSTATUS NVARCHAR(50) 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,
FNAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FFULLNAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FADMINSCHEME BIGINT DEFAULT 0 NOT NULL,
FADMINTYPE BIGINT DEFAULT 0 NOT NULL,
FOLDADMINID VARCHAR(18) DEFAULT ' ' NOT NULL
);

/* 管理员组多语言表 */
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PERM_ADMINGROUP_L')
 CREATE TABLE T_PERM_ADMINGROUP_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,
FFULLNAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL
);