“This is the 28th day of my participation in the First Challenge 2022. For details: First Challenge 2022”

🍔 1. Project Introduction

🍕1.1 Project Introduction

This project is a system of a car store. In order to better operate merchant stores and maintain the information of new and old customers, Guangzhou Wolto Auto Service Company decided to implement the car store management system. However, the system sold on the market is expensive and bulky, so through market research, I made a lightweight Internet store operation system for the company alone. Will eventually be deployed in ali cloud real server, close to the enterprise.

🍟1.2. Technology used

🌭 1.2.1, backend

The technology stack used by the back end is mainly: SSM+MySQL+Shiro+RBAC. We do not apply Shiro in the early stage. Let’s first write the annotation of the permission by hand to experience the operation mechanism of Shiro and know why it works. At the back end, we will also cover the use of Alibaba’s SMS service, email service and so on.

🍿 1.2.2, front end

Since the project is not a separate front and back end project, the front end uses a template engine — Freemarker, which is currently the most popular template engine in the enterprise, along with some common front-end plug-ins such as Bootstrap and Sweetalert.

🧂1.3, suitable for the crowd

If the difficulty for the full mark is 10, the difficulty of the project is only 4, without any complicated business logic, suitable for just learned friend of SSM framework to consolidate, familiar with common patterns of enterprise development, be familiar with the process of writing code at the same time, for the further study framework to play back, also suit to do some final course design also is very good.

This project will start from 0, including database table building, and finally the real Ali cloud server will be online. Need to have the SSM foundation, MySQL foundation, Linux foundation, I believe in watching friends have a solid foundation.

🍳1.4 Project functions

Registration, login, staff management, department management, authority management, staff import and export functions.

🧇1.5. Project Presentation

🥞 2. Establishment of database

🧈 2.1, preface

Surely there will be a lot of small partners to ask, building a table is not my business, I also need to understand this? Yes, building tables is not something you just go out to work on, because it is designed by the project manager or architect, but are you willing to spend the next ten or twenty years as a lowly brick programmer? Many people the answer is certainly not voluntarily, go up your salary will be added, not only vision and knock on the code level will also be ChengChengCheng go up, for the architect or project manager, one hundred percent will encounter when building table, a project might not have been no database, with the database table is would have some, how should we build table is optimal? What do you need to avoid to build a table pit, I will reveal one by one.

🍞2.2. Table building

It’s not that hard to build a table, but let’s think about it, what’s the purpose of building a table? That must be presenting the data and encapsulating the data. Where is the data that we’re presenting? In the foreground, right? So this brings us to the first and most important rule in table building: the data displayed in the foreground is the main one.

Such as show our project section at the end of the picture shows the data, is the serial number, user name, real name, email and the information such as age, department, then we certainly need to design these fields (department) additionally, we will design the purpose of these fields is our receptionist needs to display the data stored in the database for storage, convenient we show and encapsulation.

When I mentioned the department, I mentioned it separately. Yes, the department. Have you noticed that there is a query involving a linked table where employees are associated with the department? The answer is no, we only need to store primary keys in one table and all information in the other.

And that’s probably it. I haven’t covered it yet and we’ll talk about it when we get to it.

🧀2.3 specific construction sentences

/* 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 'primary key'.`title` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'theme'.`type` int(5) NULL DEFAULT NULL COMMENT 'Type (single 0/ multiple 1/ etc.)'.`status` bit(1) NULL DEFAULT NULL COMMENT 'Status (1 voting /0 stopped voting)',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = 'Voting Activity List' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of activity
-- ----------------------------
INSERT INTO `activity` VALUES (1.'Vote on Departmental Tourism Activities 2020'.0, b'1');
INSERT INTO `activity` VALUES (2.'December 2020 Canteen Satisfaction Survey'.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 'content'.`num` int(11) NULL DEFAULT NULL COMMENT 'Number of votes'.`activity_id` bigint(20) NULL DEFAULT NULL COMMENT 'Activity',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 9 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = 'Voting Options table' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of activity_item
-- ----------------------------
INSERT INTO `activity_item` VALUES (1.Wailingding Island.1.1);
INSERT INTO `activity_item` VALUES (2.Oct East.1.1);
INSERT INTO `activity_item` VALUES (3.Changlu Farm, Shunde.0.1);
INSERT INTO `activity_item` VALUES (4.'Quanlin Gold Town'.1.1);
INSERT INTO `activity_item` VALUES (5.'Very satisfied'.1.2);
INSERT INTO `activity_item` VALUES (6.'satisfied'.1.2);
INSERT INTO `activity_item` VALUES (7.'the general'.0.2);
INSERT INTO `activity_item` VALUES (8.'dissatisfied'.0.2);

-- ----------------------------
-- Table structure for appointment
-- ----------------------------
DROP TABLE IF EXISTS `appointment`;
CREATE TABLE `appointment`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'primary key'.`ano` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'Booking Order Serial Number'.`status` int(11) NULL DEFAULT NULL COMMENT 'Booking status (booking/Performing/consuming/filing/discarding)'.`category_id` bigint(20) NULL DEFAULT NULL COMMENT 'Business category'.`info` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'Booking Instructions'.`contact_tel` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'Contact Number'.`contact_name` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'Contact Name'.`business_id` bigint(20) NULL DEFAULT NULL COMMENT 'Reservation store'.`create_time` datetime NULL DEFAULT NULL COMMENT 'Creation time'.`appointment_time` datetime NULL DEFAULT NULL COMMENT 'Appointment time',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 33 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = 'Booking form' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of appointment
-- ----------------------------
INSERT INTO `appointment` VALUES (1.'2021031503041'.2.1.'My car is nearing the end of its maintenance period and I want to get it serviced! '.'13906780184'.'GeMan'.4.'the 2020-11-23 13:23:16'.'the 2019-11-03 22:08:48');
INSERT INTO `appointment` VALUES (2.'2021031503042'.1.1.'I want to make a reservation for master Liu no. 2, very clean! '.'17530182120'.'Listen to the valley'.3.'the 2019-10-30 22:08:48'.'the 2019-11-02 22:08:48');
INSERT INTO `appointment` VALUES (3.'2021031503043'.1.1.'The oil seal that was repaired last time was broken again.'.'18983190455'.'Qi Shuang Shuang'.4.'the 2020-06-07 13:16:54'.'the 2020-06-10 13:16:54');
INSERT INTO `appointment` VALUES (4.'2021031503044'.1.1.'My car is nearing the end of its maintenance period and I want to get it serviced! '.'18372837801'.'chapter frost'.5.'the 2019-08-11 19:48:36'.'the 2019-08-14 19:48:36');
INSERT INTO `appointment` VALUES (5.'2021031503045'.2.1.'The oil seal that was repaired last time was broken again.'.'17012092662'.'Lv Nian'.3.'the 2021-01-15 09:06:20'.'the 2019-01-07 18:28:00');
INSERT INTO `appointment` VALUES (6.'2021031503046'.1.1.'I want to make a reservation for master Liu no. 2, very clean! '.'14799874955'.'yunnan'.1.'the 2019-11-01 18:55:16'.'the 2019-11-04 18:55:16');
INSERT INTO `appointment` VALUES (7.'2021031503047'.2.1.'My car is nearing the end of its maintenance period and I want to get it serviced! '.'19979579663'.'any suspection.i'.2.'the 2019-02-28 01:40:28'.'the 2019-03-03 01:40:28');
INSERT INTO `appointment` VALUES (8.'2021031503048'.2.1.'I want to make a reservation for master Liu no. 2, very clean! '.'13131260526'.'Snow Of Zhang'.4.'the 2019-03-30 21:02:08'.'the 2019-04-02 21:02:00');
INSERT INTO `appointment` VALUES (9.'2021031503049'.1.1.'The oil seal that was repaired last time was broken again.'.'18733779343'.'set'.4.'the 2019-01-15 06:14:08'.'the 2019-01-18 06:14:08');
INSERT INTO `appointment` VALUES (10.'2021031503010'.3.4.'My car is nearing the end of its maintenance period and I want to get it serviced! '.'14729101643'.'Cao Qiaolei'.1.'the 2020-01-11 10:17:19'.'the 2020-01-14 10:17:19');
INSERT INTO `appointment` VALUES (11.'2021031503011'.2.1.'The oil seal that was repaired last time was broken again.'.'14539446467'.'HuaHui'.5.'the 2020-07-11 00:50:25'.'the 2020-07-14 00:50:25');
INSERT INTO `appointment` VALUES (12.'2021031503099'.2.6.'I want to make a reservation for master Liu no. 2, very clean! '.'15377931056'.Shi Zhenxiang.2.'the 2019-05-15 15:53:06'.'the 2019-05-18 15:53:00');
INSERT INTO `appointment` VALUES (13.'2021031503012'.2.1.'My car is nearing the end of its maintenance period and I want to get it serviced! '.'17864337918'.Swashfield.1.'the 2019-04-14 20:14:25'.'the 2019-04-17 20:14:00');
INSERT INTO `appointment` VALUES (14.'2021031503013'.2.1.'I want to make a reservation for master Liu no. 2, very clean! '.'14502384505'.'Wei Aoshu'.1.'the 2019-10-15 04:33:24'.'the 2019-10-18 04:33:24');
INSERT INTO `appointment` VALUES (15.'2021031503014'.2.1.'The oil seal that was repaired last time was broken again.'.'17834660559'.'Smell the roses'.1.'the 2019-09-04 05:13:34'.'the 2019-09-07 05:13:34');
INSERT INTO `appointment` VALUES (16.'2021031503015'.2.1.'My car is nearing the end of its maintenance period and I want to get it serviced! '.'17739523778'.'cloud butterflies'.4.'the 2020-01-17 15:37:16'.'the 2020-01-20 15:37:16');
INSERT INTO `appointment` VALUES (17.'2021031503016'.3.1.'I want to make a reservation for master Liu no. 2, very clean! '.'18478842165'.'peng drunk'.1.'the 2019-03-15 14:42:12'.'the 2019-03-18 14:42:12');
INSERT INTO `appointment` VALUES (18.'2021031503017'.4.1.'The oil seal that was repaired last time was broken again.'.'13236052373'.'Lu Menghan'.1.'the 2020-11-20 06:15:32'.'the 2020-11-23 06:15:32');
INSERT INTO `appointment` VALUES (19.'2021031503018'.2.1.'My car is nearing the end of its maintenance period and I want to get it serviced! '.'18115851740'.'XiQing'.1.'the 2019-08-03 05:54:21'.'the 2019-08-06 05:54:21');
INSERT INTO `appointment` VALUES (20.'2021031503019'.2.1.'The oil seal that was repaired last time was broken again.'.'19898530262'.'made'.1.'the 2020-01-28 19:14:53'.'the 2020-01-31 19:14:53');
INSERT INTO `appointment` VALUES (21.'2021031503020'.3.1.'I want to make a reservation for master Liu no. 2, very clean! '.'13751100813'.'ceramic blue'.5.'the 2020-06-28 16:53:42'.'the 2020-07-01 16:53:42');
INSERT INTO `appointment` VALUES (22.'2021031503021'.3.1.'My car is nearing the end of its maintenance period and I want to get it serviced! '.'13440157627'.'Han Jing'.3.'the 2019-01-17 13:24:06'.'the 2019-01-20 13:24:06');
INSERT INTO `appointment` VALUES (23.'2021031503022'.2.2.'I want to make a reservation for master Liu no. 2, very clean! '.'17663690358'.'Fu Yanjie'.5.'the 2019-07-10 15:17:43'.'the 2019-07-13 15:17:00');
INSERT INTO `appointment` VALUES (24.'2021031503023'.4.5.'The oil seal that was repaired last time was broken again.'.'17254939218'.'Chen Mengmeng'.3.'the 2020-04-22 18:26:33'.'the 2020-04-25 18:26:33');
INSERT INTO `appointment` VALUES (25.'2021031503024'.2.4.'My car is nearing the end of its maintenance period and I want to get it serviced! '.'17132535441'.'Cao Daiyun'.3.'the 2019-08-10 10:14:26'.'the 2019-08-13 10:14:26');
INSERT INTO `appointment` VALUES (26.'2021031503025'.2.2.'The oil seal that was repaired last time was broken again.'.'16654565361'.'water cycle'.4.'the 2019-03-29 22:34:01'.'the 2019-04-01 22:34:01');
INSERT INTO `appointment` VALUES (27.'2021031503026'.2.1.'I want to make a reservation for master Liu no. 2, very clean! '.'13882509209'.'shuang Chen'.3.'the 2019-08-04 22:17:47'.'the 2019-08-07 22:17:47');
INSERT INTO `appointment` VALUES (28.'2021031503027'.4.1.'My car is nearing the end of its maintenance period and I want to get it serviced! '.'19992066538'.'Mr Qiao'.3.'the 2020-10-12 16:13:26'.'2020-10-15 00:00:00');
INSERT INTO `appointment` VALUES (29.'2021031503028'.2.3.'I want to make a reservation for master Liu no. 2, very clean! '.'17573840034'.'Herian Valley'.4.'the 2020-12-09 08:16:38'.'the 2020-12-12 08:16:38');
INSERT INTO `appointment` VALUES (30.'2021031503029'.3.6.'The oil seal that was repaired last time was broken again.'.'13148166378'.'Zou Bai'.2.'the 2020-04-19 05:03:02'.'the 2020-04-22 05:03:02');
INSERT INTO `appointment` VALUES (31.'2021032004746'.1.NULL.NULL.NULL.NULL.NULL.'the 2021-03-20 19:03:24'.NULL);
INSERT INTO `appointment` VALUES (32.'2021032093030'.1.NULL.NULL.NULL.NULL.NULL.'the 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 'primary key'.`name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'Store Name'.`intro` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'Store Introduction'.`scope` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'Scope of Business'.`tel` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'Store Phone'.`address` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'Store Address'.`open_date` date NULL DEFAULT NULL COMMENT 'Operating Date'.`license_img` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'Business License picture'.`license_number` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'Business License No.'.`legal_name` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'Corporate Name'.`legal_tel` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'Corporate Telephone'.`legal_idcard` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'Corporate Identity Card'.`main_store` bit(1) NULL DEFAULT NULL COMMENT 'Nature of Store (Main store/Branch)',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 6 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = 'Merchant store' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of business
-- ----------------------------
INSERT INTO `business` VALUES (1.Shenzhen Futian Store.Shenzhen Wolf Road Automobile Service Co., Ltd. was established in 2011, the company is positioned as "chain operation consultant, automobile service expert". Determined to "4S shop standard" to create a unified national car chain service platform! Through our service, our products for customers to create greater benefits, is our common pursuit of the goal. '.The scope of our experience: car repair, car cleaning; Car decoration services, car rental, vehicle annual inspection agency services, motor vehicle insurance agency, car exhibition and display activities; Selling auto parts; Used car distribution, authorized brand car sales; Road passenger transport (inter-provincial). Where the operation involves administrative license, the operation shall be carried out by license, except in violation of law. '.'020-85628002'.603, Building D, Tangxiadi Industrial Park, Tianhe District, Guangzhou city.'2021-01-21'.'/upload/e33aa582-69ff-4561-b142-14e335e64fe3.png'.'6343243242414'.'Koulding Lang'.'13876767771'.'44266631223555', b'1');
INSERT INTO `business` VALUES (2.'Huangpu Shop in Guangzhou'.Wolf way Guangzhou Whampoa store was established on September 06, 2015. It is a subsidiary of shenzhen Wolf Way Automobile Service Co., LTD., which mainly develops the business of auto beauty chain stores. The company is positioned as "chain operation consultant, auto service expert". Determined to "4S shop standard" to create a unified national car chain service platform! Through our service, our products for customers to create greater benefits, is our common pursuit of the goal. '.The scope of our experience: car repair, car cleaning; Car decoration services, car rental, vehicle annual inspection agency services, motor vehicle insurance agency, car exhibition and display activities; Selling auto parts; Used car distribution, authorized brand car sales; Road passenger transport (inter-provincial). Where the operation involves administrative license, the operation shall be carried out by license, except in violation of law. '.'020-85628002'.603, Building D, Tangxiadi Industrial Park, Tianhe District, Guangzhou city.'2020-10-09'.'/upload/410c78e9-c08d-4cfd-b98c-ed326f689b35.png'.'6342343242432'.'Kou Xiaolan'.'13876767771'.'44266631223555', b'0');
INSERT INTO `business` VALUES (3.'Guangzhou Tianhe Store'.'Wolf road Guangzhou Tianhe store was established in September 06, 2015, is "Shenzhen Wolf Road Automobile Service Co., LTD." to develop the auto beauty chain store business based subsidiary, the company is positioned as "chain operation consultant, auto service experts". Determined to "4S shop standard" to create a unified national car chain service platform! Through our service, our products for customers to create greater benefits, is our common pursuit of the goal. '.The scope of our experience: car repair, car cleaning; Car decoration services, car rental, vehicle annual inspection agency services, motor vehicle insurance agency, car exhibition and display activities; Selling auto parts; Used car distribution, authorized brand car sales; Road passenger transport (inter-provincial). Where the operation involves administrative license, the operation shall be carried out by license, except in violation of law. '.'020-85628002'.603, Building D, Tangxiadi Industrial Park, Tianhe District, Guangzhou city.'2020-10-09'.'/upload/410c78e9-c08d-4cfd-b98c-ed326f689b35.png'.'6343432411414'.'Codalen'.'13876767771'.'44266631223555', b'0');
INSERT INTO `business` VALUES (4.'Dongguan Tiger Store'.Wolf road Dongguan Tiger store was established on September 06, 2015. It is a subsidiary of shenzhen Wolf Road Automobile Service Co., LTD., which mainly develops the business of auto beauty chain stores. The company is positioned as "chain operation consultant, auto service expert". Determined to "4S shop standard" to create a unified national car chain service platform! Through our service, our products for customers to create greater benefits, is our common pursuit of the goal. '.The scope of our experience: car repair, car cleaning; Car decoration services, car rental, vehicle annual inspection agency services, motor vehicle insurance agency, car exhibition and display activities; Selling auto parts; Used car distribution, authorized brand car sales; Road passenger transport (inter-provincial). Where the operation involves administrative license, the operation shall be carried out by license, except in violation of law. '.'020-85628002'.603, Building D, Tangxiadi Industrial Park, Tianhe District, Guangzhou city.'2020-10-09'.'/upload/410c78e9-c08d-4cfd-b98c-ed326f689b35.png'.'6343333342414'.'Comarang'.'13876767771'.'44266631223555', b'0');
INSERT INTO `business` VALUES (5.'Jiangmen Xinhui Store'.Wolf way Jiangmen Xinhui store was established on September 06, 2015. It is a subsidiary of shenzhen Wolf Way Automobile Service Co., LTD., which mainly develops the business of auto beauty chain stores. The company is positioned as "chain operation consultant, auto service expert". Determined to "4S shop standard" to create a unified national car chain service platform! Through our service, our products for customers to create greater benefits, is our common pursuit of the goal. '.The scope of our experience: car repair, car cleaning; Car decoration services, car rental, vehicle annual inspection agency services, motor vehicle insurance agency, car exhibition and display activities; Selling auto parts; Used car distribution, authorized brand car sales; Road passenger transport (inter-provincial). Where the operation involves administrative license, the operation shall be carried out by license, except in violation of law. '.'020-85628002'.603, Building D, Tangxiadi Industrial Park, Tianhe District, Guangzhou city.'2020-10-09'.'/upload/410c78e9-c08d-4cfd-b98c-ed326f689b35.png'.'6311111112414'.'Kou Shao Lang'.'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 'Voter'.`activity_item_id` bigint(20) NULL DEFAULT NULL COMMENT 'Selected Voting options'.`create_time` datetime NULL DEFAULT NULL COMMENT 'Voting Time',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 9 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = 'Employee Voting Selection Form' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of choice
-- ----------------------------
INSERT INTO `choice` VALUES (2.2.4.'the 2020-12-23 09:57:02');
INSERT INTO `choice` VALUES (3.2.5.'the 2020-12-23 09:57:02');
INSERT INTO `choice` VALUES (4.3.6.'the 2020-12-23 11:05:29');
INSERT INTO `choice` VALUES (6.1.1.'the 2021-03-21 20:00:44');
INSERT INTO `choice` VALUES (8.5.1.'the 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 'primary key'.`cno` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'Bill serial Number'.`status` int(10) NULL DEFAULT NULL COMMENT 'Consumption Statement Status (to be settled/audited/filed/Bad debt)'.`total_amount` decimal(32.2) NULL DEFAULT NULL COMMENT 'Total consumption'.`pay_amount` decimal(32.2) NULL DEFAULT NULL COMMENT 'Received amount'.`discount_amount` decimal(32.2) NULL DEFAULT NULL COMMENT 'Preferential amount'.`info` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'Settlement Notes'.`pay_time` datetime NULL DEFAULT NULL COMMENT 'Settlement time'.`payee_id` bigint(20) NULL DEFAULT NULL COMMENT Clearing House.`customer_name` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'Customer Name'.`customer_tel` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'Customer Contact information'.`car_licence` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'License plate Information Record'.`car_type` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'Model Record'.`appointment_ano` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'Associated Booking'.`checkin_time` datetime NULL DEFAULT NULL COMMENT 'Time of arrival'.`checkout_time` datetime NULL DEFAULT NULL COMMENT 'Departure time'.`business_id` bigint(20) NULL DEFAULT NULL COMMENT 'Consumer store'.`create_time` datetime NULL DEFAULT NULL COMMENT 'Creation time'.`create_user_id` bigint(20) NULL DEFAULT NULL COMMENT 'Founder'.`audit_time` datetime NULL DEFAULT NULL COMMENT 'Audit Time'.`auditor_id` bigint(20) NULL DEFAULT NULL COMMENT 'Examiner',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 24 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = 'Statement' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of consumption
-- ----------------------------
INSERT INTO `consumption` VALUES (1.'2020110417252746381'.2.738.00.720.00.18.00.'This is Note 2'.'the 2021-03-18 17:28:51'.1.'Listen to the valley'.'17530182120'.'guangdong A8888'.'BMW'.'2020110417252736094'.'the 2019-11-02 22:08:00'.'the 2019-11-03 22:08:00'.3.'the 2019-11-02 22:08:48'.4.'the 2021-03-18 22:34:11'.4);
INSERT INTO `consumption` VALUES (2.'2020110417252796730'.3.0.00.0.00.0.00.NULL.'the 2020-06-11 13:16:54'.NULL.'Qi Shuang Shuang'.'18983190455'.NULL.NULL.'2020110417252763905'.'the 2020-06-10 13:16:54'.'the 2020-06-11 13:16:54'.4.'the 2020-06-10 13:16:54'.4.'the 2020-06-12 13:16:54'.11);
INSERT INTO `consumption` VALUES (3.'2020110417252758937'.1.1.00.1.00.1.00.'1'.'the 2021-03-18 18:59:28'.1.'cream in chapter 11'.'18372837801'.'1'.'1'.'2020110417252746051'.'the 2019-08-14 19:48:00'.NULL.5.'the 2019-08-14 19:48:36'.4.NULL.4);
INSERT INTO `consumption` VALUES (4.'2020110417252714627'.2.0.00.0.00.0.00.NULL.'the 2019-01-08 18:28:19'.NULL.'Lv Nian'.'17012092662'.NULL.NULL.'2020110417252721098'.'the 2019-01-07 18:28:19'.'the 2019-01-08 18:28:19'.3.'the 2019-01-07 18:28:19'.4.'the 2019-01-09 18:28:19'.14);
INSERT INTO `consumption` VALUES (5.'2020110417252730564'.2.16132.00.15127.67.1004.33.' '.'the 2021-03-18 20:27:24'.1.'yunnan'.'14799874955'.' '.' '.'2020110417252743068'.'the 2019-11-04 18:55:00'.NULL.1.'the 2019-11-04 18:55:16'.4.'the 2021-03-19 09:56:42'.4);
INSERT INTO `consumption` VALUES (6.'2020110417252775894'.1.16147.00.16147.00.1628.54.NULL.'the 2021-03-18 20:27:36'.1.'any suspection.i'.'19979579663'.NULL.NULL.'2020110417252719025'.'the 2019-03-03 01:40:28'.'the 2019-03-04 01:40:28'.2.'the 2019-03-03 01:40:28'.4.'the 2019-03-05 01:40:28'.4);
INSERT INTO `consumption` VALUES (7.'2020110417252720714'.0.14931.00.14931.00.1202.50.NULL.'the 2019-04-03 21:02:08'.NULL.'Snow Of Zhang'.'13131260526'.NULL.NULL.'2020110417252791643'.'the 2019-04-02 21:02:08'.'the 2019-04-03 21:02:08'.4.'the 2019-04-02 21:02:08'.4.'the 2019-04-04 21:02:08'.6);
INSERT INTO `consumption` VALUES (8.'2020110417252731706'.1.1400.00.1000.00.400.00.' '.'the 2021-03-18 22:15:16'.1.'set'.'18733779343'.' '.' '.'2020110417252770351'.'the 2019-01-18 06:14:00'.'the 2019-01-19 06:14:00'.4.'the 2019-01-18 06:14:08'.4.'the 2019-01-20 06:14:08'.4);
INSERT INTO `consumption` VALUES (9.'2020110417252746195'.2.7893.00.7893.00.290.32.NULL.'the 2020-01-15 10:17:19'.NULL.'Cao Qiaolei'.'14729101643'.NULL.NULL.'2020110417252798241'.'the 2020-01-14 10:17:19'.'the 2020-01-15 10:17:19'.1.'the 2020-01-14 10:17:19'.4.'the 2020-01-16 10:17:19'.6);
INSERT INTO `consumption` VALUES (10.'2020110417252725419'.1.17049.00.17049.00.1484.45.NULL.'the 2021-03-18 20:27:11'.1.'HuaHui'.'14539446467'.NULL.NULL.'2020110417252709681'.'the 2020-07-14 00:50:25'.'the 2020-07-15 00:50:25'.5.'the 2020-07-14 00:50:25'.4.'the 2020-07-16 00:50:25'.4);
INSERT INTO `consumption` VALUES (11.'2020110417261426354'.2.0.00.0.00.0.00.NULL.'the 2019-03-19 14:42:12'.NULL.'peng drunk'.'18478842165'.NULL.NULL.'2020110417261468319'.'the 2019-03-18 14:42:12'.'the 2019-03-19 14:42:12'.1.'the 2019-03-18 14:42:12'.4.'the 2019-03-20 14:42:12'.10);
INSERT INTO `consumption` VALUES (12.'2020110417261415268'.1.21908.00.21908.00.1464.82.NULL.'the 2021-03-18 19:00:10'.1.'XiQing'.'18115851740'.NULL.NULL.'2020110417261456970'.'the 2019-08-06 05:54:21'.'the 2019-08-07 05:54:21'.1.'the 2019-08-06 05:54:21'.4.NULL.4);
INSERT INTO `consumption` VALUES (13.'2020110417261419206'.2.18260.00.17202.19.1057.81.' '.'the 2020-07-02 16:53:42'.NULL.'ceramic blue'.'13751100813'.' '.' '.'2020110417261486153'.'the 2020-07-01 16:53:00'.'the 2020-07-02 16:53:00'.5.'the 2020-07-01 16:53:42'.4.'the 2020-07-03 16:53:42'.9);
INSERT INTO `consumption` VALUES (14.'2020110417261454761'.0.17525.00.17525.00.1767.58.NULL.NULL.NULL.'shuang Chen'.'13882509209'.NULL.NULL.'2020110417261462450'.'the 2019-08-07 22:17:47'.NULL.3.'the 2019-08-07 22:17:47'.4.NULL.11);
INSERT INTO `consumption` VALUES (15.'2020110417261452936'.1.17983.00.17983.00.693.92.NULL.'the 2021-03-18 22:26:04'.1.'Herian Valley'.'17573840034'.NULL.NULL.'2020110417261470659'.'the 2020-12-12 08:16:38'.NULL.4.'the 2020-12-12 08:16:38'.4.NULL.4);
INSERT INTO `consumption` VALUES (20.'2021031798146'.0.0.00.0.00.0.00.' '.NULL.NULL.'HuaHui'.'14539446467'.' '.' '.'2021031503011'.'the 2020-07-11 00:50:00'.NULL.NULL.'the 2021-03-17 20:19:09'.1.NULL.NULL);
INSERT INTO `consumption` VALUES (21.'2021031728472'.0.0.00.0.00.0.00.' '.NULL.NULL.'chapter frost'.'18372837801'.' '.' '.'2021031503044'.'the 2019-08-11 19:48:00'.NULL.NULL.'the 2021-03-17 20:29:57'.1.NULL.NULL);
INSERT INTO `consumption` VALUES (23.'2021031734835'.1.1200.00.900.00.300.00.'I'm a note.'.'the 2021-03-18 17:22:54'.3.'any suspection.i'.'19979579663'.'guangdong B6666'.'Mercedes'.NULL.'the 2019-02-28 01:40:00'.'the 2021-03-09 14:30:00'.2.'the 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 'primary key'.`category_id` bigint(20) NULL DEFAULT NULL COMMENT 'Business category'.`category_item_id` bigint(20) NULL DEFAULT NULL COMMENT 'Business subclass'.`pay_type_id` bigint(20) NULL DEFAULT NULL COMMENT 'Settlement type'.`amount` decimal(32.2) NULL DEFAULT NULL COMMENT 'Amount receivable'.`pay_amount` decimal(32.2) NULL DEFAULT NULL COMMENT 'Received amount'.`discount_amount` decimal(32.2) NULL DEFAULT NULL COMMENT 'Preferential amount'.`create_user_id` bigint(20) NULL DEFAULT NULL COMMENT 'Founder'.`create_time` datetime NULL DEFAULT NULL COMMENT 'Creation time'.`cno` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'Statement Serial Number',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 45 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = 'Statement details' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of consumption_item
-- ----------------------------
INSERT INTO `consumption_item` VALUES (1.1.16.14.3796.00.720.00.18.00.1.'the 2019-08-15 15:04:17'.'2020110417252758937');
INSERT INTO `consumption_item` VALUES (2.1.16.13.8923.00.7701.92.1221.08.1.'the 2019-08-15 18:59:10'.'2020110417252758937');
INSERT INTO `consumption_item` VALUES (3.1.15.14.6240.00.5458.32.781.68.1.'the 2019-08-14 10:30:38'.'2020110417252758937');
INSERT INTO `consumption_item` VALUES (6.1.15.11.5801.00.5349.72.451.28.5.'the 2019-11-05 21:10:36'.'2020110417252730564');
INSERT INTO `consumption_item` VALUES (7.2.17.11.7045.00.6395.40.649.60.14.'the 2019-03-03 07:14:52'.'2020110417252775894');
INSERT INTO `consumption_item` VALUES (8.2.18.11.8975.00.7997.36.977.64.14.'the 2019-03-03 19:10:09'.'2020110417252775894');
INSERT INTO `consumption_item` VALUES (9.2.18.14.127.00.125.70.1.30.14.'the 2019-03-03 17:00:40'.'2020110417252775894');
INSERT INTO `consumption_item` VALUES (10.4.25.12.6905.00.6667.35.237.65.7.'the 2019-04-02 10:53:35'.'2020110417252720714');
INSERT INTO `consumption_item` VALUES (11.4.27.11.3670.00.3226.06.443.94.7.'the 2019-04-02 09:42:30'.'2020110417252720714');
INSERT INTO `consumption_item` VALUES (12.4.25.13.4356.00.3835.09.520.91.7.'the 2019-04-02 05:03:30'.'2020110417252720714');
INSERT INTO `consumption_item` VALUES (13.4.27.13.2067.00.1971.61.95.39.9.'the 2020-01-14 00:57:23'.'2020110417252746195');
INSERT INTO `consumption_item` VALUES (14.4.25.13.2184.00.2142.39.41.61.9.'the 2020-01-14 21:12:39'.'2020110417252746195');
INSERT INTO `consumption_item` VALUES (15.4.25.14.3642.00.3488.68.153.32.9.'the 2020-01-14 18:42:07'.'2020110417252746195');
INSERT INTO `consumption_item` VALUES (16.4.27.12.7138.00.6473.75.664.25.10.'the 2020-07-14 03:38:54'.'2020110417252725419');
INSERT INTO `consumption_item` VALUES (17.4.25.12.9485.00.8692.44.792.56.10.'the 2020-07-14 16:55:03'.'2020110417252725419');
INSERT INTO `consumption_item` VALUES (18.4.27.14.426.00.398.36.27.64.10.'the 2020-07-14 06:32:51'.'2020110417252725419');
INSERT INTO `consumption_item` VALUES (19.3.19.11.8927.00.8037.61.889.39.11.'the 2019-08-06 19:58:04'.'2020110417261415268');
INSERT INTO `consumption_item` VALUES (20.3.21.12.6592.00.6544.72.47.28.11.'the 2019-08-06 13:48:29'.'2020110417261415268');
INSERT INTO `consumption_item` VALUES (21.3.21.13.6389.00.5860.85.528.15.11.'the 2019-08-06 06:22:30'.'2020110417261415268');
INSERT INTO `consumption_item` VALUES (22.2.18.14.5921.00.5721.64.199.36.5.'the 2020-07-01 07:36:49'.'2020110417261419206');
INSERT INTO `consumption_item` VALUES (23.2.17.11.8365.00.7776.24.588.76.5.'the 2020-07-01 12:12:23'.'2020110417261419206');
INSERT INTO `consumption_item` VALUES (24.2.18.14.3974.00.3704.31.269.69.5.'the 2020-07-01 11:22:43'.'2020110417261419206');
INSERT INTO `consumption_item` VALUES (25.1.16.11.5627.00.4855.56.771.44.6.'the 2019-08-07 03:05:49'.'2020110417261454761');
INSERT INTO `consumption_item` VALUES (26.1.15.11.6857.00.6069.02.787.98.6.'the 2019-08-08 09:35:32'.'2020110417261454761');
INSERT INTO `consumption_item` VALUES (27.1.16.13.5041.00.4832.85.208.15.6.'the 2019-08-08 19:54:54'.'2020110417261454761');
INSERT INTO `consumption_item` VALUES (28.3.20.11.6385.00.6288.94.96.06.14.'the 2020-12-13 01:42:39'.'2020110417261452936');
INSERT INTO `consumption_item` VALUES (29.3.21.14.6294.00.6269.84.24.16.14.'the 2020-12-12 20:18:02'.'2020110417261452936');
INSERT INTO `consumption_item` VALUES (30.3.21.11.5304.00.4730.30.573.70.14.'the 2020-12-13 01:27:26'.'2020110417261452936');
INSERT INTO `consumption_item` VALUES (32.3.19.32.100.00.90.00.10.00.12.'the 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 'primary key id'.`name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'Department Name'.`sn` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'Department No.'.`status` bit(1) NULL DEFAULT b'1' COMMENT 'Logical drop field',
  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.'Personnel Department'.'RS', b'1');
INSERT INTO `department` VALUES (2.'Finance Department'.'rlMksI', b'1');
INSERT INTO `department` VALUES (3.'Warehouse Department'.'CGxnPu', b'1');
INSERT INTO `department` VALUES (4.'Production Department'.'boZjfh', b'1');
INSERT INTO `department` VALUES (5.'General Manager'.'TcvJtP', b'1');
INSERT INTO `department` VALUES (6.'Logistics'.'Qxqprm', b'1');
INSERT INTO `department` VALUES (7.'Quality Department'.'jpOrBf', b'1');
INSERT INTO `department` VALUES (8.'Customer Service'.'PvIpXh', b'1');
INSERT INTO `department` VALUES (9.'Purchasing Department'.'pIOXwj', b'1');
INSERT INTO `department` VALUES (10.'Logistics Department'.'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 'Username'.`name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'Real Name'.`password` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'password'.`email` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'email'.`age` int(11) NULL DEFAULT NULL COMMENT 'age'.`admin` bit(1) NULL DEFAULT NULL COMMENT 'Administrator or not'.`dept_id` bigint(20) NULL DEFAULT NULL COMMENT 'Department ID'.`status` bit(1) NULL DEFAULT b'1' COMMENT 'Logical drop field',
  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'.'[email protected]'.20, b'1'.1, b'1');
INSERT INTO `employee` VALUES (3.'zs'.'Wang Shuao'.'af9736201980811edd09567be5cd3af3'.'[email protected]'.13, b'0'.9, b'1');
INSERT INTO `employee` VALUES (4.'xw'.'xu asked'.'09311a54ba066134c2b85a2206fb8ef8'.'[email protected]'.41, b'0'.9, b'0');
INSERT INTO `employee` VALUES (74.'xiaolin'.'xiaolin'.'0efa7677f70fbd4ce48b7aab3914bb77'.'[email protected]'.NULL, b'0'.NULL, b'1');
INSERT INTO `employee` VALUES (5.'lsa'.'lsa'.'b7e8205d9a36cd4b57a94dd2d5e9cd3c'.'[email protected]'.18, b'0'.2, b'1');
INSERT INTO `employee` VALUES (2.'ls'.'bill'.'fd17e60d3de5b4d48c91d6acf8bf8aed'.'[email protected]'.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 'employee id'.`role_id` bigint(32) NULL DEFAULT NULL COMMENT 'character 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 'primary key'.`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'name'.`parent_id` bigint(11) NULL DEFAULT NULL COMMENT 'Superior menu ID'.`url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'menu url'.`sort` int(11) NULL DEFAULT NULL COMMENT 'Sort number'.`status` bit(1) NULL DEFAULT b'1' COMMENT 'Menu status (0 for disabled, 1 for enabled)',
  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 'nickname'.`content` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'Message Content'.`create_time` datetime NULL DEFAULT NULL COMMENT 'Message Time'.`category_id` bigint(20) NULL DEFAULT NULL COMMENT 'Business category'.`category_item_id` bigint(20) NULL DEFAULT NULL COMMENT 'Business subclass'.`replyStatus` bit(1) NULL DEFAULT NULL COMMENT 'Reply Status (not replied/replied)',
  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.'ah force'.This car, official details: rated power 4KW, can add 5KW? '.'the 2020-11-17 16:42:44'.1.15, b'0');
INSERT INTO `message_board` VALUES (2.'off'.'Hello, can I book geely MPV? Or how long can be listed to order ????? '.'the 2020-11-18 16:42:48'.1.15, b'1');
INSERT INTO `message_board` VALUES (3.'grand'.'\r\n Help!! I'm too busy to leave. Can you wash the car? '.'the 2020-11-03 16:42:51'.2.25, b'1');
INSERT INTO `message_board` VALUES (4.'text'.'\r\n Today just mentioned x3, the license plate did not hang, on the tire burst, this cost how much? '.'the 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 'nickname'.`content_ljp` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'Message Content'.`create_time_ljp` datetime NULL DEFAULT NULL COMMENT 'Message Time'.`category_id_ljp` bigint(20) NULL DEFAULT NULL COMMENT 'Business category'.`category_item_id_ljp` bigint(20) NULL DEFAULT NULL COMMENT 'Business subclass'.`replyStatus_ljp` bit(1) NULL DEFAULT NULL COMMENT 'Reply Status (not replied/replied)',
  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.'ah force'.This car, official details: rated power 4KW, can add 5KW? '.'the 2020-11-17 16:42:44'.1.15, b'0');
INSERT INTO `message_board_ljp` VALUES (2.'off'.'Hello, can I book geely MPV? Or how long can be listed to order ????? '.'the 2020-11-18 16:42:48'.1.15, b'1');
INSERT INTO `message_board_ljp` VALUES (3.'grand'.'\r\n Help!! I'm too busy to leave. Can you wash the car? '.'the 2020-11-03 16:42:51'.2.25, b'1');
INSERT INTO `message_board_ljp` VALUES (4.'text'.'\r\n Today just mentioned x3, the license plate did not hang, on the tire burst, this cost how much? '.'the 2020-11-06 16:42:54'.2.17, b'0');
INSERT INTO `message_board_ljp` VALUES (10.'zs'.'132'.'the 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 'Reply content'.`message_id` bigint(20) NULL DEFAULT NULL COMMENT 'Owning message'.`reply_user_id` bigint(20) NULL DEFAULT NULL COMMENT 'Responder'.`create_time` datetime NULL DEFAULT NULL COMMENT 'Reply time',
  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.'Hello, we don't know the specific time of listing. We will reply you if there is any news. '.2.1.'the 2020-11-17 16:52:58');
INSERT INTO `message_reply` VALUES (2.'Hello, geely MPV can be booked after November 20th. If necessary, please contact the customer service for consultation. '.2.1.'the 2020-11-18 16:53:03');
INSERT INTO `message_reply` VALUES (3.'Hello, we do not support door-to-door car washing, you can find someone to help drive over, we have branches all over the oh. '.3.1.'the 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 'Reply content'.`message_id_ljp` bigint(20) NULL DEFAULT NULL COMMENT 'Owning message'.`reply_user_id_ljp` bigint(20) NULL DEFAULT NULL COMMENT 'Responder'.`create_time_ljp` datetime NULL DEFAULT NULL COMMENT 'Reply time',
  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.'Hello, we don't know the specific time of listing. We will reply you if there is any news. '.2.1.'the 2020-11-17 16:52:58');
INSERT INTO `message_reply_ljp` VALUES (2.'Hello, geely MPV can be booked after November 20th. If necessary, please contact the customer service for consultation. '.2.1.'the 2020-11-18 16:53:03');
INSERT INTO `message_reply_ljp` VALUES (3.'Hello, we do not support door-to-door car washing, you can find someone to help drive over, we have branches all over the oh. '.3.1.'the 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 'primary key id'.`title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'Title of Announcement'.`create_people` bigint(11) NULL DEFAULT NULL COMMENT 'Founder'.`create_time` datetime NULL DEFAULT NULL COMMENT 'Creation time'.`content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT 'content'.`level` int(11) UNSIGNED NULL DEFAULT 3 COMMENT 'Bulletin level (1 is Critical, 2 is Major, and 3 is Normal)'.`status` int(11) NULL DEFAULT 1 COMMENT 'Published or not (1 is published, 2 is not published)'.`deleted` binary(1) NULL DEFAULT 0 COMMENT 'Logically deleted field (true for deleted, false for undeleted)',
  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.'title'.3.'the 2021-03-19 16:13:20'.Content of the '1'.2.1.0x30);
INSERT INTO `notice` VALUES (2.'China-us Relations'.2.'the 2021-03-16 14:10:20'.Content of the '2'.2.1.0x30);
INSERT INTO `notice` VALUES (3.'supercar'.1.'the 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 'user id'.`notice_id` bigint(20) NOT NULL COMMENT 'notification id'.`read` bit(1) NULL DEFAULT b'0' COMMENT 'Read or not read'
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = 'User Notification association Table' 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 'primary key'.`name` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'Permission Name'.`expression` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'Permission expression',
  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'.'employee:list');

-- ----------------------------
-- Table structure for role
-- ----------------------------
DROP TABLE IF EXISTS `role`;
CREATE TABLE `role`  (
  `id` bigint(32) NOT NULL AUTO_INCREMENT COMMENT 'primary key'.`name` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'Role Name'.`sn` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'Character coding'.`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.'Department Administrator'.'BM', b'1');
INSERT INTO `role` VALUES (2.'Staff Manager'.'YG', b'1');
INSERT INTO `role` VALUES (3.'Department Manager'.'MANAGER', b'1');
INSERT INTO `role` VALUES (4.'Super Administrator'.'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 'character id'.`permission_id` bigint(32) NULL DEFAULT NULL COMMENT 'authorization 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 'primary key id'.`money` decimal(16.2) NULL DEFAULT NULL COMMENT 'Wage amount'.`year` int(20) NULL DEFAULT NULL COMMENT 'year'.`month` int(20) NULL DEFAULT NULL COMMENT '月份'.`employee_id` bigint(20) NULL DEFAULT NULL COMMENT 'employees'.`payout_id` bigint(20) NULL DEFAULT NULL COMMENT 'Mode of Release',
  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 'primary key'.`sn` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'coding'.`title` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'title'.`intro` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'introduction',
  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'.'Business category'.'Main types of business owned by stores');
INSERT INTO `system_dictionary` VALUES (2.'account_type'.'Settlement type'.'Settlement amount type');
INSERT INTO `system_dictionary` VALUES (3.'pay_type'.'Payment Method'.'How do customers pay?');
INSERT INTO `system_dictionary` VALUES (4.'wanted_level'.'Degree of intent'.'Degree of customer intent');
INSERT INTO `system_dictionary` VALUES (5.'source'.'Source channel'.'How do customers know about us?');
INSERT INTO `system_dictionary` VALUES (6.'receive_type'.'Method of Receipt'.'Customer's choice of delivery method');

-- ----------------------------
-- 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 'primary key'.`title` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'title'.`sequence` int(255) NULL DEFAULT NULL COMMENT 'number'.`type_id` bigint(20) NULL DEFAULT NULL COMMENT 'Owning directory'.`parent_id` bigint(20) NULL DEFAULT NULL COMMENT 'Superior details',
  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.'selling'.2.1.NULL);
INSERT INTO `system_dictionary_item` VALUES (2.'maintenance'.2.1.NULL);
INSERT INTO `system_dictionary_item` VALUES (3.'repair'.3.1.NULL);
INSERT INTO `system_dictionary_item` VALUES (4.'beauty'.4.1.NULL);
INSERT INTO `system_dictionary_item` VALUES (5.'spare parts'.5.1.NULL);
INSERT INTO `system_dictionary_item` VALUES (6.'order'.2.1.NULL);
INSERT INTO `system_dictionary_item` VALUES (7.'after sales'.3.1.NULL);
INSERT INTO `system_dictionary_item` VALUES (11.'Handwork'.1.2.NULL);
INSERT INTO `system_dictionary_item` VALUES (12.'Service fee'.1.2.NULL);
INSERT INTO `system_dictionary_item` VALUES (13.'Accessory fee'.3.2.NULL);
INSERT INTO `system_dictionary_item` VALUES (14.'Other Expenses'.4.2.NULL);
INSERT INTO `system_dictionary_item` VALUES (15.'new'.1.NULL.1);
INSERT INTO `system_dictionary_item` VALUES (16.'Used car'.2.NULL.1);
INSERT INTO `system_dictionary_item` VALUES (17.'spare parts'.2.NULL.2);
INSERT INTO `system_dictionary_item` VALUES (18.'ornament'.3.NULL.2);
INSERT INTO `system_dictionary_item` VALUES (19.'Oil change'.4.NULL.3);
INSERT INTO `system_dictionary_item` VALUES (20.Change the Water Tank.1.NULL.3);
INSERT INTO `system_dictionary_item` VALUES (21.'Change the wiper'.2.NULL.3);
INSERT INTO `system_dictionary_item` VALUES (25.'car'.3.NULL.4);
INSERT INTO `system_dictionary_item` VALUES (26.Wax ' '.1.NULL.4);
INSERT INTO `system_dictionary_item` VALUES (27.'Change the seat'.2.NULL.4);
INSERT INTO `system_dictionary_item` VALUES (30.'Alipay pay'.1.3.NULL);
INSERT INTO `system_dictionary_item` VALUES (31.'wechat Pay'.2.3.NULL);
INSERT INTO `system_dictionary_item` VALUES (32.'Cash payment'.3.3.NULL);
INSERT INTO `system_dictionary_item` VALUES (33.'Bank transfer'.4.3.NULL);
INSERT INTO `system_dictionary_item` VALUES (34.'poor'.1.4.NULL);
INSERT INTO `system_dictionary_item` VALUES (35.'the general'.2.4.NULL);
INSERT INTO `system_dictionary_item` VALUES (36.'good'.3.4.NULL);
INSERT INTO `system_dictionary_item` VALUES (37.'very good'.4.4.NULL);
INSERT INTO `system_dictionary_item` VALUES (38.'Flyer advertising'.1.5.NULL);
INSERT INTO `system_dictionary_item` VALUES (39.'Online Advertising'.2.5.NULL);
INSERT INTO `system_dictionary_item` VALUES (40.'Friend recommendation'.3.5.NULL);
INSERT INTO `system_dictionary_item` VALUES (41.'Passing the shop'.4.5.NULL);
INSERT INTO `system_dictionary_item` VALUES (42.'Online Search'.5.5.NULL);
INSERT INTO `system_dictionary_item` VALUES (43.'Collection point'.1.6.NULL);
INSERT INTO `system_dictionary_item` VALUES (44.'Pick-up'.2.6.NULL);
INSERT INTO `system_dictionary_item` VALUES (45.'Customer address'.3.6.NULL);
INSERT INTO `system_dictionary_item` VALUES (53.'Pay by spending'.11.3.NULL);

SET FOREIGN_KEY_CHECKS = 1;

Copy the code

I’ve given you all the building statements, and I’ll focus on the database design of RBAC later.

🥙 3. Project construction

🥪3.1. Import POM files

Let’s start with a Maven project. Creating a Maven project by default is something you must be familiar with, or you must be able to create with your eyes closed. Next, let’s import some dependencies that we will basically use throughout the project.

<properties>
    <spring.version>5.0.8. RELEASE</spring.version>
    <shiro.version>1.5.2</shiro.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.compiler.source>11</maven.compiler.source>
    <maven.compiler.target>11</maven.compiler.target>
  </properties>
  <dependencies>
    <dependency>
      <groupId>org.mybatis</groupId>
      <artifactId>mybatis-spring</artifactId>
      <version>1.3.1</version>
    </dependency>
    <dependency>
      <groupId>org.mybatis</groupId>
      <artifactId>mybatis</artifactId>
      <version>3.4.5</version>
    </dependency>
    <! - shiro core -- -- >
    <dependency>
      <groupId>org.apache.shiro</groupId>
      <artifactId>shiro-core</artifactId>
      <version>${shiro.version}</version>
    </dependency>
    <! -- Shiro Web module -->
    <dependency>
      <groupId>org.apache.shiro</groupId>
      <artifactId>shiro-web</artifactId>
      <version>${shiro.version}</version>
    </dependency>
    <! -- Shiro and Spring integration -->
    <dependency>
      <groupId>org.apache.shiro</groupId>
      <artifactId>shiro-spring</artifactId>
      <version>${shiro.version}</version>
    </dependency>
    <! -- Shiro ehcache -->
    <dependency>
      <groupId>org.apache.shiro</groupId>
      <artifactId>shiro-ehcache</artifactId>
      <version>${shiro.version}</version>
    </dependency>
    <! -- Shiro depends on the log package -->
    <dependency>
      <groupId>commons-logging</groupId>
      <artifactId>commons-logging</artifactId>
      <version>1.2</version>
    </dependency>
    <! Freemarker shiro tag library
    <dependency>
      <groupId>net.mingsoft</groupId>
      <artifactId>shiro-freemarker-tags</artifactId>
      <version>1.0.1</version>
    </dependency>
    <dependency>
      <groupId>org.apache.poi</groupId>
      <artifactId>poi</artifactId>
      <version>4.1.2</version>
    </dependency>
    <dependency>
      <groupId>mysql</groupId>
      <artifactId>mysql-connector-java</artifactId>
      <version>5.1.45</version>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>com.alibaba</groupId>
      <artifactId>druid</artifactId>
      <version>1.1.19</version>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-log4j12</artifactId>
      <version>1.7.25</version>
    </dependency>

    <! -- file upload part -->
    <dependency>
      <groupId>commons-fileupload</groupId>
      <artifactId>commons-fileupload</artifactId>
      <version>1.4</version>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-webmvc</artifactId>
      <version>${spring.version}</version>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-jdbc</artifactId>
      <version>${spring.version}</version>
    </dependency>
    <dependency>
      <groupId>org.aspectj</groupId>
      <artifactId>aspectjweaver</artifactId>
      <version>1.8.13</version>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-test</artifactId>
      <version>${spring.version}</version>
      <scope>test</scope>
    </dependency>

    <! -- Dependencies to integrate third-party libraries like Freemarker into the Spring application context -->
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-context-support</artifactId>
      <version>${spring.version}</version>
    </dependency>

    <dependency>
      <groupId>com.github.pagehelper</groupId>
      <artifactId>pagehelper</artifactId>
      <version>5.1.2</version>
    </dependency>

    <! -- https://mvnrepository.com/artifact/com.alibaba/fastjson -->
    <dependency>
      <groupId>com.alibaba</groupId>
      <artifactId>fastjson</artifactId>
      <version>1.2.73</version>
    </dependency>

    <! -- https://mvnrepository.com/artifact/javax.servlet/jstl -->
    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>jstl</artifactId>
      <version>1.2</version>
    </dependency>


    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-databind</artifactId>
      <version>2.9.6</version>
    </dependency>

    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-core</artifactId>
      <version>2.9.6</version>
    </dependency>

    <! -- https://mvnrepository.com/artifact/org.apache.commons/commons-email -->
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-email</artifactId>
      <version>1.5</version>
    </dependency>


    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-annotations</artifactId>
      <version>2.9.6</version>
    </dependency>

    <dependency>
      <groupId>org.freemarker</groupId>
      <artifactId>freemarker</artifactId>
      <version>2.3.23</version>
    </dependency>

    <dependency>
      <groupId>com.alibaba</groupId>
      <artifactId>fastjson</artifactId>
      <version>1.2.73</version>
    </dependency>

    <! -- https://mvnrepository.com/artifact/io.springfox/springfox-swagger2 -->
    <dependency>
      <groupId>io.springfox</groupId>
      <artifactId>springfox-swagger2</artifactId>
      <version>2.9.2</version>
    </dependency>
    <! -- https://mvnrepository.com/artifact/io.springfox/springfox-swagger-ui -->
    <dependency>
      <groupId>io.springfox</groupId>
      <artifactId>springfox-swagger-ui</artifactId>
      <version>2.9.2</version>
    </dependency>

    <dependency>
      <groupId>org.projectlombok</groupId>
      <artifactId>lombok</artifactId>
      <version>1.16.22</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>javax.servlet-api</artifactId>
      <version>3.0.1</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.12</version>
    </dependency>

    <dependency>
      <groupId>org.apache.taglibs</groupId>
      <artifactId>taglibs-standard-spec</artifactId>
      <version>1.2.5</version>
    </dependency>
    <dependency>
      <groupId>org.apache.taglibs</groupId>
      <artifactId>taglibs-standard-impl</artifactId>
      <version>1.2.5</version>
    </dependency>

    <dependency>
      <groupId>com.aliyun</groupId>
      <artifactId>aliyun-java-sdk-core</artifactId>
      <version>3.3.1</version>
    </dependency>
    <dependency>
      <groupId>com.aliyun</groupId>
      <artifactId>aliyun-java-sdk-dysmsapi</artifactId>
      <version>1.0.0</version>
    </dependency>


    <dependency>
      <groupId>cn.hutool</groupId>
      <artifactId>hutool-all</artifactId>
      <version>5.6.0</version>
    </dependency>

  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.tomcat.maven</groupId>
        <artifactId>tomcat7-maven-plugin</artifactId>
        <version>2.1</version>
        <configuration>
          <port>8080</port>
          <path>/</path>
          <uriEncoding>UTF-8</uriEncoding>
          <server>tomcat7</server>
        </configuration>
      </plugin>
    </plugins>
  </build>
Copy the code

🥪3.2 establishment of SSM project

Learned the SSM project friends all know that SSM project is the most complicated part is his profile, all sorts of fancy configuration file it’s really hard to remember, so my advice is to prepare a general template, can take out at any time when needed (although may now can’t use SSM to build most of the enterprise, But there may be old projects). I give a general here, do not need you to remember, but see the need to immediately reflect, his line of configuration configuration is what.

🌯 3.2.1, db. The properties

The db.properties configuration file is used to write the four elements of our database, and we extracted these configurations into a configuration file for easy modification.

jdbc.driverClassName=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql:///ssm_carbusiness? characterEncoding=utf-8& useSSL=false
jdbc.username=root
jdbc.password=1101121833
Copy the code

🍗 3.2.2, spring. XML

Spring. XML is the core configuration file of Spring. It mainly configudes some configurations of associated database files and beans.


      
<beans xmlns="http://www.springframework.org/schema/beans"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:context="http://www.springframework.org/schema/context"
  xmlns:aop="http://www.springframework.org/schema/aop"
  xmlns:tx="http://www.springframework.org/schema/tx"
  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd">


  <! Db.properties file -->
  <context:property-placeholder location="classpath:db.properties"/>
  <! DataSource bean -->
  <bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource"
    init-method="init"
    destroy-method="close">
    <property name="driverClassName" value="${jdbc.driverClassName}"/>
    <property name="url" value="${jdbc.url}"/>
    <property name="username" value="${jdbc.username}"/>
    <property name="password" value="${jdbc.password}"/>
  </bean>
  <! SqlSessionFactory bean -->
  <bean class="org.mybatis.spring.SqlSessionFactoryBean" id="sqlSessionFactory">
    <property name="dataSource" ref="dataSource"/>
    <property name="typeAliasesPackage" value="cn.linstudy.domain"/>
    <property name="mapperLocations" value="classpath:cn/linstudy/mapper/*.xml"/>
    <! -- Notice other configuration -->
    <property name="plugins">
      <array>
        <bean class="com.github.pagehelper.PageInterceptor">
          <property name="properties">
            <! -- Configure the parameters as follows, one in a row, with rationalization pages -->
            <value>
              pageSizeZero=true
              reasonable=true
            </value>
          </property>
        </bean>
      </array>
    </property>
  </bean>


  <! SqlSessionFactory bean -->

  <! -- Associate master configuration file can not be configured at present -->
  <! If you do not need an alias, do not configure it -->
  <! -- Configure data source -->
  <! Mapper XML file can be compiled with Mapper interface bytecode file and Mapper XML file name.

  <! Mapper interface implementation object -->
  <! Mapper interface package -->
  <bean id="mapperScannerConfigurer" class="org.mybatis.spring.mapper.MapperScannerConfigurer">
    <property name="basePackage" value="cn.linstudy.mapper"/>
  </bean>

  <! Configure the IoC DI annotation parser, let Spring help us create the implementation class object of the business interface, complete the field injection.
  <context:component-scan base-package="cn.linstudy.service"/>


  <! -- Configure transaction manager WHAT-->
  <bean class="org.springframework.jdbc.datasource.DataSourceTransactionManager"
    id="transactionManager">
    <property name="dataSource" ref="dataSource"/>
  </bean>


  <! -- configure the enhancement, WHEN, and associate it with WHAT-->
  <tx:advice id="interceptor" transaction-manager="transactionManager">
    <tx:attributes>
      <tx:method name="get" read-only="true"/>
      <tx:method name="select" read-only="true"/>
      <tx:method name="list" read-only="true"/>
      <tx:method name="query" read-only="true"/>
      <tx:method name="count" read-only="true"/>
      <tx:method name="*"/>
    </tx:attributes>
  </tx:advice>
  <! Configure AOP -->
  <aop:config>
    <aop:pointcut id="txPoint"
      expression="execution(* cn.linstudy.service.impl.*ServiceImpl.*(..) )"/>
    <aop:advisor advice-ref="interceptor" pointcut-ref="txPoint"/>
  </aop:config>
  <! -- WHERE -->
  <! Select * from 'WHERE' -->

  <! -- Enable Shiro annotation scan -->
  <aop:config/>

  <! The Pointcut Advisor notifier matches all methods annotated with Shiro permissions -->
  <bean class="org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor">
    <property name="securityManager" ref="securityManager"/>
  </bean>

</beans>
Copy the code

🥩 3.2.3, spring MVC. XML

Spring-mvc. XML is the core configuration file for SpringMVC. It mainly configurethe view parser and Freemarker configuration. If you don’t need the view parser configuration, you can remove the Freemarker configuration.


      
<beans xmlns="http://www.springframework.org/schema/beans"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:context="http://www.springframework.org/schema/context"
  xmlns:mvc="http://www.springframework.org/schema/mvc"
  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd">


  <! -- IoC DI annotation parser configure scan controller speak human, let Spring create controller object for us, and inject -->
  <context:component-scan base-package="cn.linstudy"/>
  <! Configure MVC annotation parser, time annotation, JSON annotation -->
  <mvc:annotation-driven/>
  <mvc:default-servlet-handler/>
  <mvc:interceptors>
    <mvc:interceptor>
      <! Static resource and dynamic resource interception -->
      <mvc:mapping path="/ * *"/>
      <mvc:exclude-mapping path="/getImage"/>
      <mvc:exclude-mapping path="/empLogin"/>
      <mvc:exclude-mapping path="/getEmailCode"/>
      <mvc:exclude-mapping path="/checkEmail"/>
      <mvc:exclude-mapping path="/checkUsername"/>
      <mvc:exclude-mapping path="/error"/>
      <mvc:exclude-mapping path="/checkEmailIsHave"/>
      <mvc:exclude-mapping path="/fronted/**"/>
      <bean class="cn.linstudy.interceptor.CheckLoginInterceptor"/>
    </mvc:interceptor>

  </mvc:interceptors>
  <mvc:default-servlet-handler/>
  <! -- Register FreeMarker configuration class -->
  <bean class="cn.linstudy.shiro.ShiroFreeMarkerConfig">
    <! -- Configure FreeMarker's file code -->
    <property name="defaultEncoding" value="UTF-8"/>
    <! Configure FreeMarker's path to find templates -->
    <property name="templateLoaderPath" value="/WEB-INF/views/"/>
    <property name="freemarkerSettings">
      <props>
        <! -- Compatible mode, does not need to deal with the null value problem, except the time format -->
        <prop key="classic_compatible">true</prop>
        <! -- Numeric formatting, no strings -->
        <prop key="number_format">0. # #</prop>
      </props>
    </property>
  </bean>

  <! FreeMarker view resolver -->
  <bean class="org.springframework.web.servlet.view.freemarker.FreeMarkerViewResolver">
    <! -- Whether to copy session attributes into the template's attribute set, which can be accessed using FreeMarker's expression and displayed -->
    <property name="exposeSessionAttributes" value="true"/>
    <! -- Configure the logical view to automatically add suffix name -->
    <property name="suffix" value=".ftl"/>
    <! -- Set content-type in response header -->
    <property name="contentType" value="text/html; charset=UTF-8"/>
  </bean>
  <! -- File upload resolver id must be multipartResolver-->
  <bean id="multipartResolver"
    class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
    <! -- Maximum upload file size 10M-->
    <property name="maxUploadSize" value="# {1024 * 1024 * 10}"/>
  </bean>
  <! Spring.xml -->
  <import resource="classpath:spring.xml"/>

  <! -- Import shiro configuration file -->
  <import resource="classpath:shiro.xml"/>


</beans>
Copy the code

🍖 3.2.4, mybatis config. XML

Mybatis -config. XML is a global configuration file, which controls the core behavior of Mybatis, such as the configuration of the paging plug-in, currently we do not need to write a shelf empty there.


      
<! DOCTYPEconfiguration
  PUBLIC "- / / mybatis.org//DTD Config / 3.0 / EN"
  "http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
</configuration>
Copy the code

🥟 3.2.5, log4j properties

The log4j.properties configuration file is mainly used to configure our log-related information, so that it is more reasonable to display it on the console, so that we can easily view and troubleshoot.

# Global logging configuration
log4j.rootLogger=ERROR, stdout

log4j.logger.cn=TRACE
# Console output...
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%5p [%t] - %m%n
Copy the code

🍠 3.2.5, summary

By now, our SSM project has been completely built and we have officially started to write the project