-- -------------------------------------------------------------
-- TablePlus 6.0.1(551)
--
-- https://tableplus.com/
--
-- Database: silemei
-- Generation Time: 2024-05-05 15:13:58.8790
-- -------------------------------------------------------------


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

CREATE DATABASE `silemei`;


DROP TABLE IF EXISTS `helldevice`;
CREATE TABLE `helldevice` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(32) NOT NULL,
  `floor` int NOT NULL COMMENT '所在层数，1-18',
  `create_time` datetime NOT NULL,
  `status` int NOT NULL COMMENT '状态，0表示正常，1表示损坏',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb3;

DROP TABLE IF EXISTS `helllog`;
CREATE TABLE `helllog` (
  `id` int NOT NULL AUTO_INCREMENT,
  `uid` varchar(32) NOT NULL,
  `floor` int NOT NULL COMMENT '所在层数，1-18',
  `device` int NOT NULL COMMENT '受刑设备id',
  `time` varchar(100) NOT NULL,
  `reason` text NOT NULL,
  `create_time` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

DROP TABLE IF EXISTS `judgement`;
CREATE TABLE `judgement` (
  `id` int NOT NULL AUTO_INCREMENT,
  `uuid` varchar(32) NOT NULL,
  `lifebook_id` int NOT NULL COMMENT '生死簿id',
  `judge_id` int NOT NULL COMMENT '审判长id',
  `contact` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '标题',
  `phonenumber` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '记录',
  `create_time` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb3;

DROP TABLE IF EXISTS `lawyer`;
CREATE TABLE `lawyer` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(32) NOT NULL,
  `uuid` varchar(32) NOT NULL,
  `gender` int NOT NULL COMMENT '性别，0表示男，1表示女',
  `photo` varchar(255) DEFAULT NULL,
  `description` text NOT NULL COMMENT '描述',
  `create_time` datetime NOT NULL,
  `role` int NOT NULL COMMENT '角色',
  `status` int NOT NULL COMMENT '状态，0在职，1休息，2离职',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb3;

DROP TABLE IF EXISTS `lifebook`;
CREATE TABLE `lifebook` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(32) NOT NULL,
  `uuid` varchar(32) NOT NULL,
  `birthday` datetime NOT NULL COMMENT '出生日期',
  `gender` int NOT NULL COMMENT '性别，0表示男，1表示女',
  `birthplace` varchar(500) NOT NULL,
  `child` int NOT NULL DEFAULT '0',
  `marriage` text NOT NULL COMMENT '婚配情况描述',
  `event` text NOT NULL COMMENT '人生大事描述',
  `attribute` text NOT NULL COMMENT '人物属性描述',
  `description` text NOT NULL COMMENT '人生描述',
  `characterinfo` text NOT NULL COMMENT '人物描述',
  `reaperid` int DEFAULT NULL,
  `judgeid` int DEFAULT NULL,
  `punishmentid` int DEFAULT NULL,
  `reincarnationid` int DEFAULT NULL,
  `create_time` datetime NOT NULL,
  `testament` text,
  PRIMARY KEY (`id`),
  UNIQUE KEY `uuid` (`uuid`),
  UNIQUE KEY `id` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb3;

DROP TABLE IF EXISTS `module`;
CREATE TABLE `module` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(32) NOT NULL,
  `icon` varchar(255) DEFAULT NULL,
  `path` varchar(255) NOT NULL,
  `isparent` int NOT NULL COMMENT '是否为父模块，0表示否，1表示是',
  `parentid` int DEFAULT NULL COMMENT '父模块id',
  `create_time` datetime NOT NULL,
  `update_time` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=31 DEFAULT CHARSET=utf8mb3;

DROP TABLE IF EXISTS `reincarnationlog`;
CREATE TABLE `reincarnationlog` (
  `id` int NOT NULL AUTO_INCREMENT,
  `aid` varchar(32) NOT NULL,
  `uid` varchar(32) NOT NULL,
  `type` varchar(32) NOT NULL COMMENT '结果',
  `reason` text NOT NULL,
  `create_time` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

DROP TABLE IF EXISTS `remittance`;
CREATE TABLE `remittance` (
  `id` int NOT NULL AUTO_INCREMENT,
  `relationship` varchar(32) NOT NULL,
  `uid` varchar(32) NOT NULL,
  `money` int NOT NULL COMMENT '金额',
  `reason` text NOT NULL,
  `create_time` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

DROP TABLE IF EXISTS `role`;
CREATE TABLE `role` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(32) NOT NULL,
  `description` varchar(255) DEFAULT NULL,
  `module` varchar(255) NOT NULL COMMENT '模块id，使用逗号分隔,all表示所有模块',
  `create_time` datetime NOT NULL,
  `update_time` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb3;

DROP TABLE IF EXISTS `setting`;
CREATE TABLE `setting` (
  `id` int NOT NULL AUTO_INCREMENT,
  `key` varchar(32) NOT NULL,
  `value` varchar(32) NOT NULL,
  `create_time` datetime NOT NULL,
  `remark` varchar(255) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb3;

DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
  `id` int NOT NULL AUTO_INCREMENT,
  `username` varchar(32) NOT NULL,
  `password` varchar(32) NOT NULL,
  `nickname` varchar(255) NOT NULL,
  `create_time` datetime NOT NULL,
  `update_time` datetime NOT NULL,
  `role` int NOT NULL COMMENT '用户角色id',
  `status` int NOT NULL COMMENT '用户状态，0表示正常，1表示禁用',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb3;

INSERT INTO `helldevice` (`id`, `name`, `floor`, `create_time`, `status`) VALUES
(1, '去', 1, '2024-04-22 00:20:35', 0);

INSERT INTO `judgement` (`id`, `uuid`, `lifebook_id`, `judge_id`, `contact`, `phonenumber`, `create_time`) VALUES
(1, 'CT21CB504331D58AD9', 2, 1, '2', '22', '2024-05-05 14:42:13'),
(2, 'CT1929BBF312CDB3B1', 2, 1, 'Liu', '1388888888', '2024-05-05 14:49:06'),
(3, 'CTA8B8F16E11F16553', 3, 1, '22', '222', '2024-05-05 14:51:57');

INSERT INTO `lawyer` (`id`, `name`, `uuid`, `gender`, `photo`, `description`, `create_time`, `role`, `status`) VALUES
(1, '刘琪琪', 'ADA057166FFDFF16', 1, '/public/enchant/enchant-1714889498972.jpeg', '无', '2024-05-05 14:11:38', 2, 0),
(2, '授权管理员', '000000', 0, '/public/def/photo.jpeg', '安静\n', '2024-05-05 15:01:21', 4, 0);

INSERT INTO `lifebook` (`id`, `name`, `uuid`, `birthday`, `gender`, `birthplace`, `child`, `marriage`, `event`, `attribute`, `description`, `characterinfo`, `reaperid`, `judgeid`, `punishmentid`, `reincarnationid`, `create_time`, `testament`) VALUES
(2, '2', '29F3CFFCA0E495BB', '2024-04-02 00:00:00', 0, '2', 2, '2', '2', '2', '2', '2', NULL, NULL, NULL, NULL, '2024-04-22 00:05:50', '2'),
(3, '测试', '85ACD088DB569F60', '2024-05-05 14:51:36', 0, '2', 2, '2', '2', '2', '2', '2', NULL, NULL, NULL, NULL, '2024-05-05 14:51:40', '2');

INSERT INTO `module` (`id`, `name`, `icon`, `path`, `isparent`, `parentid`, `create_time`, `update_time`) VALUES
(1, '遗嘱管理', 'el-icon-s-order', '/testament', 1, 0, '2024-04-21 23:18:39', '2024-04-21 23:18:39'),
(2, '数据管理', '', '/testament/data', 0, 1, '2024-04-21 23:18:39', '2024-04-21 23:18:39'),
(3, '添加遗嘱', '', '/testament/dataAdd', 0, 1, '2024-04-21 23:18:39', '2024-04-21 23:18:39'),
(4, '律师管理', 'el-icon-s-finance', '/lawyer', 1, 0, '2024-04-21 23:18:39', '2024-04-21 23:18:39'),
(5, '律师管理', '', '/lawyer/lawyer', 0, 4, '2024-04-21 23:18:39', '2024-04-21 23:18:39'),
(7, '紧急联系人管理', 'el-icon-video-camera-solid', '/trial', 1, 0, '2024-04-21 23:18:39', '2024-04-21 23:18:39'),
(9, '紧急联系人记录', '', '/trial/data', 0, 7, '2024-04-21 23:18:39', '2024-04-21 23:18:39'),
(10, '添加紧急联系人', '', '/trial/add', 0, 7, '2024-04-21 23:18:39', '2024-04-21 23:18:39'),
(21, '角色权限', 'el-icon-menu', '/role', 1, 0, '2024-04-21 23:18:39', '2024-04-21 23:18:39'),
(22, '角色管理', '', '/role/role', 0, 21, '2024-04-21 23:18:39', '2024-04-21 23:18:39'),
(23, '权限设置', '', '/role/authority', 0, 21, '2024-04-21 23:18:39', '2024-04-21 23:18:39'),
(24, '管理员', 'el-icon-s-custom', '/admin', 1, 0, '2024-04-21 23:18:39', '2024-04-21 23:18:39'),
(25, '管理员管理', '', '/admin/admin', 0, 24, '2024-04-21 23:18:39', '2024-04-21 23:18:39'),
(26, '管理员添加', '', '/admin/add', 0, 24, '2024-04-21 23:18:39', '2024-04-21 23:18:39'),
(27, '系统设置', 'el-icon-s-tools', '/system', 1, 0, '2024-04-21 23:18:39', '2024-04-21 23:18:39'),
(28, '系统设置', '', '/system/system', 0, 27, '2024-04-21 23:18:39', '2024-04-21 23:18:39'),
(29, '信息修改', '', '/system/setInfo', 0, 27, '2024-04-21 23:18:39', '2024-04-21 23:18:39'),
(30, '添加律师', NULL, '/lawyer/addlawyer', 0, 4, '2024-04-21 23:18:39', '2024-04-21 23:18:39');

INSERT INTO `role` (`id`, `name`, `description`, `module`, `create_time`, `update_time`) VALUES
(1, '最高管理员', '拥有所有权限', 'all', '2024-04-21 23:18:38', '2024-04-21 23:18:38'),
(2, '律师管理员', '拥有律师相关权限', '4,5,6', '2024-04-21 23:18:38', '2024-04-21 23:18:38'),
(3, '联系人管理员', '拥有联系人管理相关权限', '1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,27,29', '2024-04-21 23:18:38', '2024-04-21 23:18:38'),
(4, '管理员', '普通管理员', '1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,27,28,29', '2024-04-21 23:18:38', '2024-04-21 23:18:38'),
(5, '授权管理员', '负责前台获取授权的账号，不要删除', '1,2,3,7,8,11,13,15,16,27,29', '2024-04-21 23:18:38', '2024-04-21 23:18:38'),
(6, '查看紧急联系人', '仅能查看联系人', '1,2,3,7,9,27,29', '2024-05-05 14:58:34', '2024-05-05 14:58:34');

INSERT INTO `setting` (`id`, `key`, `value`, `create_time`, `remark`) VALUES
(1, 'remittance', '1', '2024-05-05 14:55:20', '律师管理'),
(2, 'woodenfish', '1', '2024-04-21 23:18:39', '紧急联系人添加');

INSERT INTO `user` (`id`, `username`, `password`, `nickname`, `create_time`, `update_time`, `role`, `status`) VALUES
(1, 'admin', 'e50de14051afd6aacd8d1560f2f08579', '管理员', '2024-04-21 23:18:38', '2024-04-21 23:18:38', 1, 0),
(2, '000000', 'e50de14051afd6aacd8d1560f2f08579', '授权管理员', '2024-04-21 23:18:38', '2024-05-05 14:59:33', 2, 0);



/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;