/*
 Navicat Premium Data Transfer

 Source Server         : localhost MySQL 8.0 123456
 Source Server Type    : MySQL
 Source Server Version : 80012
 Source Host           : localhost:3306
 Source Schema         : epp

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

 Date: 18/03/2023 21:36:40
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for apply1
-- ----------------------------
DROP TABLE IF EXISTS `apply1`;
CREATE TABLE `apply1`  (
  `id` int NOT NULL AUTO_INCREMENT,
  `stu_id` int NULL DEFAULT NULL COMMENT '用户id',
  `issue` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '申请事由',
  `transport` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '出行方式',
  `place` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '目的地',
  `start_time` datetime NULL DEFAULT NULL COMMENT '开始时间',
  `end_time` datetime NULL DEFAULT NULL COMMENT '结束时间',
  `state` int NULL DEFAULT 0 COMMENT '状态(0:审批中,1:通过,2:驳回)',
  `reason` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '驳回原因',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 12 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of apply1
-- ----------------------------
INSERT INTO `apply1` VALUES (1, 1, '11', '飞机', '33', '2022-02-15 11:20:00', '2022-02-15 13:20:00', 2, '格式错误');
INSERT INTO `apply1` VALUES (2, 2, '333', '大巴', '333', '2022-02-15 11:51:00', '2022-02-15 13:51:00', 1, '');
INSERT INTO `apply1` VALUES (3, 2, '333', '大巴', '333', '2022-02-15 11:51:00', '2022-02-15 13:51:00', 2, '格式错误');
INSERT INTO `apply1` VALUES (4, 2, '1', '动车', '2', '2022-03-12 13:45:00', '2022-03-12 15:45:00', 1, '');
INSERT INTO `apply1` VALUES (5, 2, '11', '飞机', '22', '2022-03-12 20:29:00', '2022-03-12 22:29:00', 1, '');
INSERT INTO `apply1` VALUES (6, 1, '123', '飞机', '123', '2022-03-19 13:37:00', '2022-03-19 15:37:00', 1, '');
INSERT INTO `apply1` VALUES (9, 10, '1', '飞机', '1', '2022-06-15 10:41:00', '2022-06-15 12:41:00', 1, '');
INSERT INTO `apply1` VALUES (10, 12, '1', '飞机', '1', '2022-06-15 10:53:00', '2022-06-15 12:53:00', 2, '格式错误');
INSERT INTO `apply1` VALUES (11, 2, '1', '飞机', '1', '2022-10-23 16:17:00', '2022-10-23 18:17:00', 1, '');
INSERT INTO `apply1` VALUES (12, 13, '1', '飞机', '1', '2022-10-26 19:25:00', '2022-10-26 21:25:00', 1, '');

-- ----------------------------
-- Table structure for count1
-- ----------------------------
DROP TABLE IF EXISTS `count1`;
CREATE TABLE `count1`  (
  `date` date NOT NULL COMMENT '日期',
  `time` datetime NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '时间',
  `in_num` int NULL DEFAULT NULL COMMENT '入校人数',
  `out_num` int NULL DEFAULT NULL COMMENT '出校人数',
  PRIMARY KEY (`date`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of count1
-- ----------------------------

-- ----------------------------
-- Table structure for feedback1
-- ----------------------------
DROP TABLE IF EXISTS `feedback1`;
CREATE TABLE `feedback1`  (
  `id` int NOT NULL AUTO_INCREMENT,
  `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '反馈标题',
  `content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '反馈内容',
  `time` datetime NULL DEFAULT NULL COMMENT '反馈时间',
  `user_id` int NULL DEFAULT NULL COMMENT '反馈用户id',
  `reply` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '回复',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of feedback1
-- ----------------------------
INSERT INTO `feedback1` VALUES (1, '111', '222', '2022-02-14 10:18:29', 1, '22');
INSERT INTO `feedback1` VALUES (2, '111', '222', '2022-02-14 10:20:05', 1, '33');
INSERT INTO `feedback1` VALUES (3, '22', '33', '2022-02-14 10:20:29', 1, 'no');
INSERT INTO `feedback1` VALUES (4, '``', '11', '2022-02-14 10:22:12', 1, '111');
INSERT INTO `feedback1` VALUES (5, '123', '123456', '2022-03-28 19:34:04', 2, NULL);

-- ----------------------------
-- Table structure for goods
-- ----------------------------
DROP TABLE IF EXISTS `goods`;
CREATE TABLE `goods`  (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `goods_name` varchar(127) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '商品名称',
  `category_id` int NULL DEFAULT 0 COMMENT '商品所属类目ID',
  `brand` int NULL DEFAULT 0 COMMENT '商品品牌',
  `gallery` varchar(1023) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '商品宣传图片列表，采用JSON数组格式',
  `brief` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '商品简介',
  `is_on_sale` tinyint(1) NULL DEFAULT 1 COMMENT '是否上架 0为下架 1为上架',
  `sort_order` smallint NULL DEFAULT 100 COMMENT '排序',
  `pic_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '商品页面商品图片',
  `type` tinyint(1) NULL DEFAULT 0 COMMENT '商品类型',
  `unit` varchar(31) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '件' COMMENT '商品单位，例如件、盒',
  `counter_price` decimal(10, 2) NULL DEFAULT 0.00 COMMENT '专柜价格（原价 / 划线价）',
  `retail_price` decimal(10, 2) NULL DEFAULT 100000.00 COMMENT '零售价格（售价 / 未划线价）',
  `detail` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '商品详细介绍，是富文本格式',
  `deleted` tinyint(1) NULL DEFAULT 0 COMMENT '逻辑删除 0为正常 1为删除',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `category_id`(`category_id`) USING BTREE,
  INDEX `brand_id`(`brand`) USING BTREE,
  INDEX `sort_order`(`sort_order`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '商品基本信息表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of goods
-- ----------------------------
INSERT INTO `goods` VALUES (1, '口罩', 3, 0, NULL, '', 1, 100, 'https://cdn-we-retail.ym.tencent.com/tsr/goods/gh-2b.png?imageMogr2/thumbnail/320x320/quality/70/strip/format/webp', 0, '件', 20.00, 48.00, NULL, 0);
INSERT INTO `goods` VALUES (2, '水银温度计', 3, 0, NULL, '医用玻璃水银体温计腋下温度计家用成人儿童婴儿口腔发烧探热针', 1, 200, 'https://cdn-we-retail.ym.tencent.com/tsr/goods/muy-3a.png?imageMogr2/thumbnail/320x320/quality/70/strip/format/webp', 0, '件', 59.90, 66.90, NULL, 0);

-- ----------------------------
-- Table structure for goods_category
-- ----------------------------
DROP TABLE IF EXISTS `goods_category`;
CREATE TABLE `goods_category`  (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `category_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '商品分类名',
  `order` int NULL DEFAULT NULL COMMENT '排序',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of goods_category
-- ----------------------------
INSERT INTO `goods_category` VALUES (1, '水果蔬菜', 1);
INSERT INTO `goods_category` VALUES (2, '日用品', 2);
INSERT INTO `goods_category` VALUES (3, '药品', 4);
INSERT INTO `goods_category` VALUES (4, '防疫物资', 3);
INSERT INTO `goods_category` VALUES (5, '零食', 5);

-- ----------------------------
-- Table structure for notice1
-- ----------------------------
DROP TABLE IF EXISTS `notice1`;
CREATE TABLE `notice1`  (
  `id` int NOT NULL AUTO_INCREMENT,
  `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标题',
  `content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '内容',
  `time` date NULL DEFAULT NULL COMMENT '时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 9 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of notice1
-- ----------------------------
INSERT INTO `notice1` VALUES (1, '请各位学生戴好口罩', NULL, '2022-03-15');
INSERT INTO `notice1` VALUES (2, '请各位学生不要随意出入校门', NULL, '2022-03-15');
INSERT INTO `notice1` VALUES (7, '11', '22', '2022-03-22');
INSERT INTO `notice1` VALUES (8, '22', '22', '2022-04-14');
INSERT INTO `notice1` VALUES (9, '33', '33', '2022-04-14');

-- ----------------------------
-- Table structure for report
-- ----------------------------
DROP TABLE IF EXISTS `report`;
CREATE TABLE `report`  (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NULL DEFAULT NULL COMMENT '用户id',
  `name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '姓名',
  `time` datetime NULL DEFAULT NULL COMMENT '填报时间',
  `temperature` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '体温是否正常',
  `address` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '地址',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 58 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of report
-- ----------------------------
INSERT INTO `report` VALUES (53, 1, '管理员 密码root', '2022-12-26 20:35:38', '1', '湖北省武汉市洪山区文治街南湖雅园(洪山区信访局对面)');
INSERT INTO `report` VALUES (55, 1, '管理员 密码root', '2022-12-27 21:03:24', '0', '湖北省武汉市洪山区文治街508号南湖雅园F栋2-104号');
INSERT INTO `report` VALUES (57, 1, '管理员 密码root', '2022-12-28 21:47:57', '0', '湖北省武汉市洪山区文治街南湖雅园(洪山区信访局对面)');
INSERT INTO `report` VALUES (58, 1, '管理员 密码root', '2022-12-29 18:20:00', '1', '湖北省武汉市洪山区鲁磨路209号');

-- ----------------------------
-- Table structure for setting
-- ----------------------------
DROP TABLE IF EXISTS `setting`;
CREATE TABLE `setting`  (
  `key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `value` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `time` datetime NOT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间或失效时间（具体根据key来判断）',
  UNIQUE INDEX `key`(`key`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of setting
-- ----------------------------

-- ----------------------------
-- Table structure for user
-- ----------------------------
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user`  (
  `id` int NOT NULL AUTO_INCREMENT,
  `username` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '用户名',
  `password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '密码',
  `realname` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '真实姓名',
  `id_number` varchar(18) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '身份证号',
  `phone_number` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '手机号',
  `role` int NOT NULL COMMENT '角色 (0-超级管理员 1-工作人员 2-社区居民_房主 3-社区居民_家庭成员 4-社区居民_租客 5-访客)',
  `building_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '门栋号+单元号',
  `doorplate` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '门牌号',
  `permission` int NOT NULL DEFAULT 0 COMMENT '进出权限 (0-无 1-继承(普通居民) 2-永久 3-限时)',
  `permission_time` datetime NULL DEFAULT NULL COMMENT '进出权限失效时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of user
-- ----------------------------
INSERT INTO `user` VALUES (1, 'root', '99adc231b045331e514a516b4b7680f588e3823213abe901738bc3ad67b2f6fcb3c64efb93d18002588d3ccc1a49efbae1ce20cb43df36b38651f11fa75678e8', '管理员 密码root', '420111111111111111', NULL, 2, NULL, NULL, 0, NULL);
INSERT INTO `user` VALUES (2, 'lhz', 'lhz', '廖鸿志', NULL, NULL, 2, NULL, NULL, 0, NULL);
INSERT INTO `user` VALUES (3, '21180000', '21180000', '李', NULL, NULL, 2, NULL, NULL, 0, NULL);
INSERT INTO `user` VALUES (4, '211', '211', '11', NULL, NULL, 2, NULL, NULL, 0, NULL);
INSERT INTO `user` VALUES (5, '2111', '2111', '111', NULL, NULL, 1, NULL, NULL, 0, NULL);
INSERT INTO `user` VALUES (6, '222', '222', '33', NULL, NULL, 2, NULL, NULL, 0, NULL);
INSERT INTO `user` VALUES (7, '33', '33', '44', NULL, NULL, 2, NULL, NULL, 0, NULL);
INSERT INTO `user` VALUES (8, 'test', '1', 'test', NULL, NULL, 3, NULL, NULL, 0, NULL);
INSERT INTO `user` VALUES (9, '123456', '123456', '123456', NULL, NULL, 2, NULL, NULL, 0, NULL);
INSERT INTO `user` VALUES (10, '211806336', '211806336', '211806336', NULL, NULL, 2, NULL, NULL, 0, NULL);
INSERT INTO `user` VALUES (11, '001', '001', '老师', NULL, NULL, 1, NULL, NULL, 0, NULL);
INSERT INTO `user` VALUES (12, '002', '002', '刘鸿宇', NULL, NULL, 2, NULL, NULL, 0, NULL);
INSERT INTO `user` VALUES (13, 'z', 'zz', 'z', NULL, NULL, 2, NULL, NULL, 0, NULL);
INSERT INTO `user` VALUES (14, '111', '222', '222', NULL, NULL, 222, NULL, NULL, 0, NULL);
INSERT INTO `user` VALUES (15, '222', '222', '222', NULL, NULL, 222, NULL, NULL, 0, NULL);
INSERT INTO `user` VALUES (16, '222', '222', '222', NULL, NULL, 222, NULL, NULL, 0, NULL);
INSERT INTO `user` VALUES (17, '111111111111', '111111111111', '111111111111', NULL, NULL, 2, NULL, NULL, 0, NULL);
INSERT INTO `user` VALUES (18, '12', '12', '12', NULL, NULL, 2, NULL, NULL, 0, NULL);
INSERT INTO `user` VALUES (19, '210602212109', '210602212109', '曾子华', NULL, NULL, 2, NULL, NULL, 0, NULL);
INSERT INTO `user` VALUES (20, 'undefined', 'undefined', '信息2121', NULL, NULL, 2, NULL, NULL, 0, NULL);
INSERT INTO `user` VALUES (21, '2', '2', '曾', NULL, NULL, 2, NULL, NULL, 0, NULL);

-- ----------------------------
-- Table structure for visitor1
-- ----------------------------
DROP TABLE IF EXISTS `visitor1`;
CREATE TABLE `visitor1`  (
  `id` int NOT NULL AUTO_INCREMENT,
  `time` datetime NULL DEFAULT NULL COMMENT '预约时间',
  `phone` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '预约用户id',
  `issue` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '预约事由',
  `meet_name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '会见人姓名',
  `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
  `state` int NULL DEFAULT 0 COMMENT '状态（0：审批中，1：成功，2：驳回）',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 14 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of visitor1
-- ----------------------------
INSERT INTO `visitor1` VALUES (1, '2022-03-09 09:46:50', '136', NULL, NULL, NULL, 1);
INSERT INTO `visitor1` VALUES (2, '2022-03-09 00:00:00', '1', '2', '王老师', NULL, 1);
INSERT INTO `visitor1` VALUES (3, '2022-03-13 00:00:00', '123', '123', '123', NULL, 1);
INSERT INTO `visitor1` VALUES (4, '2022-03-17 00:00:00', '183', '11', '1111', NULL, 1);
INSERT INTO `visitor1` VALUES (5, '2022-03-20 07:00:00', '15555150781', '测试', '王德发', NULL, 1);
INSERT INTO `visitor1` VALUES (6, '2022-03-20 07:00:00', '15555150782', '测试', '王德发', NULL, 1);
INSERT INTO `visitor1` VALUES (7, '2022-03-20 00:00:00', '12345', '返校', '自己', NULL, 1);
INSERT INTO `visitor1` VALUES (8, '2022-03-21 00:00:00', '1', '1', '1', NULL, 1);
INSERT INTO `visitor1` VALUES (9, '2022-03-22 00:00:00', '11', '11', '1', NULL, 1);
INSERT INTO `visitor1` VALUES (10, '2022-03-22 00:00:00', '183', '1', '123', NULL, 1);
INSERT INTO `visitor1` VALUES (11, '2022-04-20 00:00:00', '19851691582', '看吧', '哈哈', NULL, 0);
INSERT INTO `visitor1` VALUES (12, '2022-04-26 00:00:00', '18835381168', 'jin', 'zhang ', NULL, 0);
INSERT INTO `visitor1` VALUES (13, '2022-06-15 00:00:00', '18250314786', '1', '1', NULL, 1);
INSERT INTO `visitor1` VALUES (14, '2022-10-08 00:00:00', '151000', '入校', '王龙', NULL, 0);

SET FOREIGN_KEY_CHECKS = 1;
