🍔一、项目介绍
🍕1.1、项目简介
本项目是一个汽车门店的一个系统,为了更好的进行商户门店运营,以及维护新老客户的信息,广州狼途汽车服务公司决定实施汽车门店管理系统。但市面上出售的系统价格昂贵,笨重,所以经过市场调研研究,单独对该公司,做一个轻量级的互联网门店运营系统。最终会部署在阿里云真实的服务器上,贴近企业。
🍟1.2、所用的技术
🌭1.2.1、后端
后端所使用的技术栈主要为:SSM+MySQL+Shiro+RBAC,前期我们不适用Shiro,我们先手写权限的注解,体会一下Shiro的运行机制,知其然知其所以然。后端我们还会涉及到的技术是阿里的短信服务、邮箱服务的使用等等。
🍿1.2.2、前端
由于这个项目并不是前后端分离的项目,所以前端使用的是模板引擎—Freemarker,这个是目前企业中最主流用的模板引擎,还会搭配一些常见的前端插件,比如Bootstrap、sweetalert。
🧂1.3、适合人群
如果难度为满分为10的话,这个项目的难度仅为4,没有任何复杂的业务逻辑,适合刚刚学完SSM框架的小伙伴来进行巩固,熟悉企业开发的常见套路,同时熟悉写代码的流程,为后面进一步学习框架打铺垫,同时也适合拿去做一些期末的课程设计也是很不错的。
本项目会从0开始搭建,包括数据库的建表,到最终真实阿里云服务器上线。需要有SSM基础、MySQL基础、Linux的基础,相信在看的小伙伴已经是基础扎实了。
🍳1.4、项目功能
注册、登录、员工管理、部门管理、权限管理、员工导入导出等功能。
🧇1.5、项目展示
🥞二、数据库的搭建
🧈2.1、前言
肯定会有很多的小伙伴要问了,建表又不是我做的事情,我还要了解这个吗?没错,建表确实不是你刚刚工作出去以后的事情,因为这些是项目经理或者是架构师帮你们设计好的,但是你甘心十年二十年都只是做一个底层的板砖码农吗?很多人的回答肯定是不甘心,往上走不仅仅你的薪资会加,眼界和敲代码的水平也会噌噌噌得往上走,对于架构师或者是项目经理来说,建表时百分之一百会遇到的,一个项目不可能没有数据库,既然有了数据库,那么表是一定会有的,我们到底应该如何建表是最优的呢?建表有哪些需要避开的坑,下面由我来一一揭晓。
🍞2.2、建表的那些事儿
建表其实也没有那么难,我们想想,建表的目的是什么?那必然是展示数据和封装数据,我们展示的数据在哪呢?在前台对吧,所以这就引出来了我们建表中第一条也是最重要的一条原则:以前台展示的数据为主。
比如我们项目展示章节的最后张图所展示的数据,是不是又编号、用户名、真实姓名、邮箱、年龄、部门等信息,那么我们肯定需要设计这些字段(部门另外讲),我们设计这些字段的目的就是将我们前台需要展示的数据保存在数据库中进行存储,方便我们的展示和封装。
刚刚我说到部门这一块是单独拎出来说的,没错这个部门,你有没有发现这里涉及到一个连表查询,员工关联着部门,那么我们需要把部门的所有信息都放在这一张表里面吗?答案是否定的,我们只需要在一张表存储主键,另外一张表才存储所有的信息。
大概也就这些啦,还没有涉及到的等用到了再讲。
🧀2.3、具体的建表语句
/* Navicat Premium Data Transfer Source Server : localhost Source Server Type : MySQL Source Server Version : 50717 Source Host : localhost:3306 Source Schema : ssm_carbusiness Target Server Type : MySQL Target Server Version : 50717 File Encoding : 65001 Date: 11/04/2021 11:27:56 */ SET NAMES utf8mb4; SET FOREIGN_KEY_CHECKS = 0; -- ---------------------------- -- Table structure for activity -- ---------------------------- DROP TABLE IF EXISTS `activity`; CREATE TABLE `activity` ( `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', `title` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '主题', `type` int(5) NULL DEFAULT NULL COMMENT '类型(单选0/多选1/ 等等)', `status` bit(1) NULL DEFAULT NULL COMMENT '状态(1投票中/0停止投票)', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '投票活动表' ROW_FORMAT = DYNAMIC; -- ---------------------------- -- Records of activity -- ---------------------------- INSERT INTO `activity` VALUES (1, '关于2020年度部门旅游活动投票', 0, b'1'); INSERT INTO `activity` VALUES (2, '2020年12月食堂满意度调查', 0, b'0'); -- ---------------------------- -- Table structure for activity_item -- ---------------------------- DROP TABLE IF EXISTS `activity_item`; CREATE TABLE `activity_item` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `content` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '内容', `num` int(11) NULL DEFAULT NULL COMMENT '投票数', `activity_id` bigint(20) NULL DEFAULT NULL COMMENT '所属活动', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 9 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '投票选项表' ROW_FORMAT = DYNAMIC; -- ---------------------------- -- Records of activity_item -- ---------------------------- INSERT INTO `activity_item` VALUES (1, '外伶仃岛', 1, 1); INSERT INTO `activity_item` VALUES (2, '东部华侨城', 1, 1); INSERT INTO `activity_item` VALUES (3, '顺德长鹿农庄', 0, 1); INSERT INTO `activity_item` VALUES (4, '泉林黄金小镇', 1, 1); INSERT INTO `activity_item` VALUES (5, '非常满意', 1, 2); INSERT INTO `activity_item` VALUES (6, '满意', 1, 2); INSERT INTO `activity_item` VALUES (7, '一般', 0, 2); INSERT INTO `activity_item` VALUES (8, '不满意', 0, 2); -- ---------------------------- -- Table structure for appointment -- ---------------------------- DROP TABLE IF EXISTS `appointment`; CREATE TABLE `appointment` ( `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', `ano` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '预约单流水号', `status` int(11) NULL DEFAULT NULL COMMENT '预约单状态 (预约中/履行中/消费中/归档/废弃单)', `category_id` bigint(20) NULL DEFAULT NULL COMMENT '业务大类', `info` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '预约说明', `contact_tel` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '联系电话', `contact_name` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '联系人名称', `business_id` bigint(20) NULL DEFAULT NULL COMMENT '预约门店', `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', `appointment_time` datetime NULL DEFAULT NULL COMMENT '预约时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 33 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '预约单' ROW_FORMAT = DYNAMIC; -- ---------------------------- -- Records of appointment -- ---------------------------- INSERT INTO `appointment` VALUES (1, '2021031503041', 2, 1, '我的车子快到保养期限了,我想做个保养!', '13906780184', '葛曼', 4, '2020-11-23 13:23:16', '2019-11-03 22:08:48'); INSERT INTO `appointment` VALUES (2, '2021031503042', 1, 1, '我要预约2号小刘师傅,洗得很干净!', '17530182120', '邹听谷', 3, '2019-10-30 22:08:48', '2019-11-02 22:08:48'); INSERT INTO `appointment` VALUES (3, '2021031503043', 1, 1, '上次修的油封又坏了', '18983190455', '戚霜霜', 4, '2020-06-07 13:16:54', '2020-06-10 13:16:54'); INSERT INTO `appointment` VALUES (4, '2021031503044', 1, 1, '我的车子快到保养期限了,我想做个保养!', '18372837801', '章霜', 5, '2019-08-11 19:48:36', '2019-08-14 19:48:36'); INSERT INTO `appointment` VALUES (5, '2021031503045', 2, 1, '上次修的油封又坏了', '17012092662', '吕念', 3, '2021-01-15 09:06:20', '2019-01-07 18:28:00'); INSERT INTO `appointment` VALUES (6, '2021031503046', 1, 1, '我要预约2号小刘师傅,洗得很干净!', '14799874955', '云南', 1, '2019-11-01 18:55:16', '2019-11-04 18:55:16'); INSERT INTO `appointment` VALUES (7, '2021031503047', 2, 1, '我的车子快到保养期限了,我想做个保养!', '19979579663', '皇甫', 2, '2019-02-28 01:40:28', '2019-03-03 01:40:28'); INSERT INTO `appointment` VALUES (8, '2021031503048', 2, 1, '我要预约2号小刘师傅,洗得很干净!', '13131260526', '章雪恨', 4, '2019-03-30 21:02:08', '2019-04-02 21:02:00'); INSERT INTO `appointment` VALUES (9, '2021031503049', 1, 1, '上次修的油封又坏了', '18733779343', '张真', 4, '2019-01-15 06:14:08', '2019-01-18 06:14:08'); INSERT INTO `appointment` VALUES (10, '2021031503010', 3, 4, '我的车子快到保养期限了,我想做个保养!', '14729101643', '曹巧蕾', 1, '2020-01-11 10:17:19', '2020-01-14 10:17:19'); INSERT INTO `appointment` VALUES (11, '2021031503011', 2, 1, '上次修的油封又坏了', '14539446467', '华卉', 5, '2020-07-11 00:50:25', '2020-07-14 00:50:25'); INSERT INTO `appointment` VALUES (12, '2021031503099', 2, 6, '我要预约2号小刘师傅,洗得很干净!', '15377931056', '史珍香', 2, '2019-05-15 15:53:06', '2019-05-18 15:53:00'); INSERT INTO `appointment` VALUES (13, '2021031503012', 2, 1, '我的车子快到保养期限了,我想做个保养!', '17864337918', '史尚飞', 1, '2019-04-14 20:14:25', '2019-04-17 20:14:00'); INSERT INTO `appointment` VALUES (14, '2021031503013', 2, 1, '我要预约2号小刘师傅,洗得很干净!', '14502384505', '魏傲书', 1, '2019-10-15 04:33:24', '2019-10-18 04:33:24'); INSERT INTO `appointment` VALUES (15, '2021031503014', 2, 1, '上次修的油封又坏了', '17834660559', '闻人怀', 1, '2019-09-04 05:13:34', '2019-09-07 05:13:34'); INSERT INTO `appointment` VALUES (16, '2021031503015', 2, 1, '我的车子快到保养期限了,我想做个保养!', '17739523778', '云蝶', 4, '2020-01-17 15:37:16', '2020-01-20 15:37:16'); INSERT INTO `appointment` VALUES (17, '2021031503016', 3, 1, '我要预约2号小刘师傅,洗得很干净!', '18478842165', '彭醉', 1, '2019-03-15 14:42:12', '2019-03-18 14:42:12'); INSERT INTO `appointment` VALUES (18, '2021031503017', 4, 1, '上次修的油封又坏了', '13236052373', '吕梦菡', 1, '2020-11-20 06:15:32', '2020-11-23 06:15:32'); INSERT INTO `appointment` VALUES (19, '2021031503018', 2, 1, '我的车子快到保养期限了,我想做个保养!', '18115851740', '奚青', 1, '2019-08-03 05:54:21', '2019-08-06 05:54:21'); INSERT INTO `appointment` VALUES (20, '2021031503019', 2, 1, '上次修的油封又坏了', '19898530262', '张凡', 1, '2020-01-28 19:14:53', '2020-01-31 19:14:53'); INSERT INTO `appointment` VALUES (21, '2021031503020', 3, 1, '我要预约2号小刘师傅,洗得很干净!', '13751100813', '陶蓝', 5, '2020-06-28 16:53:42', '2020-07-01 16:53:42'); INSERT INTO `appointment` VALUES (22, '2021031503021', 3, 1, '我的车子快到保养期限了,我想做个保养!', '13440157627', '韩靖', 3, '2019-01-17 13:24:06', '2019-01-20 13:24:06'); INSERT INTO `appointment` VALUES (23, '2021031503022', 2, 2, '我要预约2号小刘师傅,洗得很干净!', '17663690358', '傅岩杰', 5, '2019-07-10 15:17:43', '2019-07-13 15:17:00'); INSERT INTO `appointment` VALUES (24, '2021031503023', 4, 5, '上次修的油封又坏了', '17254939218', '陈梦梦', 3, '2020-04-22 18:26:33', '2020-04-25 18:26:33'); INSERT INTO `appointment` VALUES (25, '2021031503024', 2, 4, '我的车子快到保养期限了,我想做个保养!', '17132535441', '曹代云', 3, '2019-08-10 10:14:26', '2019-08-13 10:14:26'); INSERT INTO `appointment` VALUES (26, '2021031503025', 2, 2, '上次修的油封又坏了', '16654565361', '水旋', 4, '2019-03-29 22:34:01', '2019-04-01 22:34:01'); INSERT INTO `appointment` VALUES (27, '2021031503026', 2, 1, '我要预约2号小刘师傅,洗得很干净!', '13882509209', '陈霜', 3, '2019-08-04 22:17:47', '2019-08-07 22:17:47'); INSERT INTO `appointment` VALUES (28, '2021031503027', 4, 1, '我的车子快到保养期限了,我想做个保养!', '19992066538', '尤巧', 3, '2020-10-12 16:13:26', '2020-10-15 00:00:00'); INSERT INTO `appointment` VALUES (29, '2021031503028', 2, 3, '我要预约2号小刘师傅,洗得很干净!', '17573840034', '赫连谷', 4, '2020-12-09 08:16:38', '2020-12-12 08:16:38'); INSERT INTO `appointment` VALUES (30, '2021031503029', 3, 6, '上次修的油封又坏了', '13148166378', '邹白', 2, '2020-04-19 05:03:02', '2020-04-22 05:03:02'); INSERT INTO `appointment` VALUES (31, '2021032004746', 1, NULL, NULL, NULL, NULL, NULL, '2021-03-20 19:03:24', NULL); INSERT INTO `appointment` VALUES (32, '2021032093030', 1, NULL, NULL, NULL, NULL, NULL, '2021-03-20 19:06:34', NULL); -- ---------------------------- -- Table structure for business -- ---------------------------- DROP TABLE IF EXISTS `business`; CREATE TABLE `business` ( `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '门店名称', `intro` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '门店介绍', `scope` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '经营范围', `tel` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '门店电话', `address` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '门店地址', `open_date` date NULL DEFAULT NULL COMMENT '经营日期', `license_img` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '营业执照图片', `license_number` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '营业执照号码', `legal_name` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '法人姓名', `legal_tel` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '法人电话', `legal_idcard` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '法人身份证', `main_store` bit(1) NULL DEFAULT NULL COMMENT '门店性质(总店/分店)', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 6 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商户门店' ROW_FORMAT = DYNAMIC; -- ---------------------------- -- Records of business -- ---------------------------- INSERT INTO `business` VALUES (1, '深圳福田店', '深圳狼途汽车服务有限公司成立于2011年 ,公司定位于“连锁运营顾问,汽车服务专家”。立志于以“4S店标准”打造全国统一的养车连锁服务平台!通过我们的服务,使我们的产品为客户创造更大的效益,是我们共同追求的目标。', '本公司的经验范围:汽车维修,清洗车辆;汽车装饰服务,汽车租赁,车辆年检代理服务,机动车辆保险代理,承办汽车展览展示活动;销售汽车配件;二手车经销,授权品牌汽车销售;道路旅客运输(跨省市)。经营涉及行政许可的,凭许可证件经营,违法除外。', '020-85628002', '广州市天河区棠下大地工业园D栋603', '2021-01-21', '/upload/e33aa582-69ff-4561-b142-14e335e64fe3.png', '6343243242414', '寇定朗', '13876767771', '44266631223555', b'1'); INSERT INTO `business` VALUES (2, '广州黄埔店', '狼途广州黄埔店成立于2015年09月06日,是“深圳狼途汽车服务有限公司”旗下以发展汽车美容连锁加盟店业务为主的子公司,公司定位于“连锁运营顾问,汽车服务专家”。立志于以“4S店标准”打造全国统一的养车连锁服务平台!通过我们的服务,使我们的产品为客户创造更大的效益,是我们共同追求的目标。', '本公司的经验范围:汽车维修,清洗车辆;汽车装饰服务,汽车租赁,车辆年检代理服务,机动车辆保险代理,承办汽车展览展示活动;销售汽车配件;二手车经销,授权品牌汽车销售;道路旅客运输(跨省市)。经营涉及行政许可的,凭许可证件经营,违法除外。', '020-85628002', '广州市天河区棠下大地工业园D栋603', '2020-10-09', '/upload/410c78e9-c08d-4cfd-b98c-ed326f689b35.png', '6342343242432', '寇晓朗', '13876767771', '44266631223555', b'0'); INSERT INTO `business` VALUES (3, '广州天河店', '狼途广州天河店成立于2015年09月06日,是“深圳狼途汽车服务有限公司”旗下以发展汽车美容连锁加盟店业务为主的子公司,公司定位于“连锁运营顾问,汽车服务专家”。立志于以“4S店标准”打造全国统一的养车连锁服务平台!通过我们的服务,使我们的产品为客户创造更大的效益,是我们共同追求的目标。', '本公司的经验范围:汽车维修,清洗车辆;汽车装饰服务,汽车租赁,车辆年检代理服务,机动车辆保险代理,承办汽车展览展示活动;销售汽车配件;二手车经销,授权品牌汽车销售;道路旅客运输(跨省市)。经营涉及行政许可的,凭许可证件经营,违法除外。', '020-85628002', '广州市天河区棠下大地工业园D栋603', '2020-10-09', '/upload/410c78e9-c08d-4cfd-b98c-ed326f689b35.png', '6343432411414', '寇达朗', '13876767771', '44266631223555', b'0'); INSERT INTO `business` VALUES (4, '东莞虎门店', '狼途东莞虎门店成立于2015年09月06日,是“深圳狼途汽车服务有限公司”旗下以发展汽车美容连锁加盟店业务为主的子公司,公司定位于“连锁运营顾问,汽车服务专家”。立志于以“4S店标准”打造全国统一的养车连锁服务平台!通过我们的服务,使我们的产品为客户创造更大的效益,是我们共同追求的目标。', '本公司的经验范围:汽车维修,清洗车辆;汽车装饰服务,汽车租赁,车辆年检代理服务,机动车辆保险代理,承办汽车展览展示活动;销售汽车配件;二手车经销,授权品牌汽车销售;道路旅客运输(跨省市)。经营涉及行政许可的,凭许可证件经营,违法除外。', '020-85628002', '广州市天河区棠下大地工业园D栋603', '2020-10-09', '/upload/410c78e9-c08d-4cfd-b98c-ed326f689b35.png', '6343333342414', '寇码朗', '13876767771', '44266631223555', b'0'); INSERT INTO `business` VALUES (5, '江门新会店', '狼途江门新会店成立于2015年09月06日,是“深圳狼途汽车服务有限公司”旗下以发展汽车美容连锁加盟店业务为主的子公司,公司定位于“连锁运营顾问,汽车服务专家”。立志于以“4S店标准”打造全国统一的养车连锁服务平台!通过我们的服务,使我们的产品为客户创造更大的效益,是我们共同追求的目标。', '本公司的经验范围:汽车维修,清洗车辆;汽车装饰服务,汽车租赁,车辆年检代理服务,机动车辆保险代理,承办汽车展览展示活动;销售汽车配件;二手车经销,授权品牌汽车销售;道路旅客运输(跨省市)。经营涉及行政许可的,凭许可证件经营,违法除外。', '020-85628002', '广州市天河区棠下大地工业园D栋603', '2020-10-09', '/upload/410c78e9-c08d-4cfd-b98c-ed326f689b35.png', '6311111112414', '寇少朗', '13876767771', '44266631223555', b'0'); -- ---------------------------- -- Table structure for choice -- ---------------------------- DROP TABLE IF EXISTS `choice`; CREATE TABLE `choice` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `employee_id` bigint(20) NULL DEFAULT NULL COMMENT '投票人', `activity_item_id` bigint(20) NULL DEFAULT NULL COMMENT '已选投票选项', `create_time` datetime NULL DEFAULT NULL COMMENT '投票时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 9 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '员工投票选择表' ROW_FORMAT = DYNAMIC; -- ---------------------------- -- Records of choice -- ---------------------------- INSERT INTO `choice` VALUES (2, 2, 4, '2020-12-23 09:57:02'); INSERT INTO `choice` VALUES (3, 2, 5, '2020-12-23 09:57:02'); INSERT INTO `choice` VALUES (4, 3, 6, '2020-12-23 11:05:29'); INSERT INTO `choice` VALUES (6, 1, 1, '2021-03-21 20:00:44'); INSERT INTO `choice` VALUES (8, 5, 1, '2021-03-21 21:01:26'); -- ---------------------------- -- Table structure for consumption -- ---------------------------- DROP TABLE IF EXISTS `consumption`; CREATE TABLE `consumption` ( `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', `cno` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '消费单流水号', `status` int(10) NULL DEFAULT NULL COMMENT '消费单状态 (待结算/待审核/归档/坏账)', `total_amount` decimal(32, 2) NULL DEFAULT NULL COMMENT '总消费金额', `pay_amount` decimal(32, 2) NULL DEFAULT NULL COMMENT '实收金额', `discount_amount` decimal(32, 2) NULL DEFAULT NULL COMMENT '优惠金额', `info` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '结算备注', `pay_time` datetime NULL DEFAULT NULL COMMENT '结算时间', `payee_id` bigint(20) NULL DEFAULT NULL COMMENT '结算人', `customer_name` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '客户名称', `customer_tel` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '客户联系方式', `car_licence` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '车牌信息记录', `car_type` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '车型记录', `appointment_ano` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '关联预约单', `checkin_time` datetime NULL DEFAULT NULL COMMENT '进店时间', `checkout_time` datetime NULL DEFAULT NULL COMMENT '离店时间', `business_id` bigint(20) NULL DEFAULT NULL COMMENT '消费门店', `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', `create_user_id` bigint(20) NULL DEFAULT NULL COMMENT '创建人', `audit_time` datetime NULL DEFAULT NULL COMMENT '审核时间', `auditor_id` bigint(20) NULL DEFAULT NULL COMMENT '审核人', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 24 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '结算单' ROW_FORMAT = DYNAMIC; -- ---------------------------- -- Records of consumption -- ---------------------------- INSERT INTO `consumption` VALUES (1, '2020110417252746381', 2, 738.00, 720.00, 18.00, '我是备注2', '2021-03-18 17:28:51', 1, '邹听谷', '17530182120', '粤A8888', '宝马', '2020110417252736094', '2019-11-02 22:08:00', '2019-11-03 22:08:00', 3, '2019-11-02 22:08:48', 4, '2021-03-18 22:34:11', 4); INSERT INTO `consumption` VALUES (2, '2020110417252796730', 3, 0.00, 0.00, 0.00, NULL, '2020-06-11 13:16:54', NULL, '戚霜霜', '18983190455', NULL, NULL, '2020110417252763905', '2020-06-10 13:16:54', '2020-06-11 13:16:54', 4, '2020-06-10 13:16:54', 4, '2020-06-12 13:16:54', 11); INSERT INTO `consumption` VALUES (3, '2020110417252758937', 1, 1.00, 1.00, 1.00, '1', '2021-03-18 18:59:28', 1, '章霜11', '18372837801', '1', '1', '2020110417252746051', '2019-08-14 19:48:00', NULL, 5, '2019-08-14 19:48:36', 4, NULL, 4); INSERT INTO `consumption` VALUES (4, '2020110417252714627', 2, 0.00, 0.00, 0.00, NULL, '2019-01-08 18:28:19', NULL, '吕念', '17012092662', NULL, NULL, '2020110417252721098', '2019-01-07 18:28:19', '2019-01-08 18:28:19', 3, '2019-01-07 18:28:19', 4, '2019-01-09 18:28:19', 14); INSERT INTO `consumption` VALUES (5, '2020110417252730564', 2, 16132.00, 15127.67, 1004.33, '', '2021-03-18 20:27:24', 1, '云南', '14799874955', '', '', '2020110417252743068', '2019-11-04 18:55:00', NULL, 1, '2019-11-04 18:55:16', 4, '2021-03-19 09:56:42', 4); INSERT INTO `consumption` VALUES (6, '2020110417252775894', 1, 16147.00, 16147.00, 1628.54, NULL, '2021-03-18 20:27:36', 1, '皇甫', '19979579663', NULL, NULL, '2020110417252719025', '2019-03-03 01:40:28', '2019-03-04 01:40:28', 2, '2019-03-03 01:40:28', 4, '2019-03-05 01:40:28', 4); INSERT INTO `consumption` VALUES (7, '2020110417252720714', 0, 14931.00, 14931.00, 1202.50, NULL, '2019-04-03 21:02:08', NULL, '章雪恨', '13131260526', NULL, NULL, '2020110417252791643', '2019-04-02 21:02:08', '2019-04-03 21:02:08', 4, '2019-04-02 21:02:08', 4, '2019-04-04 21:02:08', 6); INSERT INTO `consumption` VALUES (8, '2020110417252731706', 1, 1400.00, 1000.00, 400.00, '', '2021-03-18 22:15:16', 1, '张真', '18733779343', '', '', '2020110417252770351', '2019-01-18 06:14:00', '2019-01-19 06:14:00', 4, '2019-01-18 06:14:08', 4, '2019-01-20 06:14:08', 4); INSERT INTO `consumption` VALUES (9, '2020110417252746195', 2, 7893.00, 7893.00, 290.32, NULL, '2020-01-15 10:17:19', NULL, '曹巧蕾', '14729101643', NULL, NULL, '2020110417252798241', '2020-01-14 10:17:19', '2020-01-15 10:17:19', 1, '2020-01-14 10:17:19', 4, '2020-01-16 10:17:19', 6); INSERT INTO `consumption` VALUES (10, '2020110417252725419', 1, 17049.00, 17049.00, 1484.45, NULL, '2021-03-18 20:27:11', 1, '华卉', '14539446467', NULL, NULL, '2020110417252709681', '2020-07-14 00:50:25', '2020-07-15 00:50:25', 5, '2020-07-14 00:50:25', 4, '2020-07-16 00:50:25', 4); INSERT INTO `consumption` VALUES (11, '2020110417261426354', 2, 0.00, 0.00, 0.00, NULL, '2019-03-19 14:42:12', NULL, '彭醉', '18478842165', NULL, NULL, '2020110417261468319', '2019-03-18 14:42:12', '2019-03-19 14:42:12', 1, '2019-03-18 14:42:12', 4, '2019-03-20 14:42:12', 10); INSERT INTO `consumption` VALUES (12, '2020110417261415268', 1, 21908.00, 21908.00, 1464.82, NULL, '2021-03-18 19:00:10', 1, '奚青', '18115851740', NULL, NULL, '2020110417261456970', '2019-08-06 05:54:21', '2019-08-07 05:54:21', 1, '2019-08-06 05:54:21', 4, NULL, 4); INSERT INTO `consumption` VALUES (13, '2020110417261419206', 2, 18260.00, 17202.19, 1057.81, '', '2020-07-02 16:53:42', NULL, '陶蓝', '13751100813', '', '', '2020110417261486153', '2020-07-01 16:53:00', '2020-07-02 16:53:00', 5, '2020-07-01 16:53:42', 4, '2020-07-03 16:53:42', 9); INSERT INTO `consumption` VALUES (14, '2020110417261454761', 0, 17525.00, 17525.00, 1767.58, NULL, NULL, NULL, '陈霜', '13882509209', NULL, NULL, '2020110417261462450', '2019-08-07 22:17:47', NULL, 3, '2019-08-07 22:17:47', 4, NULL, 11); INSERT INTO `consumption` VALUES (15, '2020110417261452936', 1, 17983.00, 17983.00, 693.92, NULL, '2021-03-18 22:26:04', 1, '赫连谷', '17573840034', NULL, NULL, '2020110417261470659', '2020-12-12 08:16:38', NULL, 4, '2020-12-12 08:16:38', 4, NULL, 4); INSERT INTO `consumption` VALUES (20, '2021031798146', 0, 0.00, 0.00, 0.00, '', NULL, NULL, '华卉', '14539446467', '', '', '2021031503011', '2020-07-11 00:50:00', NULL, NULL, '2021-03-17 20:19:09', 1, NULL, NULL); INSERT INTO `consumption` VALUES (21, '2021031728472', 0, 0.00, 0.00, 0.00, '', NULL, NULL, '章霜', '18372837801', '', '', '2021031503044', '2019-08-11 19:48:00', NULL, NULL, '2021-03-17 20:29:57', 1, NULL, NULL); INSERT INTO `consumption` VALUES (23, '2021031734835', 1, 1200.00, 900.00, 300.00, '我是备注', '2021-03-18 17:22:54', 3, '皇甫', '19979579663', '粤B6666', '奔驰', NULL, '2019-02-28 01:40:00', '2021-03-09 14:30:00', 2, '2021-03-17 22:08:46', 1, NULL, 1); -- ---------------------------- -- Table structure for consumption_item -- ---------------------------- DROP TABLE IF EXISTS `consumption_item`; CREATE TABLE `consumption_item` ( `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', `category_id` bigint(20) NULL DEFAULT NULL COMMENT '业务大类', `category_item_id` bigint(20) NULL DEFAULT NULL COMMENT '业务小类', `pay_type_id` bigint(20) NULL DEFAULT NULL COMMENT '结算类型', `amount` decimal(32, 2) NULL DEFAULT NULL COMMENT '应收金额', `pay_amount` decimal(32, 2) NULL DEFAULT NULL COMMENT '实收金额', `discount_amount` decimal(32, 2) NULL DEFAULT NULL COMMENT '优惠金额', `create_user_id` bigint(20) NULL DEFAULT NULL COMMENT '创建人', `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', `cno` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '结算单流水号', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 45 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '结算单明细' ROW_FORMAT = DYNAMIC; -- ---------------------------- -- Records of consumption_item -- ---------------------------- INSERT INTO `consumption_item` VALUES (1, 1, 16, 14, 3796.00, 720.00, 18.00, 1, '2019-08-15 15:04:17', '2020110417252758937'); INSERT INTO `consumption_item` VALUES (2, 1, 16, 13, 8923.00, 7701.92, 1221.08, 1, '2019-08-15 18:59:10', '2020110417252758937'); INSERT INTO `consumption_item` VALUES (3, 1, 15, 14, 6240.00, 5458.32, 781.68, 1, '2019-08-14 10:30:38', '2020110417252758937'); INSERT INTO `consumption_item` VALUES (6, 1, 15, 11, 5801.00, 5349.72, 451.28, 5, '2019-11-05 21:10:36', '2020110417252730564'); INSERT INTO `consumption_item` VALUES (7, 2, 17, 11, 7045.00, 6395.40, 649.60, 14, '2019-03-03 07:14:52', '2020110417252775894'); INSERT INTO `consumption_item` VALUES (8, 2, 18, 11, 8975.00, 7997.36, 977.64, 14, '2019-03-03 19:10:09', '2020110417252775894'); INSERT INTO `consumption_item` VALUES (9, 2, 18, 14, 127.00, 125.70, 1.30, 14, '2019-03-03 17:00:40', '2020110417252775894'); INSERT INTO `consumption_item` VALUES (10, 4, 25, 12, 6905.00, 6667.35, 237.65, 7, '2019-04-02 10:53:35', '2020110417252720714'); INSERT INTO `consumption_item` VALUES (11, 4, 27, 11, 3670.00, 3226.06, 443.94, 7, '2019-04-02 09:42:30', '2020110417252720714'); INSERT INTO `consumption_item` VALUES (12, 4, 25, 13, 4356.00, 3835.09, 520.91, 7, '2019-04-02 05:03:30', '2020110417252720714'); INSERT INTO `consumption_item` VALUES (13, 4, 27, 13, 2067.00, 1971.61, 95.39, 9, '2020-01-14 00:57:23', '2020110417252746195'); INSERT INTO `consumption_item` VALUES (14, 4, 25, 13, 2184.00, 2142.39, 41.61, 9, '2020-01-14 21:12:39', '2020110417252746195'); INSERT INTO `consumption_item` VALUES (15, 4, 25, 14, 3642.00, 3488.68, 153.32, 9, '2020-01-14 18:42:07', '2020110417252746195'); INSERT INTO `consumption_item` VALUES (16, 4, 27, 12, 7138.00, 6473.75, 664.25, 10, '2020-07-14 03:38:54', '2020110417252725419'); INSERT INTO `consumption_item` VALUES (17, 4, 25, 12, 9485.00, 8692.44, 792.56, 10, '2020-07-14 16:55:03', '2020110417252725419'); INSERT INTO `consumption_item` VALUES (18, 4, 27, 14, 426.00, 398.36, 27.64, 10, '2020-07-14 06:32:51', '2020110417252725419'); INSERT INTO `consumption_item` VALUES (19, 3, 19, 11, 8927.00, 8037.61, 889.39, 11, '2019-08-06 19:58:04', '2020110417261415268'); INSERT INTO `consumption_item` VALUES (20, 3, 21, 12, 6592.00, 6544.72, 47.28, 11, '2019-08-06 13:48:29', '2020110417261415268'); INSERT INTO `consumption_item` VALUES (21, 3, 21, 13, 6389.00, 5860.85, 528.15, 11, '2019-08-06 06:22:30', '2020110417261415268'); INSERT INTO `consumption_item` VALUES (22, 2, 18, 14, 5921.00, 5721.64, 199.36, 5, '2020-07-01 07:36:49', '2020110417261419206'); INSERT INTO `consumption_item` VALUES (23, 2, 17, 11, 8365.00, 7776.24, 588.76, 5, '2020-07-01 12:12:23', '2020110417261419206'); INSERT INTO `consumption_item` VALUES (24, 2, 18, 14, 3974.00, 3704.31, 269.69, 5, '2020-07-01 11:22:43', '2020110417261419206'); INSERT INTO `consumption_item` VALUES (25, 1, 16, 11, 5627.00, 4855.56, 771.44, 6, '2019-08-07 03:05:49', '2020110417261454761'); INSERT INTO `consumption_item` VALUES (26, 1, 15, 11, 6857.00, 6069.02, 787.98, 6, '2019-08-08 09:35:32', '2020110417261454761'); INSERT INTO `consumption_item` VALUES (27, 1, 16, 13, 5041.00, 4832.85, 208.15, 6, '2019-08-08 19:54:54', '2020110417261454761'); INSERT INTO `consumption_item` VALUES (28, 3, 20, 11, 6385.00, 6288.94, 96.06, 14, '2020-12-13 01:42:39', '2020110417261452936'); INSERT INTO `consumption_item` VALUES (29, 3, 21, 14, 6294.00, 6269.84, 24.16, 14, '2020-12-12 20:18:02', '2020110417261452936'); INSERT INTO `consumption_item` VALUES (30, 3, 21, 11, 5304.00, 4730.30, 573.70, 14, '2020-12-13 01:27:26', '2020110417261452936'); INSERT INTO `consumption_item` VALUES (32, 3, 19, 32, 100.00, 90.00, 10.00, 12, '2021-03-17 16:00:23', '2020110417261452936'); INSERT INTO `consumption_item` VALUES (33, 2, 17, 31, 123.00, 120.00, 3.00, NULL, NULL, '2020110417252746381'); INSERT INTO `consumption_item` VALUES (34, 1, 15, 30, 123.00, 120.00, 3.00, NULL, NULL, '2020110417252746381'); INSERT INTO `consumption_item` VALUES (35, 2, 17, 31, 123.00, 120.00, 3.00, NULL, NULL, '2020110417252746381'); INSERT INTO `consumption_item` VALUES (36, 1, 15, 30, 123.00, 120.00, 3.00, NULL, NULL, '2020110417252746381'); INSERT INTO `consumption_item` VALUES (37, 2, 17, 31, 123.00, 120.00, 3.00, NULL, NULL, '2020110417252746381'); INSERT INTO `consumption_item` VALUES (38, 1, 15, 30, 123.00, 120.00, 3.00, NULL, NULL, '2020110417252746381'); INSERT INTO `consumption_item` VALUES (39, 1, 15, 30, 200.00, 100.00, 100.00, NULL, NULL, '2021031734835'); INSERT INTO `consumption_item` VALUES (40, 1, 16, 30, 400.00, 200.00, 200.00, NULL, NULL, '2020110417252731706'); INSERT INTO `consumption_item` VALUES (41, 1, 15, 30, 1000.00, 950.00, 50.00, NULL, NULL, '2021031775240'); INSERT INTO `consumption_item` VALUES (42, 2, 17, 30, 1000.00, 800.00, 200.00, NULL, NULL, '2021031734835'); INSERT INTO `consumption_item` VALUES (43, 1, 15, 30, 1000.00, 800.00, 200.00, NULL, NULL, '2020110417252731706'); INSERT INTO `consumption_item` VALUES (44, 1, 15, 30, 500.00, 480.00, 20.00, NULL, NULL, ''); -- ---------------------------- -- Table structure for department -- ---------------------------- DROP TABLE IF EXISTS `department`; CREATE TABLE `department` ( `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id', `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '部门名称', `sn` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '部门编号', `status` bit(1) NULL DEFAULT b'1' COMMENT '逻辑删除字段', PRIMARY KEY (`id`) USING BTREE ) ENGINE = MyISAM AUTO_INCREMENT = 12 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of department -- ---------------------------- INSERT INTO `department` VALUES (1, '人事部', 'RS', b'1'); INSERT INTO `department` VALUES (2, '财务部', 'rlMksI', b'1'); INSERT INTO `department` VALUES (3, '仓库部', 'CGxnPu', b'1'); INSERT INTO `department` VALUES (4, '生产部', 'boZjfh', b'1'); INSERT INTO `department` VALUES (5, '总经办', 'TcvJtP', b'1'); INSERT INTO `department` VALUES (6, '后勤部', 'Qxqprm', b'1'); INSERT INTO `department` VALUES (7, '品质部', 'jpOrBf', b'1'); INSERT INTO `department` VALUES (8, '客服部', 'PvIpXh', b'1'); INSERT INTO `department` VALUES (9, '采购部', 'pIOXwj', b'1'); INSERT INTO `department` VALUES (10, '物流部', 'ajQKbo', b'1'); -- ---------------------------- -- Table structure for employee -- ---------------------------- DROP TABLE IF EXISTS `employee`; CREATE TABLE `employee` ( `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id\r\n', `username` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '用户名', `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '真实姓名', `password` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '密码', `email` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '邮箱', `age` int(11) NULL DEFAULT NULL COMMENT '年龄', `admin` bit(1) NULL DEFAULT NULL COMMENT '是否为管理员', `dept_id` bigint(20) NULL DEFAULT NULL COMMENT '所在的部门id', `status` bit(1) NULL DEFAULT b'1' COMMENT '逻辑删除字段', PRIMARY KEY (`id`) USING BTREE ) ENGINE = MyISAM AUTO_INCREMENT = 81 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of employee -- ---------------------------- INSERT INTO `employee` VALUES (1, 'admin', 'admin', '038bdaf98f2037b31f1e75b5b4c9b26e', 'ljpvip@163.com', 20, b'1', 1, b'1'); INSERT INTO `employee` VALUES (3, 'zs', '王书傲', 'af9736201980811edd09567be5cd3af3', '2020vip@163.com', 13, b'0', 9, b'1'); INSERT INTO `employee` VALUES (4, 'xw', '许问', '09311a54ba066134c2b85a2206fb8ef8', 'ljp@163.com', 41, b'0', 9, b'0'); INSERT INTO `employee` VALUES (74, 'xiaolin', 'xiaolin', '0efa7677f70fbd4ce48b7aab3914bb77', 'ljp2020vip@163.com', NULL, b'0', NULL, b'1'); INSERT INTO `employee` VALUES (5, 'lsa', 'lsa', 'b7e8205d9a36cd4b57a94dd2d5e9cd3c', '123456@163.com', 18, b'0', 2, b'1'); INSERT INTO `employee` VALUES (2, 'ls', '李四', 'fd17e60d3de5b4d48c91d6acf8bf8aed', '1101121833@qq.com', 18, b'0', 1, b'1'); -- ---------------------------- -- Table structure for employee_role -- ---------------------------- DROP TABLE IF EXISTS `employee_role`; CREATE TABLE `employee_role` ( `employee_id` bigint(32) NULL DEFAULT NULL COMMENT '员工id', `role_id` bigint(32) NULL DEFAULT NULL COMMENT '角色id', `status` int(1) NULL DEFAULT 1 ) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of employee_role -- ---------------------------- INSERT INTO `employee_role` VALUES (1, 4, 0); -- ---------------------------- -- Table structure for menu -- ---------------------------- DROP TABLE IF EXISTS `menu`; CREATE TABLE `menu` ( `id` bigint(11) NOT NULL AUTO_INCREMENT COMMENT '主键', `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '名称', `parent_id` bigint(11) NULL DEFAULT NULL COMMENT '上级菜单id', `url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '菜单url', `sort` int(11) NULL DEFAULT NULL COMMENT '排序号', `status` bit(1) NULL DEFAULT b'1' COMMENT '菜单状态(0表示禁用,1代表启动)', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of menu -- ---------------------------- -- ---------------------------- -- Table structure for message_board -- ---------------------------- DROP TABLE IF EXISTS `message_board`; CREATE TABLE `message_board` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `nickname` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '昵称', `content` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '留言内容', `create_time` datetime NULL DEFAULT NULL COMMENT '留言时间', `category_id` bigint(20) NULL DEFAULT NULL COMMENT '业务大类', `category_item_id` bigint(20) NULL DEFAULT NULL COMMENT '业务小类', `replyStatus` bit(1) NULL DEFAULT NULL COMMENT '回复状态(未回复/已回复)', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = DYNAMIC; -- ---------------------------- -- Records of message_board -- ---------------------------- INSERT INTO `message_board` VALUES (1, '啊力', 'PICKMAN-双排版 4门 这款汽车、 官方详细参数: 额定功率 4KW 、能否加装5KW ?', '2020-11-17 16:42:44', 1, 15, b'0'); INSERT INTO `message_board` VALUES (2, '小康', '你好,请问吉利mpv能订到吗?或者多久可以上市能订到?????', '2020-11-18 16:42:48', 1, 15, b'1'); INSERT INTO `message_board` VALUES (3, '宏伟', '\r\n求助!!我很忙走不开,你们能上门洗车吗?', '2020-11-03 16:42:51', 2, 25, b'1'); INSERT INTO `message_board` VALUES (4, '文文', '\r\n今天刚提的x3,车牌都没挂上,就轮胎就爆了,这得花多少钱?', '2020-11-06 16:42:54', 2, 17, b'0'); -- ---------------------------- -- Table structure for message_board_ljp -- ---------------------------- DROP TABLE IF EXISTS `message_board_ljp`; CREATE TABLE `message_board_ljp` ( `id_ljp` bigint(20) NOT NULL AUTO_INCREMENT, `nickname_ljp` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '昵称', `content_ljp` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '留言内容', `create_time_ljp` datetime NULL DEFAULT NULL COMMENT '留言时间', `category_id_ljp` bigint(20) NULL DEFAULT NULL COMMENT '业务大类', `category_item_id_ljp` bigint(20) NULL DEFAULT NULL COMMENT '业务小类', `replyStatus_ljp` bit(1) NULL DEFAULT NULL COMMENT '回复状态(未回复/已回复)', PRIMARY KEY (`id_ljp`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 12 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = DYNAMIC; -- ---------------------------- -- Records of message_board_ljp -- ---------------------------- INSERT INTO `message_board_ljp` VALUES (1, '啊力', 'PICKMAN-双排版 4门 这款汽车、 官方详细参数: 额定功率 4KW 、能否加装5KW ?', '2020-11-17 16:42:44', 1, 15, b'0'); INSERT INTO `message_board_ljp` VALUES (2, '小康', '你好,请问吉利mpv能订到吗?或者多久可以上市能订到?????', '2020-11-18 16:42:48', 1, 15, b'1'); INSERT INTO `message_board_ljp` VALUES (3, '宏伟', '\r\n求助!!我很忙走不开,你们能上门洗车吗?', '2020-11-03 16:42:51', 2, 25, b'1'); INSERT INTO `message_board_ljp` VALUES (4, '文文', '\r\n今天刚提的x3,车牌都没挂上,就轮胎就爆了,这得花多少钱?', '2020-11-06 16:42:54', 2, 17, b'0'); INSERT INTO `message_board_ljp` VALUES (10, 'zs', '132', '2021-03-22 15:21:28', 1, 15, b'0'); INSERT INTO `message_board_ljp` VALUES (11, 'zs', '11111', '2021-03-22 15:22:35', 1, 15, b'0'); -- ---------------------------- -- Table structure for message_reply -- ---------------------------- DROP TABLE IF EXISTS `message_reply`; CREATE TABLE `message_reply` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `content` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '回复内容', `message_id` bigint(20) NULL DEFAULT NULL COMMENT '所属留言', `reply_user_id` bigint(20) NULL DEFAULT NULL COMMENT '回复人', `create_time` datetime NULL DEFAULT NULL COMMENT '回复时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = DYNAMIC; -- ---------------------------- -- Records of message_reply -- ---------------------------- INSERT INTO `message_reply` VALUES (1, '您好,暂时未知具体上市时间,后续有消息我们会给您回复的。', 2, 1, '2020-11-17 16:52:58'); INSERT INTO `message_reply` VALUES (2, '您好,吉利mpv11月20号后可开始预订,若有需要可联系客服咨询的。', 2, 1, '2020-11-18 16:53:03'); INSERT INTO `message_reply` VALUES (3, '您好,我们暂不支持上门洗车,您可以找人帮忙开过来,我们在各地都有分店哦。', 3, 1, '2020-11-18 16:56:45'); -- ---------------------------- -- Table structure for message_reply_ljp -- ---------------------------- DROP TABLE IF EXISTS `message_reply_ljp`; CREATE TABLE `message_reply_ljp` ( `id_ljp` bigint(20) NOT NULL AUTO_INCREMENT, `content_ljp` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '回复内容', `message_id_ljp` bigint(20) NULL DEFAULT NULL COMMENT '所属留言', `reply_user_id_ljp` bigint(20) NULL DEFAULT NULL COMMENT '回复人', `create_time_ljp` datetime NULL DEFAULT NULL COMMENT '回复时间', PRIMARY KEY (`id_ljp`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = DYNAMIC; -- ---------------------------- -- Records of message_reply_ljp -- ---------------------------- INSERT INTO `message_reply_ljp` VALUES (1, '您好,暂时未知具体上市时间,后续有消息我们会给您回复的。', 2, 1, '2020-11-17 16:52:58'); INSERT INTO `message_reply_ljp` VALUES (2, '您好,吉利mpv11月20号后可开始预订,若有需要可联系客服咨询的。', 2, 1, '2020-11-18 16:53:03'); INSERT INTO `message_reply_ljp` VALUES (3, '您好,我们暂不支持上门洗车,您可以找人帮忙开过来,我们在各地都有分店哦。', 3, 1, '2020-11-18 16:56:45'); -- ---------------------------- -- Table structure for notice -- ---------------------------- DROP TABLE IF EXISTS `notice`; CREATE TABLE `notice` ( `id` bigint(11) NOT NULL AUTO_INCREMENT COMMENT '主键id', `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '公告标题', `create_people` bigint(11) NULL DEFAULT NULL COMMENT '创建人', `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', `content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '内容', `level` int(11) UNSIGNED NULL DEFAULT 3 COMMENT '公告级别(1为紧急,2为重要,3为普通)', `status` int(11) NULL DEFAULT 1 COMMENT '是否发布(1为已发布,2为未发布)', `deleted` binary(1) NULL DEFAULT 0 COMMENT '逻辑删除字段(true为删除,false为未删除)', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of notice -- ---------------------------- INSERT INTO `notice` VALUES (1, '标题', 3, '2021-03-19 16:13:20', '内容1', 2, 1, 0x30); INSERT INTO `notice` VALUES (2, '中美关系', 2, '2021-03-16 14:10:20', '内容2', 2, 1, 0x30); INSERT INTO `notice` VALUES (3, '超跑', 1, '2021-03-20 19:27:51', '1', 1, 1, 0x30); -- ---------------------------- -- Table structure for notice_employee -- ---------------------------- DROP TABLE IF EXISTS `notice_employee`; CREATE TABLE `notice_employee` ( `employee_id` bigint(20) NOT NULL COMMENT '用户id', `notice_id` bigint(20) NOT NULL COMMENT '通知id', `read` bit(1) NULL DEFAULT b'0' COMMENT '是否阅读' ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户通知关联表' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of notice_employee -- ---------------------------- INSERT INTO `notice_employee` VALUES (3, 1, b'1'); -- ---------------------------- -- Table structure for permission -- ---------------------------- DROP TABLE IF EXISTS `permission`; CREATE TABLE `permission` ( `id` bigint(32) NOT NULL AUTO_INCREMENT COMMENT '主键', `name` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '权限名称', `expression` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '权限表达式', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 21 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of permission -- ---------------------------- INSERT INTO `permission` VALUES (20, '员工列表', 'employee:list'); -- ---------------------------- -- Table structure for role -- ---------------------------- DROP TABLE IF EXISTS `role`; CREATE TABLE `role` ( `id` bigint(32) NOT NULL AUTO_INCREMENT COMMENT '主键', `name` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '角色名称', `sn` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '角色编码', `status` bit(1) NULL DEFAULT b'1', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of role -- ---------------------------- INSERT INTO `role` VALUES (1, '部门管理员', 'BM', b'1'); INSERT INTO `role` VALUES (2, '员工管理员', 'YG', b'1'); INSERT INTO `role` VALUES (3, '部门经理', 'MANAGER', b'1'); INSERT INTO `role` VALUES (4, '超级管理员', 'admin', b'1'); -- ---------------------------- -- Table structure for role_permission -- ---------------------------- DROP TABLE IF EXISTS `role_permission`; CREATE TABLE `role_permission` ( `role_id` bigint(32) NULL DEFAULT NULL COMMENT '角色id', `permission_id` bigint(32) NULL DEFAULT NULL COMMENT '权限id' ) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of role_permission -- ---------------------------- INSERT INTO `role_permission` VALUES (2, 19); INSERT INTO `role_permission` VALUES (1, 15); INSERT INTO `role_permission` VALUES (1, 16); INSERT INTO `role_permission` VALUES (1, 17); INSERT INTO `role_permission` VALUES (1, 18); INSERT INTO `role_permission` VALUES (3, 19); -- ---------------------------- -- Table structure for salary -- ---------------------------- DROP TABLE IF EXISTS `salary`; CREATE TABLE `salary` ( `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id', `money` decimal(16, 2) NULL DEFAULT NULL COMMENT '工资金额', `year` int(20) NULL DEFAULT NULL COMMENT '年份', `month` int(20) NULL DEFAULT NULL COMMENT '月份', `employee_id` bigint(20) NULL DEFAULT NULL COMMENT '员工', `payout_id` bigint(20) NULL DEFAULT NULL COMMENT '发放方式', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 7 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = DYNAMIC; -- ---------------------------- -- Records of salary -- ---------------------------- INSERT INTO `salary` VALUES (1, 10000.00, 2020, 8, 1, 30); INSERT INTO `salary` VALUES (2, 11000.00, 2020, 2, 2, 31); INSERT INTO `salary` VALUES (3, 12000.00, 2020, 2, 3, 30); INSERT INTO `salary` VALUES (4, 10000.00, 2020, 3, 4, 31); INSERT INTO `salary` VALUES (5, 11000.00, 2020, 4, 5, 30); INSERT INTO `salary` VALUES (6, 2000.00, 2019, 12, 3, 53); -- ---------------------------- -- Table structure for system_dictionary -- ---------------------------- DROP TABLE IF EXISTS `system_dictionary`; CREATE TABLE `system_dictionary` ( `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', `sn` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '编码', `title` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '标题', `intro` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '简介', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 7 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = DYNAMIC; -- ---------------------------- -- Records of system_dictionary -- ---------------------------- INSERT INTO `system_dictionary` VALUES (1, 'business', '业务大类', '门店拥有的主要业务类型'); INSERT INTO `system_dictionary` VALUES (2, 'account_type', '结算类型', '结算的金额所属类型'); INSERT INTO `system_dictionary` VALUES (3, 'pay_type', '付款方式', '客户使用何种方式付款'); INSERT INTO `system_dictionary` VALUES (4, 'wanted_level', '意向程度', '客户的意向程度'); INSERT INTO `system_dictionary` VALUES (5, 'source', '来源渠道', '客户是通过何种方式了解到我们'); INSERT INTO `system_dictionary` VALUES (6, 'receive_type', '收货方式', '客户选择的收货方式'); -- ---------------------------- -- Table structure for system_dictionary_item -- ---------------------------- DROP TABLE IF EXISTS `system_dictionary_item`; CREATE TABLE `system_dictionary_item` ( `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', `title` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '标题', `sequence` int(255) NULL DEFAULT NULL COMMENT '序号', `type_id` bigint(20) NULL DEFAULT NULL COMMENT '所属目录', `parent_id` bigint(20) NULL DEFAULT NULL COMMENT '上级明细', PRIMARY KEY (`id`) USING BTREE, INDEX `parent_id`(`type_id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 54 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = DYNAMIC; -- ---------------------------- -- Records of system_dictionary_item -- ---------------------------- INSERT INTO `system_dictionary_item` VALUES (1, '售卖', 2, 1, NULL); INSERT INTO `system_dictionary_item` VALUES (2, '保养', 2, 1, NULL); INSERT INTO `system_dictionary_item` VALUES (3, '修理', 3, 1, NULL); INSERT INTO `system_dictionary_item` VALUES (4, '美容', 4, 1, NULL); INSERT INTO `system_dictionary_item` VALUES (5, '配件', 5, 1, NULL); INSERT INTO `system_dictionary_item` VALUES (6, '订货', 2, 1, NULL); INSERT INTO `system_dictionary_item` VALUES (7, '售后', 3, 1, NULL); INSERT INTO `system_dictionary_item` VALUES (11, '手工费', 1, 2, NULL); INSERT INTO `system_dictionary_item` VALUES (12, '服务费', 1, 2, NULL); INSERT INTO `system_dictionary_item` VALUES (13, '配件费', 3, 2, NULL); INSERT INTO `system_dictionary_item` VALUES (14, '其他费用', 4, 2, NULL); INSERT INTO `system_dictionary_item` VALUES (15, '新车', 1, NULL, 1); INSERT INTO `system_dictionary_item` VALUES (16, '二手车', 2, NULL, 1); INSERT INTO `system_dictionary_item` VALUES (17, '配件', 2, NULL, 2); INSERT INTO `system_dictionary_item` VALUES (18, '装饰品', 3, NULL, 2); INSERT INTO `system_dictionary_item` VALUES (19, '换机油', 4, NULL, 3); INSERT INTO `system_dictionary_item` VALUES (20, '换水箱宝', 1, NULL, 3); INSERT INTO `system_dictionary_item` VALUES (21, '换雨刮', 2, NULL, 3); INSERT INTO `system_dictionary_item` VALUES (25, '洗车', 3, NULL, 4); INSERT INTO `system_dictionary_item` VALUES (26, '打蜡', 1, NULL, 4); INSERT INTO `system_dictionary_item` VALUES (27, '换坐垫', 2, NULL, 4); INSERT INTO `system_dictionary_item` VALUES (30, '支付宝支付', 1, 3, NULL); INSERT INTO `system_dictionary_item` VALUES (31, '微信支付', 2, 3, NULL); INSERT INTO `system_dictionary_item` VALUES (32, '现金支付', 3, 3, NULL); INSERT INTO `system_dictionary_item` VALUES (33, '银行转账', 4, 3, NULL); INSERT INTO `system_dictionary_item` VALUES (34, '较差', 1, 4, NULL); INSERT INTO `system_dictionary_item` VALUES (35, '一般', 2, 4, NULL); INSERT INTO `system_dictionary_item` VALUES (36, '较好', 3, 4, NULL); INSERT INTO `system_dictionary_item` VALUES (37, '很好', 4, 4, NULL); INSERT INTO `system_dictionary_item` VALUES (38, '传单广告', 1, 5, NULL); INSERT INTO `system_dictionary_item` VALUES (39, '网络广告', 2, 5, NULL); INSERT INTO `system_dictionary_item` VALUES (40, '朋友推荐', 3, 5, NULL); INSERT INTO `system_dictionary_item` VALUES (41, '路过店铺', 4, 5, NULL); INSERT INTO `system_dictionary_item` VALUES (42, '网上搜索', 5, 5, NULL); INSERT INTO `system_dictionary_item` VALUES (43, '代收点', 1, 6, NULL); INSERT INTO `system_dictionary_item` VALUES (44, '上门取货', 2, 6, NULL); INSERT INTO `system_dictionary_item` VALUES (45, '客户地址', 3, 6, NULL); INSERT INTO `system_dictionary_item` VALUES (53, '花呗支付', 11, 3, NULL); SET FOREIGN_KEY_CHECKS = 1; 复制代码
我先把所有的建表语句都给了,后面我会着重讲解RBAC的数据库设计。