/*
 Navicat Premium Dump SQL

 Source Server         : piadmin
 Source Server Type    : MySQL
 Source Server Version : 50737 (5.7.37-log)
 Source Host           : 47.100.187.221:3306
 Source Schema         : pi_admin_db

 Target Server Type    : MySQL
 Target Server Version : 50737 (5.7.37-log)
 File Encoding         : 65001

 Date: 20/10/2025 16:58:57
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for pi_attachment
-- ----------------------------
DROP TABLE IF EXISTS `pi_attachment`;
CREATE TABLE `pi_attachment`  (
                                  `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
                                  `storage` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '1' COMMENT '附件引擎 1本地 2七牛 3腾讯 4阿里',
                                  `type` int(11) NOT NULL DEFAULT 0 COMMENT '0 所有 1 压缩包 2 图片 3 视频 4 文件 5 音频',
                                  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '文件名',
                                  `path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '文件路径',
                                  `suffix` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '文件后缀',
                                  `original_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '文件原名',
                                  `size` float NOT NULL DEFAULT 0 COMMENT '文件大小',
                                  `creator_id` bigint(20) NOT NULL DEFAULT 0 COMMENT '创建者ID',
                                  `created_at` timestamp NULL DEFAULT NULL,
                                  `updated_at` timestamp NULL DEFAULT NULL,
                                  `deleted_at` timestamp NULL DEFAULT NULL,
                                  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '附件表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of pi_attachment
-- ----------------------------

-- ----------------------------
-- Table structure for pi_system_admin
-- ----------------------------
DROP TABLE IF EXISTS `pi_system_admin`;
CREATE TABLE `pi_system_admin`  (
                                    `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '系统自增id',
                                    `name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '名称',
                                    `account` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '登录账号',
                                    `status` tinyint(2) NOT NULL DEFAULT 1 COMMENT '状态',
                                    `sort` int(11) NOT NULL DEFAULT 1000 COMMENT '排序字段',
                                    `dept_id` bigint(20) NOT NULL COMMENT '归属部门id',
                                    `email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '邮箱',
                                    `phone` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '手机号',
                                    `gender` tinyint(2) NOT NULL DEFAULT 1 COMMENT '性别',
                                    `avatar_url` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '头像',
                                    `password` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '密码',
                                    `description` varchar(900) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '用户自定义的描述信息',
                                    `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注',
                                    `is_super_admin` tinyint(2) NOT NULL DEFAULT 2 COMMENT '是否为超级管理员',
                                    `last_login_time` int(11) NOT NULL DEFAULT 0 COMMENT '最近登录时间',
                                    `last_login_ip` varchar(90) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '最近登录ip',
                                    `last_login_addr` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '最近登录地点',
                                    `create_time` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间',
                                    `update_time` int(11) NOT NULL DEFAULT 0 COMMENT '更新时间',
                                    `delete_time` int(11) NOT NULL DEFAULT 0 COMMENT '删除时间;为0是未删除数据',
                                    `create_by` char(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '创建人id',
                                    `update_by` char(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '更新人id',
                                    PRIMARY KEY (`id`) USING BTREE,
                                    UNIQUE INDEX `unique_id`(`id`) USING BTREE COMMENT '系统自增主键索引'
) ENGINE = InnoDB AUTO_INCREMENT = 8 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of pi_system_admin
-- ----------------------------
INSERT INTO `pi_system_admin` VALUES (1, 'supderAdmin', 'supderAdmin@piadmin.com', 1, 1000, 0, 'supderAdmin@piadmin.com', '18888888888', 1, '', '$argon2i$v=19$m=65536,t=4,p=1$OGZHelVxd2cuUTBIMVlWUQ$CjibjWH2IAza6tXcsgQ9699P9QMOYt9d0ANtIOJz/7I', '超级管理员', NULL, 1, 1754013865, '127.0.0.1', '', 1753930543, 1754013865, 0, '', '');
INSERT INTO `pi_system_admin` VALUES (6, '张三', 'zhangsan@piadmin.com', 1, 1000, 2, 'zhangsan@piadmin.com', '15500000001', 3, '', '$argon2i$v=19$m=65536,t=4,p=1$SFhKSjlrVG43aWx2LkJwRg$YQWIHt0/VmQTixacJT4ya7xyzkM+UvNWPvLQygQ6WyI', '', NULL, 2, 0, '', '', 1756451869, 1756451869, 0, '1', '1');
INSERT INTO `pi_system_admin` VALUES (7, '测试管理员', 'admin', 1, 1000, 3, 'zhangf@suq.cn', '17606161011', 1, '', '$argon2i$v=19$m=65536,t=4,p=1$SEFWOVZoNjEyL2ViTEd6Yw$R8l6cogbj7IbHKAYwzTbLtwXz9NCN+GLCBEUBAzN3iY', '', NULL, 2, 0, '', '', 1760937653, 1760937653, 0, '', '');

-- ----------------------------
-- Table structure for pi_system_admin_dept
-- ----------------------------
DROP TABLE IF EXISTS `pi_system_admin_dept`;
CREATE TABLE `pi_system_admin_dept`  (
                                         `id` bigint(20) NOT NULL AUTO_INCREMENT,
                                         `admin_id` bigint(20) NOT NULL COMMENT '后台用户id',
                                         `dept_id` bigint(20) NOT NULL COMMENT '部门id',
                                         PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '后台用户与部门关联表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of pi_system_admin_dept
-- ----------------------------
INSERT INTO `pi_system_admin_dept` VALUES (4, 6, 2);

-- ----------------------------
-- Table structure for pi_system_admin_role
-- ----------------------------
DROP TABLE IF EXISTS `pi_system_admin_role`;
CREATE TABLE `pi_system_admin_role`  (
                                         `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
                                         `admin_id` bigint(20) NOT NULL COMMENT '管理员',
                                         `role_id` bigint(20) NOT NULL COMMENT '角色',
                                         PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 7 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '管理员角色关联表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of pi_system_admin_role
-- ----------------------------
INSERT INTO `pi_system_admin_role` VALUES (5, 6, 4);
INSERT INTO `pi_system_admin_role` VALUES (6, 1, 1);

-- ----------------------------
-- Table structure for pi_system_dept
-- ----------------------------
DROP TABLE IF EXISTS `pi_system_dept`;
CREATE TABLE `pi_system_dept`  (
                                   `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id',
                                   `uuid` char(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '业务id',
                                   `pid` bigint(32) NOT NULL COMMENT '上级id',
                                   `id_path` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'id路径',
                                   `name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '部门名称',
                                   `sort` int(11) NOT NULL DEFAULT 1000 COMMENT '排序字段',
                                   `leader` bigint(20) NOT NULL DEFAULT 0 COMMENT '负责人id',
                                   `phone` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '联系电话',
                                   `email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '联系邮箱',
                                   `status` tinyint(2) NOT NULL DEFAULT 1 COMMENT '状态',
                                   `create_time` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间',
                                   `update_time` int(11) NOT NULL DEFAULT 0 COMMENT '更新时间',
                                   `delete_time` int(11) NOT NULL DEFAULT 0 COMMENT '删除时间;为0是未删除数据',
                                   `create_by` char(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '创建人id',
                                   `update_by` char(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '更新人id',
                                   PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '部门表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of pi_system_dept
-- ----------------------------
INSERT INTO `pi_system_dept` VALUES (1, '0198f02e03e57037acad7541d1ca4f11', 0, '0,0198f02e03e57037acad7541d1ca4f11', '数字旗帜', 1000, 0, '', '', 1, 1756376204, 1756376204, 0, '1', '1');
INSERT INTO `pi_system_dept` VALUES (2, '0198f02e2c24708ca22a31bf0fb284db', 1, '0,0198f02e03e57037acad7541d1ca4f11,0198f02e2c24708ca22a31bf0fb284db', '前端组', 1000, 0, '', '', 1, 1756376214, 1756376214, 0, '1', '1');
INSERT INTO `pi_system_dept` VALUES (3, '0198f02e50db7346bca3dab08500e5a1', 1, '0,0198f02e03e57037acad7541d1ca4f11,0198f02e50db7346bca3dab08500e5a1', '后端组', 1000, 0, '', '', 1, 1756376224, 1756376224, 0, '1', '1');
INSERT INTO `pi_system_dept` VALUES (4, '0198f02e674572e2a114bd750328afc8', 1, '0,0198f02e03e57037acad7541d1ca4f11,0198f02e674572e2a114bd750328afc8', '信息组', 1000, 0, '', '', 1, 1756376229, 1756376229, 0, '1', '1');

-- ----------------------------
-- Table structure for pi_system_menu
-- ----------------------------
DROP TABLE IF EXISTS `pi_system_menu`;
CREATE TABLE `pi_system_menu`  (
                                   `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '系统自增id',
                                   `uuid` char(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'uuid',
                                   `pid` char(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '0' COMMENT '父id',
                                   `id_path` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '组级集合 由uuid构成',
                                   `name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '菜单名称',
                                   `code` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '菜单标识代码',
                                   `icon` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '菜单图标',
                                   `route` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '路由地址',
                                   `component` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '组件路径',
                                   `redirect` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '跳转地址',
                                   `is_hidden` smallint(6) UNSIGNED NOT NULL DEFAULT 2 COMMENT '是否隐藏 (1是 2否)',
                                   `is_layout` tinyint(1) UNSIGNED NOT NULL DEFAULT 2 COMMENT '继承layout',
                                   `type` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '菜单类型, (M菜单 B按钮 L链接 I iframe)',
                                   `status` smallint(6) NOT NULL DEFAULT 1 COMMENT '状态 (1正常 2停用)',
                                   `sort` smallint(5) UNSIGNED NOT NULL DEFAULT 1000 COMMENT '排序',
                                   `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '备注',
                                   `create_by` char(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '创建人id',
                                   `update_by` char(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '更新人id',
                                   `create_time` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间',
                                   `update_time` int(11) NOT NULL DEFAULT 0 COMMENT '更新时间',
                                   `delete_time` int(11) NOT NULL DEFAULT 0 COMMENT '删除时间;为0是未删除数据',
                                   PRIMARY KEY (`id`) USING BTREE,
                                   UNIQUE INDEX `unique_id`(`id`) USING BTREE COMMENT '系统自增主键索引'
) ENGINE = InnoDB AUTO_INCREMENT = 22 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '菜单信息表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of pi_system_menu
-- ----------------------------
INSERT INTO `pi_system_menu` VALUES (15, '0198ee6f82d1731e9d651cb016f227ba', '0', '0,0198ee6f82d1731e9d651cb016f227ba', '控制台', 'dashboard', 'dashboard', 'dashboard', 'dashboard', '', 2, 2, 'M', 1, 1000, '控制台', '1', '1', 1756346942, 1756346942, 0);
INSERT INTO `pi_system_menu` VALUES (16, '0198ee718b4d72bfa9eb79ede4e2f921', '0', '0,0198ee718b4d72bfa9eb79ede4e2f921', '系统管理', 'system', 'system', 'system', 'system', '', 2, 2, 'M', 1, 1100, '系统管理', '1', '1', 1756347075, 1756347075, 0);
INSERT INTO `pi_system_menu` VALUES (17, '0198ee7230e2706b9de0bc2475a8d4b9', '16', '0,0198ee718b4d72bfa9eb79ede4e2f921,0198ee7230e2706b9de0bc2475a8d4b9', '用户管理', 'admin', 'admin', 'admin', 'admin', '', 2, 2, 'M', 1, 1100, '用户管理', '1', '1', 1756347117, 1756347117, 0);
INSERT INTO `pi_system_menu` VALUES (18, '0198ee729341712fa8d7caf14431c3ce', '16', '0,0198ee718b4d72bfa9eb79ede4e2f921,0198ee729341712fa8d7caf14431c3ce', '角色管理', 'role', 'role', 'role', 'role', '', 2, 2, 'M', 1, 1200, '角色管理', '1', '1', 1756347143, 1756347143, 0);
INSERT INTO `pi_system_menu` VALUES (19, '0198ee72fe1a719f8b20733b73d7c6e9', '16', '0,0198ee718b4d72bfa9eb79ede4e2f921,0198ee72fe1a719f8b20733b73d7c6e9', '菜单管理', 'menu', 'menu', 'menu', 'menu', '', 2, 2, 'M', 1, 1300, '菜单管理', '1', '1', 1756347170, 1756347170, 0);
INSERT INTO `pi_system_menu` VALUES (20, '0198ee741a2073fa924eaa010ea64651', '16', '0,0198ee718b4d72bfa9eb79ede4e2f921,0198ee741a2073fa924eaa010ea64651', '部门管理', 'dept', 'dept', 'dept', 'dept', '', 2, 2, 'M', 1, 1400, '部门管理', '1', '1', 1756347243, 1756347243, 0);
INSERT INTO `pi_system_menu` VALUES (21, '0198ee74740d700abc07b71a25e05cf8', '16', '0,0198ee718b4d72bfa9eb79ede4e2f921,0198ee74740d700abc07b71a25e05cf8', '字典管理', 'dict', 'dict', 'dict', 'dict', '', 2, 2, 'M', 1, 1500, '字典管理', '1', '1', 1756347266, 1756347266, 0);

-- ----------------------------
-- Table structure for pi_system_role
-- ----------------------------
DROP TABLE IF EXISTS `pi_system_role`;
CREATE TABLE `pi_system_role`  (
                                   `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
                                   `name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '角色名称',
                                   `code` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '角色标识符',
                                   `sort` int(11) NOT NULL DEFAULT 1000 COMMENT '排序字段',
                                   `is_system` tinyint(2) NOT NULL DEFAULT 2 COMMENT '是否为系统角色',
                                   `is_super_admin` tinyint(2) NOT NULL DEFAULT 2 COMMENT '是否为超级管理员',
                                   `status` tinyint(2) NOT NULL DEFAULT 1 COMMENT '状态',
                                   `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '备注',
                                   `create_by` char(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
                                   `update_by` char(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
                                   `create_time` int(10) UNSIGNED NOT NULL DEFAULT 0,
                                   `update_time` int(10) UNSIGNED NOT NULL DEFAULT 0,
                                   `delete_time` int(10) UNSIGNED NOT NULL DEFAULT 0,
                                   UNIQUE INDEX `uk_id`(`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '角色表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of pi_system_role
-- ----------------------------
INSERT INTO `pi_system_role` VALUES (1, '超级管理员', 'supder_admin', 1000, 1, 1, 1, '超级管理员', '', '', 1753926896, 1753926896, 0);
INSERT INTO `pi_system_role` VALUES (4, '普通角色', 'normal', 1000, 2, 2, 1, '这是一个普通角色', '1', '1', 1756352452, 1756352452, 0);

-- ----------------------------
-- Table structure for pi_system_role_menu
-- ----------------------------
DROP TABLE IF EXISTS `pi_system_role_menu`;
CREATE TABLE `pi_system_role_menu`  (
                                        `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
                                        `role_id` bigint(20) NOT NULL COMMENT '角色id',
                                        `menu_id` bigint(20) NOT NULL COMMENT '菜单id',
                                        PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '角色菜单关联表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of pi_system_role_menu
-- ----------------------------
INSERT INTO `pi_system_role_menu` VALUES (4, 4, 15);

SET FOREIGN_KEY_CHECKS = 1;
