-- ----------------------------
-- Table structure for sys_action_log
-- ----------------------------
DROP TABLE IF EXISTS `sys_action_log`;
CREATE TABLE `sys_action_log` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `type` varchar(3) NOT NULL,
  `module` varchar(2) NOT NULL,
  `user_id` varchar(20) DEFAULT NULL,
  `login_ip` varchar(20) DEFAULT NULL,
  `time` datetime NOT NULL,
  `context` varchar(200) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2687 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for sys_config
-- ----------------------------
DROP TABLE IF EXISTS `sys_config`;
CREATE TABLE `sys_config` (
  `cfg_key` varchar(32) NOT NULL COMMENT '配置唯一键',
  `cfg_name` varchar(32) NOT NULL COMMENT '配置名称',
  `cfg_value` varchar(64) NOT NULL COMMENT '配置值',
  `cfg_type` varchar(32) NOT NULL COMMENT '配置类型TEXT,DATA,NUMBER(]',
  `cfg_desc` varchar(128) DEFAULT NULL COMMENT '配置描述',
  `cfg_status` varchar(1) NOT NULL COMMENT '配置状态A：active,I:inactive',
  `update_time` datetime DEFAULT NULL COMMENT '最近一次修改时间',
  `update_user` varchar(32) DEFAULT NULL COMMENT '最近一次修改用户',
  PRIMARY KEY (`cfg_key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for sys_dictionary
-- ----------------------------
DROP TABLE IF EXISTS `sys_dictionary`;
CREATE TABLE `sys_dictionary` (
  `dict_id` int(11) NOT NULL AUTO_INCREMENT,
  `dict_code` varchar(32) CHARACTER SET utf8 NOT NULL,
  `dict_name` varchar(32) CHARACTER SET utf8 NOT NULL,
  `dict_desc` varchar(64) CHARACTER SET utf8 DEFAULT NULL,
  `dict_parent` varchar(255) CHARACTER SET utf8 DEFAULT NULL,
  `dict_status` varchar(1) CHARACTER SET utf8 NOT NULL,
  PRIMARY KEY (`dict_id`)
) ENGINE=InnoDB AUTO_INCREMENT=398 DEFAULT CHARSET=ascii;

-- ----------------------------
-- Table structure for sys_dict_type
-- ----------------------------
DROP TABLE IF EXISTS `sys_dict_type`;
CREATE TABLE `sys_dict_type` (
  `type_code` varchar(32) CHARACTER SET utf8 NOT NULL,
  `type_name` varchar(32) CHARACTER SET utf8 NOT NULL,
  `type_desc` varchar(64) CHARACTER SET utf8 DEFAULT NULL,
  `type_status` varchar(1) CHARACTER SET utf8 NOT NULL,
  PRIMARY KEY (`type_code`)
) ENGINE=InnoDB DEFAULT CHARSET=ascii;

-- ----------------------------
-- Table structure for um_permission_full
-- ----------------------------
DROP TABLE IF EXISTS `um_permission_full`;
CREATE TABLE `um_permission_full` (
  `per_code` varchar(100) NOT NULL COMMENT '权限编号',
  `per_name` varchar(100) NOT NULL COMMENT '权限名称',
  `per_desc` varchar(100) DEFAULT NULL COMMENT '权限描述',
  `per_parent` varchar(100) DEFAULT NULL COMMENT '父权限',
  `per_level` varchar(10) NOT NULL COMMENT '权限等级',
  `per_content` varchar(100) DEFAULT NULL COMMENT '权限内容',
  `per_status` varchar(1) NOT NULL COMMENT '是否启用',
  `per_order` int(2) DEFAULT NULL,
  PRIMARY KEY (`per_code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='权限信息表';

-- ----------------------------
-- Table structure for um_role_full
-- ----------------------------
DROP TABLE IF EXISTS `um_role_full`;
CREATE TABLE `um_role_full` (
  `role_code` varchar(50) NOT NULL COMMENT '角色编号',
  `role_name` varchar(20) NOT NULL COMMENT '角色名称',
  `role_desc` varchar(100) NOT NULL COMMENT '角色描述',
  `role_status` varchar(1) NOT NULL,
  PRIMARY KEY (`role_code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='角色信息表';

-- ----------------------------
-- Table structure for um_role_permission
-- ----------------------------
DROP TABLE IF EXISTS `um_role_permission`;
CREATE TABLE `um_role_permission` (
  `role_code` varchar(50) NOT NULL COMMENT '角色编号',
  `per_code` varchar(100) NOT NULL COMMENT '权限编号',
  PRIMARY KEY (`role_code`,`per_code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='角色权限表';

-- ----------------------------
-- Table structure for um_user
-- ----------------------------
DROP TABLE IF EXISTS `um_user`;
CREATE TABLE `um_user` (
  `user_id` varchar(32) NOT NULL COMMENT '用户名',
  `key` varchar(64) NOT NULL COMMENT '密码',
  `name` varchar(10) NOT NULL COMMENT '姓名',
  `phone` varchar(11) NOT NULL COMMENT '电话',
  `id_card` varchar(18) DEFAULT NULL COMMENT '身份证号码',
  `email` varchar(32) DEFAULT NULL COMMENT '电子邮箱',
  `last_login` datetime DEFAULT NULL COMMENT '上次登陆时间',
  `status` varchar(1) NOT NULL COMMENT '状态',
  PRIMARY KEY (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for um_user_role
-- ----------------------------
DROP TABLE IF EXISTS `um_user_role`;
CREATE TABLE `um_user_role` (
  `user_id` varchar(50) NOT NULL COMMENT '用户编号',
  `role_code` varchar(50) NOT NULL COMMENT '角色编号',
  PRIMARY KEY (`user_id`,`role_code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户角色表';
