/*
 Navicat Premium Data Transfer

 Source Server         : liwenyao
 Source Server Type    : MySQL
 Source Server Version : 80100
 Source Host           : localhost:3306
 Source Schema         : carrent

 Target Server Type    : MySQL
 Target Server Version : 80100
 File Encoding         : 65001

 Date: 02/01/2024 11:18:18
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for bus_car
-- ----------------------------
DROP TABLE IF EXISTS `bus_car`;
CREATE TABLE `bus_car`  (
  `number` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '车牌号',
  `brand` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '汽车品牌',
  `color` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '汽车颜色',
  `buy_price` double(10, 2) NULL DEFAULT NULL COMMENT '购买价格',
  `rent_price` double(10, 2) NULL DEFAULT NULL COMMENT '出租价格',
  `deposit` double(10, 2) NULL DEFAULT NULL COMMENT '押金',
  `status` tinyint(1) NULL DEFAULT NULL COMMENT '车辆状态；0:未出租，1:已出租',
  `description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '汽车描述',
  `image` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '汽车图片',
  `created` datetime NULL DEFAULT NULL COMMENT '录入时间',
  `operator` varchar(9) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '操作人',
  `exist` tinyint(1) NULL DEFAULT 1 COMMENT '是否存在；0：报废；1：能用',
  PRIMARY KEY (`number`) USING BTREE,
  INDEX `fk_car_user`(`operator` ASC) USING BTREE,
  CONSTRAINT `fk_car_user` FOREIGN KEY (`operator`) REFERENCES `sys_user` (`username`) ON DELETE SET NULL ON UPDATE SET NULL
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of bus_car
-- ----------------------------
INSERT INTO `bus_car` VALUES ('云EHBJYT', '吉利', '乌贼墨色', 496219.00, 994.00, 351.00, 0, 'If you wait, all that happens is you get older. Instead of wondering when your next vacation is, maybe you should set up a life you don’t need to escape from. Navicat Cloud provides                 ', NULL, '2021-01-26 09:45:59', 'admin', 1);
INSERT INTO `bus_car` VALUES ('京GZ1O8M', '阿尔法·罗密欧', '暗灰', 138941.00, 723.00, 239.00, 0, 'The Navigation pane employs tree structure which allows you to take action upon the database and their objects through their pop-up menus quickly and easily.', NULL, '2020-11-14 17:02:17', '小鸡', 1);
INSERT INTO `bus_car` VALUES ('京UHWMME', '哈弗', '橘色', 377672.00, 706.00, 113.00, 0, 'In a Telnet session, all communications, including username and password, are transmitted in plain-text, allowing anyone to listen-in on your session and steal passwords and other information.', NULL, '2021-12-31 20:22:49', '小鸡', 1);
INSERT INTO `bus_car` VALUES ('冀LT92OU', '阿尔法·罗密欧', '铜色', 760809.00, 630.00, 215.00, 0, 'If you wait, all that happens is you get older. Such sessions are also susceptible to session hijacking, where a malicious user takes over your session once you have authenticated.', NULL, '2023-01-09 07:05:49', '小鸡', 1);
INSERT INTO `bus_car` VALUES ('冀ODQBWL', '吉利', '昏灰', 22357.00, 961.00, 447.00, 0, 'The repository database can be an existing MySQL, MariaDB, PostgreSQL, SQL Server, or Amazon RDS instance.', NULL, '2022-07-11 16:17:16', '小鸡', 1);
INSERT INTO `bus_car` VALUES ('吉EAQRGM', '奥迪', '茉莉黄', 742424.00, 535.00, 484.00, 0, 'There is no way to happiness. Happiness is the way. Such sessions are also susceptible to session hijacking, where a malicious user takes over your session once you have authenticated.', NULL, '2020-07-16 22:12:33', 'admin', 1);
INSERT INTO `bus_car` VALUES ('吉K6IW10', '比亚迪', '橘色', 346451.00, 794.00, 173.00, 0, 'SQL Editor allows you to create and edit SQL text, prepare and execute selected queries. HTTP Tunneling is a method for connecting to a server that uses the same protocol (http://)                    ', NULL, '2021-03-05 18:56:13', 'admin', 1);
INSERT INTO `bus_car` VALUES ('宁CC4NSS', '哈弗', '咖啡色', 495139.00, 678.00, 474.00, 0, 'In a Telnet session, all communications, including username and password, are transmitted in plain-text, allowing anyone to listen-in on your session and steal passwords and other information.', NULL, '2023-05-20 12:26:39', 'admin', 1);
INSERT INTO `bus_car` VALUES ('宁YQK245', '五菱', '黄色', 232282.00, 682.00, 394.00, 0, 'To open a query using an external editor, control-click it and select Open with External Editor. You can set the file path of an external editor in Preferences.', NULL, '2021-08-10 13:11:36', '小鸡', 1);
INSERT INTO `bus_car` VALUES ('川A ABCDE', '大众', '白色', 66666.00, 666.00, 66.00, 1, 'np', '1704161930792.png', '2023-12-28 15:34:07', 'admin', 1);
INSERT INTO `bus_car` VALUES ('川MVHYSO', '丰田', '驼色', 132107.00, 722.00, 324.00, 0, 'After logged in the Navicat Cloud feature, the Navigation pane will be divided into Navicat Cloud and My Connections sections. Navicat Monitor is a safe, simple and agentless remote                   ', NULL, '2020-12-24 10:49:49', 'admin', 1);

-- ----------------------------
-- Table structure for bus_check
-- ----------------------------
DROP TABLE IF EXISTS `bus_check`;
CREATE TABLE `bus_check`  (
  `id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '检查单号',
  `check_date` datetime NULL DEFAULT NULL COMMENT '检查时间',
  `description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '描述',
  `problem` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '存在的问题',
  `compensate` double(8, 2) NULL DEFAULT NULL COMMENT '赔偿金额',
  `operator` varchar(9) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '操作人员',
  `rent_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '租车单号',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `fk_check_user`(`operator` ASC) USING BTREE,
  INDEX `fk_check_rent`(`rent_id` ASC) USING BTREE,
  CONSTRAINT `fk_check_rent` FOREIGN KEY (`rent_id`) REFERENCES `bus_rent` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_check_user` FOREIGN KEY (`operator`) REFERENCES `sys_user` (`username`) ON DELETE SET NULL ON UPDATE SET NULL
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of bus_check
-- ----------------------------
INSERT INTO `bus_check` VALUES ('JC_20240102_1704162547127_3508', '2024-01-02 10:29:07', '无', '无', 0.00, 'admin', 'CZ_20240102_1704162477832_7739');

-- ----------------------------
-- Table structure for bus_customer
-- ----------------------------
DROP TABLE IF EXISTS `bus_customer`;
CREATE TABLE `bus_customer`  (
  `identity` varchar(18) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '身份证号',
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '姓名',
  `gender` tinyint(1) NULL DEFAULT 0 COMMENT '性别',
  `address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '地址',
  `phone` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '电话',
  `career` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '职位',
  `created` datetime NULL DEFAULT NULL COMMENT '录入时间',
  `exist` tinyint(1) NULL DEFAULT 1 COMMENT '是否存在。1：存在；0:不存在',
  `operator` varchar(9) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '录入人员',
  PRIMARY KEY (`identity`) USING BTREE,
  INDEX `fk_customer_user`(`operator` ASC) USING BTREE,
  CONSTRAINT `fk_customer_user` FOREIGN KEY (`operator`) REFERENCES `sys_user` (`username`) ON DELETE SET NULL ON UPDATE SET NULL
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of bus_customer
-- ----------------------------
INSERT INTO `bus_customer` VALUES ('108787198111207413', '秦子异', 2, '黄浦区淮海中路365号', '14396493517', '私人教练', '2008-09-27 21:24:45', 2, 'admin');
INSERT INTO `bus_customer` VALUES ('119953181902105196', '贾杰宏', 1, '西城区复兴门内大街487号', '15631332418', '专案经理', '2000-01-27 09:10:54', 1, 'admin');
INSERT INTO `bus_customer` VALUES ('258226188208280154', '马致远', 1, '成华区玉双路6号164号', '16289706480', '兽医助理', '2012-08-14 12:09:49', 1, 'admin');
INSERT INTO `bus_customer` VALUES ('300571194211107822', '罗震南', 2, '天河区大信商圈大信南路269号', '16599695335', '移动应用程式开发人员', '2001-12-26 03:00:21', 2, 'admin');
INSERT INTO `bus_customer` VALUES ('339221184110206562', '陈震南', 1, '锦江区人民南路四段819号', '13581682771', '社交媒体协调员', '2020-09-28 12:43:20', 2, 'admin');
INSERT INTO `bus_customer` VALUES ('346945394304311953', '程子异', 1, '罗湖区清水河一路386号', '14615053663', '医生', '2021-11-17 04:54:14', 1, 'admin');
INSERT INTO `bus_customer` VALUES ('418436188812095433', '范岚', 2, '東城区東直門內大街556号', '14695387885', '水疗经理', '2022-06-09 08:36:35', 2, 'admin');
INSERT INTO `bus_customer` VALUES ('49451036650808972X', '许晓明', 2, '天河区天河路892号', '13998091957', '商务记者', '2016-02-22 16:22:58', 2, 'admin');
INSERT INTO `bus_customer` VALUES ('495231198111308127', '吴子韬', 1, '乐丰六路543号', '15912837535', '婚礼筹办者', '2003-05-28 08:08:24', 2, 'admin');
INSERT INTO `bus_customer` VALUES ('541689194010306813', '段子异', 1, '越秀区中山二路297号', '15431370461', '牙医', '2005-08-02 04:31:33', 1, 'admin');
INSERT INTO `bus_customer` VALUES ('756044187011206351', '梁子韬', 1, '福田区景田东一街242号', '14826931439', '纹身艺术家', '2001-03-18 09:24:56', 1, 'admin');
INSERT INTO `bus_customer` VALUES ('817448192206209752', '潘秀英', 2, '东泰五街748号', '14287152178', '理发师', '2012-06-06 23:36:32', 1, 'admin');
INSERT INTO `bus_customer` VALUES ('831627296107302440', '叶子韬', 1, '龙岗区学园一巷140号', '15173658605', '物流协调员', '2001-03-09 09:50:09', 1, 'admin');
INSERT INTO `bus_customer` VALUES ('851878193311102149', '杨安琪', 2, '浦东新区健祥路2号', '14258371214', '客戶協調員', '2013-10-03 19:38:52', 1, 'admin');
INSERT INTO `bus_customer` VALUES ('912814321611107025', '莫安琪', 1, '黄浦区淮海中路185号', '15108429935', '软件开发员', '2014-11-13 16:44:31', 1, 'admin');

-- ----------------------------
-- Table structure for bus_rent
-- ----------------------------
DROP TABLE IF EXISTS `bus_rent`;
CREATE TABLE `bus_rent`  (
  `id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '出租单号',
  `price` double(8, 2) NULL DEFAULT NULL COMMENT '实际出租价格',
  `begin_time` date NULL DEFAULT NULL COMMENT '开始时间',
  `return_time` date NULL DEFAULT NULL COMMENT '还车时间',
  `real_time` datetime NULL DEFAULT NULL COMMENT '实际还车时间',
  `rent_status` tinyint(1) NULL DEFAULT NULL COMMENT '出租状态：0：出租中；1：已归还',
  `customer_identity` varchar(18) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户身份证号',
  `car_number` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '汽车车牌',
  `operator` varchar(9) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '操作人员',
  `created` datetime NULL DEFAULT NULL COMMENT '录入时间',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `fk_rent_car`(`car_number` ASC) USING BTREE,
  INDEX `fk_rent_customer`(`customer_identity` ASC) USING BTREE,
  INDEX `fk_rent_user`(`operator` ASC) USING BTREE,
  CONSTRAINT `fk_rent_car` FOREIGN KEY (`car_number`) REFERENCES `bus_car` (`number`) ON DELETE SET NULL ON UPDATE SET NULL,
  CONSTRAINT `fk_rent_customer` FOREIGN KEY (`customer_identity`) REFERENCES `bus_customer` (`identity`) ON DELETE SET NULL ON UPDATE SET NULL,
  CONSTRAINT `fk_rent_user` FOREIGN KEY (`operator`) REFERENCES `sys_user` (`username`) ON DELETE SET NULL ON UPDATE SET NULL
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of bus_rent
-- ----------------------------
INSERT INTO `bus_rent` VALUES ('CZ_20240102_1704162477832_7739', 666.00, '2024-01-02', '2024-01-04', '2024-01-02 10:29:07', 1, '418436188812095433', '川A ABCDE', 'admin', '2024-01-02 10:27:58');
INSERT INTO `bus_rent` VALUES ('CZ_20240102_1704163560019_6817', 666.00, '2024-01-02', '2024-01-04', NULL, 0, '418436188812095433', '川A ABCDE', 'admin', '2024-01-02 10:46:00');

-- ----------------------------
-- Table structure for sys_announcement
-- ----------------------------
DROP TABLE IF EXISTS `sys_announcement`;
CREATE TABLE `sys_announcement`  (
  `id` int NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标题',
  `content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '内容',
  `created` datetime NULL DEFAULT NULL COMMENT '创建时间',
  `operator` varchar(9) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '操作人',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `fk_new_user`(`operator` ASC) USING BTREE,
  CONSTRAINT `fk_new_user` FOREIGN KEY (`operator`) REFERENCES `sys_user` (`username`) ON DELETE SET NULL ON UPDATE SET NULL
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of sys_announcement
-- ----------------------------
INSERT INTO `sys_announcement` VALUES (2, '第一篇公告启动！', '<p>内容为重复测试</p>', '2023-12-25 22:39:53', 'admin');
INSERT INTO `sys_announcement` VALUES (3, '第二篇公告！', '<p>12月26日上午，由成华区反恐怖工作领导小组主办，成华区委政法委、成华区公安分局、西南财经大学天府学院、中共成华区委西南财经大学天府学院校地联动国家安全教育办公室承办的2023年“全民反恐 共创平安”主题宣传教育活动在西财天府学院成都校区（东区）238报告厅开展。成华区公安分局副局长、区反恐办主任廖科，成华区公安分局政保大队大队长、区反恐办副主任王军，成华区委政法委陈佩玥和学校党委副书记管勇出席活动。活动参与学生200余人，覆盖学生1000余人。<br></p>', '2024-01-02 10:49:57', 'admin');

-- ----------------------------
-- Table structure for sys_user
-- ----------------------------
DROP TABLE IF EXISTS `sys_user`;
CREATE TABLE `sys_user`  (
  `username` varchar(9) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '用户名',
  `password` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '密码',
  `identity` varchar(18) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '身份证号',
  `name` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '真实姓名',
  `gender` tinyint(1) NULL DEFAULT NULL COMMENT '性别',
  `address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '家庭地址',
  `phone` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '电话',
  `position` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '职位',
  `type` tinyint(1) NULL DEFAULT NULL COMMENT '帐户类型：0：普通用户；1：管理员',
  PRIMARY KEY (`username`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of sys_user
-- ----------------------------
INSERT INTO `sys_user` VALUES ('admin', '$2a$10$/NvtR/RRWl1L2aSkw2BYEuVbTI1ZBVsnUXuEo81.IqjZuGBg9ZAsu', '100000000000000000', '李文耀', 1, '崇州市金带街上城花庭168号', '16608036828', '管理员', 1);
INSERT INTO `sys_user` VALUES ('小猫', '$2a$10$LInOVAtDX6lXaeEZv4UOR.pV72cQcR1nCe2WvnSDuYNA9APVSzzKu', '100000000000000003', '陈独秀', 1, '崇州市金带街上城花庭168号', '13608057687', '', 0);
INSERT INTO `sys_user` VALUES ('小鸡', '$2a$10$CpKluq4D/Fpq2xb3UzJlf.AHJpu/AOd8WaFiOSrbRCsyebk4UQSOq', '100000000000000002', '蔡徐坤', 1, 'daw', '15281119592', '', 0);

SET FOREIGN_KEY_CHECKS = 1;
