--行控制，列控制页面
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
DROP TABLE IF EXISTS `meta_security_col`;
CREATE TABLE `meta_security_col`  (
  `colId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '问答id',
  `create_by` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '创建者',
  `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
  `update_by` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '更新者',
  `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
  `dbRName` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '数据源名称',
  `dbRID` int NULL DEFAULT NULL COMMENT '数据源ID',
  `dbSName` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '模式名称',
  `dbTName` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '表名称',
  `dbCName` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '字段名称',
  `ctrl_type` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '控制类型（0：反向 1：正向）',
  `obj_type` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '对象类型（0：角色 1：用户）',
  `obj_value` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '角色值',
  `isStop` tinyint(1) NULL DEFAULT NULL COMMENT '是否停用（0：运行 1：停用）',
  PRIMARY KEY (`colId`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;

SET FOREIGN_KEY_CHECKS = 1;
DROP TABLE IF EXISTS `meta_security_row`;
CREATE TABLE `meta_security_row`  (
  `rowId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '问答id',
  `create_by` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '创建者',
  `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
  `update_by` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '更新者',
  `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
  `dbRName` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '数据源名称',
  `dbRID` int NULL DEFAULT NULL COMMENT '数据源ID',
  `dbSName` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '模式名称',
  `dbTName` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '表名称',
  `dbCName` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '字段名称',
  `ctrl_type` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '控制类型（0：控制值 1：控制表 2：控制程序）',
  `obj_type` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '对象类型（0：角色 1：用户）',
  `obj_value` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '角色值',
  `isStop` tinyint(1) NULL DEFAULT NULL COMMENT '是否停用（0：运行 1：停用）',
  `ctrl_value` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '控制值',
  `ctrl_table` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '控制表',
  `ctrl_col` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '控制字段',
  `ctrl_system` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '控制程序',
  PRIMARY KEY (`rowId`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;

SET FOREIGN_KEY_CHECKS = 1;
--数据词典
INSERT INTO `sys_dict_data` (`dict_code`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (110, 0, '不可见', '0', 'metasecurity_ctr', NULL, 'danger', 'N', '0', 'admin', '2025-01-26 00:07:29', 'admin', '2025-02-03 13:40:02', NULL);
INSERT INTO `sys_dict_data` (`dict_code`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (111, 0, '可见', '1', 'metasecurity_ctr', NULL, 'primary', 'N', '0', 'admin', '2025-01-26 00:07:52', 'admin', '2025-02-03 13:40:23', NULL);
INSERT INTO `sys_dict_data` (`dict_code`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (112, 1, '用户', '0', 'metasecurity_obj', NULL, 'primary', 'N', '0', 'admin', '2025-01-26 00:48:48', 'admin', '2025-01-26 00:48:48', NULL);
INSERT INTO `sys_dict_data` (`dict_code`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (113, 1, '角色', '1', 'metasecurity_obj', NULL, 'warning', 'N', '0', 'admin', '2025-01-26 00:49:08', 'admin', '2025-01-26 00:49:08', NULL);
INSERT INTO `sys_dict_data` (`dict_code`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (114, 0, '固定值', '0', 'metasecurity_type', NULL, 'default', 'N', '0', 'admin', '2025-01-26 00:53:04', 'admin', '2025-01-26 00:53:04', NULL);
INSERT INTO `sys_dict_data` (`dict_code`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (115, 0, '表和字段', '1', 'metasecurity_type', NULL, 'default', 'N', '0', 'admin', '2025-01-26 00:53:12', 'admin', '2025-02-03 14:27:24', NULL);
INSERT INTO `sys_dict_data` (`dict_code`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (116, 0, '程序', '2', 'metasecurity_type', NULL, 'default', 'N', '0', 'admin', '2025-01-26 00:53:26', 'admin', '2025-02-03 14:27:32', NULL);
INSERT INTO `sys_dict_data` (`dict_code`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (117, 3, '应用', '2', 'metasecurity_obj', NULL, 'danger', 'N', '0', 'admin', '2025-02-03 14:25:37', 'admin', '2025-02-03 14:25:37', NULL);
INSERT INTO `sys_dict_type` (`dict_id`, `dict_name`, `dict_type`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (105, '控制方向', 'metasecurity_ctr', '0', 'admin', '2025-01-26 00:07:04', 'admin', '2025-01-26 01:19:54', NULL);
INSERT INTO `sys_dict_type` (`dict_id`, `dict_name`, `dict_type`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (106, '对象类型', 'metasecurity_obj', '0', 'admin', '2025-01-26 00:48:20', 'admin', '2025-01-26 00:48:20', NULL);
INSERT INTO `sys_dict_type` (`dict_id`, `dict_name`, `dict_type`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (107, '控制类型', 'metasecurity_type', '0', 'admin', '2025-01-26 00:52:24', 'admin', '2025-01-26 00:52:24', NULL);
--页面按钮
INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `route_name`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (2020, '删除', 2014, 4, '', '', '', '', 1, 0, 'F', '0', '0', 'meta:metaSecurityCol:remove', '#', 'admin', '2025-01-15 22:26:08', '', NULL, '');
INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `route_name`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (2019, '修改', 2014, 3, '', '', '', '', 1, 0, 'F', '0', '0', 'meta:metaSecurityCol:edit', '#', 'admin', '2025-01-15 22:26:08', '', NULL, '');
INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `route_name`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (2018, '新增', 2014, 2, '', '', '', '', 1, 0, 'F', '0', '0', 'meta:metaSecurityCol:add', '#', 'admin', '2025-01-15 22:26:07', '', NULL, '');
INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `route_name`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (2017, '删除', 2013, 4, '', '', '', '', 1, 0, 'F', '0', '0', 'meta:metaSecurityRow:remove', '#', 'admin', '2025-01-15 22:26:08', '', NULL, '');
INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `route_name`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (2016, '修改', 2013, 3, '', '', '', '', 1, 0, 'F', '0', '0', 'meta:metaSecurityRow:edit', '#', 'admin', '2025-01-15 22:26:08', '', NULL, '');
INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `route_name`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (2015, '新增', 2013, 2, '', '', '', '', 1, 0, 'F', '0', '0', 'meta:metaSecurityRow:add', '#', 'admin', '2025-01-15 22:26:07', '', NULL, '');
INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `route_name`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (2014, '列控制', 2012, 2, 'meta/metasercurity/MetaSecurityCol', 'meta/metasercurity/MetaSecurityCol', NULL, '', 1, 0, 'C', '0', '0', 'meta:metasecurity:col:list', 'list', 'admin', '2025-01-24 20:24:32', 'admin', '2025-01-25 13:14:34', '');
INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `route_name`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (2013, '行控制', 2012, 1, 'meta/metasercurity/MetaSecurityRow', 'meta/metasercurity/MetaSecurityRow', '', '', 1, 0, 'C', '0', '0', 'meta:metasecurity:row:list', 'list', 'admin', '2025-01-24 20:11:47', 'admin', '2025-01-25 13:14:42', '');
INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `route_name`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (2012, '数据安全', 0, 4, 'metasecurity', NULL, NULL, '', 1, 0, 'M', '0', '0', NULL, 'lock', 'admin', '2025-01-24 20:08:03', 'admin', '2025-01-24 20:08:03', '');
