| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- /*
- 测试模块数据库结构
-
- 业务域:测试和演示相关表
- 包含表:test_tree
-
- 说明:此模块用于系统测试和功能演示,包含树形结构测试数据
-
- 创建时间:2025-01-08
- 维护人员:项目开发团队
- */
- SET NAMES utf8mb4;
- SET FOREIGN_KEY_CHECKS = 0;
- -- ----------------------------
- -- Table structure for test_tree
- -- ----------------------------
- DROP TABLE IF EXISTS `test_tree`;
- CREATE TABLE `test_tree` (
- `id` bigint(20) NOT NULL COMMENT '主键ID',
- `tenant_id` varchar(20) NOT NULL DEFAULT '000000' COMMENT '租户编号',
- `parent_id` bigint(20) DEFAULT '0' COMMENT '父节点ID',
- `dept_id` bigint(20) DEFAULT NULL COMMENT '部门ID,关联sys_dept.dept_id',
- `user_id` bigint(20) DEFAULT NULL COMMENT '用户ID,关联sys_user.user_id',
- `tree_name` varchar(30) DEFAULT '' COMMENT '节点名称',
- `version` int(11) DEFAULT '0' COMMENT '版本号',
- `create_dept` bigint(20) DEFAULT NULL COMMENT '创建部门',
- `create_time` datetime DEFAULT NULL COMMENT '创建时间',
- `create_by` bigint(20) DEFAULT NULL COMMENT '创建者',
- `update_time` datetime DEFAULT NULL COMMENT '更新时间',
- `update_by` bigint(20) DEFAULT NULL COMMENT '更新者',
- `del_flag` char(1) DEFAULT '0' COMMENT '删除标志(0代表存在 1代表删除)',
- PRIMARY KEY (`id`),
- KEY `idx_tenant_id` (`tenant_id`),
- KEY `idx_parent_id` (`parent_id`),
- KEY `idx_dept_id` (`dept_id`),
- KEY `idx_user_id` (`user_id`),
- KEY `idx_del_flag` (`del_flag`),
- KEY `idx_create_time` (`create_time`)
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='测试树表';
- -- ----------------------------
- -- Records of test_tree
- -- ----------------------------
- BEGIN;
- INSERT INTO `test_tree` (`id`, `tenant_id`, `parent_id`, `dept_id`, `user_id`, `tree_name`, `version`, `create_dept`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`) VALUES (1, '000000', 0, 102, 4, '测试数据权限', 0, 103, '2025-06-20 16:22:26', 1, NULL, NULL, '0');
- INSERT INTO `test_tree` (`id`, `tenant_id`, `parent_id`, `dept_id`, `user_id`, `tree_name`, `version`, `create_dept`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`) VALUES (2, '000000', 1, 102, 3, '子节点1', 0, 103, '2025-06-20 16:22:26', 1, NULL, NULL, '0');
- INSERT INTO `test_tree` (`id`, `tenant_id`, `parent_id`, `dept_id`, `user_id`, `tree_name`, `version`, `create_dept`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`) VALUES (3, '000000', 2, 102, 3, '子节点2', 0, 103, '2025-06-20 16:22:26', 1, NULL, NULL, '0');
- INSERT INTO `test_tree` (`id`, `tenant_id`, `parent_id`, `dept_id`, `user_id`, `tree_name`, `version`, `create_dept`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`) VALUES (4, '000000', 0, 108, 4, '测试树1', 0, 103, '2025-06-20 16:22:26', 1, NULL, NULL, '0');
- INSERT INTO `test_tree` (`id`, `tenant_id`, `parent_id`, `dept_id`, `user_id`, `tree_name`, `version`, `create_dept`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`) VALUES (5, '000000', 4, 108, 3, '子节点11', 0, 103, '2025-06-20 16:22:26', 1, NULL, NULL, '0');
- INSERT INTO `test_tree` (`id`, `tenant_id`, `parent_id`, `dept_id`, `user_id`, `tree_name`, `version`, `create_dept`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`) VALUES (6, '000000', 4, 108, 3, '子节点22', 0, 103, '2025-06-20 16:22:26', 1, NULL, NULL, '0');
- INSERT INTO `test_tree` (`id`, `tenant_id`, `parent_id`, `dept_id`, `user_id`, `tree_name`, `version`, `create_dept`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`) VALUES (7, '000000', 4, 108, 3, '子节点33', 0, 103, '2025-06-20 16:22:26', 1, NULL, NULL, '0');
- INSERT INTO `test_tree` (`id`, `tenant_id`, `parent_id`, `dept_id`, `user_id`, `tree_name`, `version`, `create_dept`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`) VALUES (8, '000000', 5, 108, 3, '子节点44', 0, 103, '2025-06-20 16:22:26', 1, NULL, NULL, '0');
- INSERT INTO `test_tree` (`id`, `tenant_id`, `parent_id`, `dept_id`, `user_id`, `tree_name`, `version`, `create_dept`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`) VALUES (9, '000000', 6, 108, 3, '子节点55', 0, 103, '2025-06-20 16:22:26', 1, NULL, NULL, '0');
- INSERT INTO `test_tree` (`id`, `tenant_id`, `parent_id`, `dept_id`, `user_id`, `tree_name`, `version`, `create_dept`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`) VALUES (10, '000000', 7, 108, 3, '子节点66', 0, 103, '2025-06-20 16:22:26', 1, NULL, NULL, '0');
- INSERT INTO `test_tree` (`id`, `tenant_id`, `parent_id`, `dept_id`, `user_id`, `tree_name`, `version`, `create_dept`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`) VALUES (11, '000000', 7, 108, 3, '子节点77', 0, 103, '2025-06-20 16:22:26', 1, NULL, NULL, '0');
- INSERT INTO `test_tree` (`id`, `tenant_id`, `parent_id`, `dept_id`, `user_id`, `tree_name`, `version`, `create_dept`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`) VALUES (12, '000000', 10, 108, 3, '子节点88', 0, 103, '2025-06-20 16:22:26', 1, NULL, NULL, '0');
- INSERT INTO `test_tree` (`id`, `tenant_id`, `parent_id`, `dept_id`, `user_id`, `tree_name`, `version`, `create_dept`, `create_time`, `create_by`, `update_time`, `update_by`, `del_flag`) VALUES (13, '000000', 10, 108, 3, '子节点99', 0, 103, '2025-06-20 16:22:26', 1, NULL, NULL, '0');
- COMMIT;
- SET FOREIGN_KEY_CHECKS = 1;
|