
-- ----------------------------
-- Table structure for sys_manager_dept
-- ----------------------------
DROP TABLE IF EXISTS `sys_manager_dept`;
CREATE TABLE `sys_manager_dept`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `manager_id` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '角色ID',
  `dept_id` bigint(20) NULL DEFAULT NULL COMMENT '部门ID',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 34598 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '角色与部门对应关系' ROW_FORMAT = DYNAMIC;



-- ----------------------------
-- Table structure for sys_manager_info
-- ----------------------------
DROP TABLE IF EXISTS `sys_manager_info`;
CREATE TABLE `sys_manager_info`  (
  `manager_id` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `manager_name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '管理组名称',
  `remark` varchar(300) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注',
  `create_time` datetime(0) NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '创建时间',
  `create_user_id` bigint(100) NULL DEFAULT NULL COMMENT '创建人id',
  `update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
  `update_user_id` bigint(100) NULL DEFAULT NULL COMMENT '更新人id',
  INDEX `idx_manager_id`(`manager_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '管理员角色表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of sys_manager_info
-- ----------------------------
INSERT INTO `sys_manager_info` VALUES ('1', 'admin', 'admin', NULL, NULL, NULL, NULL);


-- ----------------------------
-- Table structure for sys_manager_menu
-- ----------------------------
DROP TABLE IF EXISTS `sys_manager_menu`;
CREATE TABLE `sys_manager_menu`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `manager_id` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '角色ID',
  `menu_id` bigint(20) NULL DEFAULT NULL COMMENT '菜单ID',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `manager_id_idx`(`manager_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 238071 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '角色与菜单对应关系' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for sys_manager_role
-- ----------------------------
DROP TABLE IF EXISTS `sys_manager_role`;
CREATE TABLE `sys_manager_role`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `manager_id` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '管理组ID',
  `role_id` bigint(20) NULL DEFAULT NULL COMMENT '角色ID',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `p_manager_id`(`manager_id`) USING BTREE,
  INDEX `p_role_id`(`role_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 7629 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '管理与角色对应关系' ROW_FORMAT = DYNAMIC;


-- ----------------------------
-- Table structure for sys_manager_user
-- ----------------------------
DROP TABLE IF EXISTS `sys_manager_user`;
CREATE TABLE `sys_manager_user`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `manager_id` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '管理组ID',
  `user_id` bigint(20) NULL DEFAULT NULL COMMENT '菜单ID',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 225906 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '角色与菜单对应关系' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of sys_manager_user
-- ----------------------------

SET FOREIGN_KEY_CHECKS = 1;




ALTER TABLE `sys_user` 
ADD COLUMN `manager_id` varchar(100) NULL COMMENT '创建人所属管理组ID' AFTER `obv_password`;


update sys_user set manager_id ='1' where user_id =1;

ALTER TABLE `sys_role` 
ADD COLUMN `manager_id` varchar(100) NULL COMMENT '创建人所属管理组' AFTER `p_user_id`;


update `itax_base`.sys_role set manager_id ='1' ;



ALTER TABLE `itax_base`.`sys_log` ADD COLUMN `operation_method` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL AFTER `month`;

ALTER TABLE `itax_base`.`sys_log` ADD COLUMN `request_parameter` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL AFTER `operation_method`;

ALTER TABLE `itax_base`.`sys_log` ADD COLUMN `return_parameter` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL AFTER `request_parameter`;