/*
 Navicat Premium Data Transfer

 Source Server         : myDatabase
 Source Server Type    : MySQL
 Source Server Version : 80023
 Source Host           : localhost:3306
 Source Schema         : flower

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

 Date: 15/06/2024 20:54:46
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for address
-- ----------------------------
DROP TABLE IF EXISTS `address`;
CREATE TABLE `address` (
  `address_id` int NOT NULL AUTO_INCREMENT COMMENT '地址id',
  `user_id` int NOT NULL COMMENT '用户id',
  `address_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '收货人',
  `address_sheng` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '地址（省）',
  `address_shi` varchar(255) NOT NULL COMMENT '地址（市）',
  `address_qu` varchar(255) NOT NULL COMMENT '地址（区）',
  `address_detail` varchar(255) NOT NULL COMMENT '详细地址',
  `address_phone` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '联系电话',
  PRIMARY KEY (`address_id`),
  KEY `user_id` (`user_id`),
  CONSTRAINT `address_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='地址表';

-- ----------------------------
-- Records of address
-- ----------------------------
BEGIN;
INSERT INTO `address` VALUES (1, 100001, 'zy', '', '北京市', '朝阳区', '日坛北街33号', '13782298153');
INSERT INTO `address` VALUES (8, 100001, '小张', '山东省', '滨州市', '滨城区', '彭李街道府后街221号国土馨苑', '13011795597');
INSERT INTO `address` VALUES (12, 100001, '小张', '山东省', '济南市', '历城区', '港沟街道舜华路1500号山东大学软件园校区', '13011795597');
INSERT INTO `address` VALUES (14, 100002, 'zjm', ' 山东省', '滨州市', '无棣县', '府前街234号', '13754323398');
COMMIT;

-- ----------------------------
-- Table structure for cart
-- ----------------------------
DROP TABLE IF EXISTS `cart`;
CREATE TABLE `cart` (
  `cart_id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL COMMENT '用户id',
  `flower_id` int NOT NULL COMMENT '花卉id',
  `pack_ids` varchar(255) DEFAULT NULL COMMENT '包装id数组',
  `number` int NOT NULL COMMENT '花卉数量',
  PRIMARY KEY (`cart_id`) USING BTREE,
  KEY `user_id` (`user_id`),
  KEY `flower_id` (`flower_id`),
  CONSTRAINT `cart_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `cart_ibfk_2` FOREIGN KEY (`flower_id`) REFERENCES `flower` (`flower_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=100033 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='购物车表';

-- ----------------------------
-- Records of cart
-- ----------------------------
BEGIN;
INSERT INTO `cart` VALUES (100005, 100002, 10004, '7', 2);
INSERT INTO `cart` VALUES (100011, 100001, 10037, '1', 1);
COMMIT;

-- ----------------------------
-- Table structure for chatuser
-- ----------------------------
DROP TABLE IF EXISTS `chatuser`;
CREATE TABLE `chatuser` (
  `id` int NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '姓名',
  `password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '密码',
  `sex` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '性别',
  `age` int DEFAULT NULL COMMENT '年龄',
  `phone` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '电话',
  `role` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '角色',
  `avatar` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '头像',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=100003 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='聊天用户信息表';

-- ----------------------------
-- Records of chatuser
-- ----------------------------
BEGIN;
INSERT INTO `chatuser` VALUES (10001, 'admin', '123', '女', 22, '13011795597', 'ADMIN', NULL);
INSERT INTO `chatuser` VALUES (100001, 'zhang', '123', '女', 22, '13011795597', 'USER', NULL);
INSERT INTO `chatuser` VALUES (100002, 'wang', '123', '男', 23, '12334567889', 'USER', NULL);
COMMIT;

-- ----------------------------
-- Table structure for class
-- ----------------------------
DROP TABLE IF EXISTS `class`;
CREATE TABLE `class` (
  `class_id` int NOT NULL AUTO_INCREMENT COMMENT '类别id',
  `class_name` varchar(255) NOT NULL COMMENT '类别名称',
  PRIMARY KEY (`class_id`)
) ENGINE=InnoDB AUTO_INCREMENT=100039 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='类别表';

-- ----------------------------
-- Records of class
-- ----------------------------
BEGIN;
INSERT INTO `class` VALUES (100001, '玫瑰爱情鲜花花束');
INSERT INTO `class` VALUES (100002, '康乃馨节日长辈鲜花花束');
INSERT INTO `class` VALUES (100003, '向日葵友情节日长辈鲜花花束');
INSERT INTO `class` VALUES (100006, '玩偶花束爱情鲜花');
INSERT INTO `class` VALUES (100016, '永生花瓶花');
INSERT INTO `class` VALUES (100018, '商务开业鲜花花篮');
INSERT INTO `class` VALUES (100020, '生日鲜花花束');
INSERT INTO `class` VALUES (100033, '节日鲜花花篮花束');
INSERT INTO `class` VALUES (100034, '商务会议鲜花桌花');
INSERT INTO `class` VALUES (100035, '探病慰问鲜花花篮花束');
INSERT INTO `class` VALUES (100036, '婚庆鲜花花篮');
INSERT INTO `class` VALUES (100037, '日常花篮手提花篮');
INSERT INTO `class` VALUES (100038, '花盒');
COMMIT;

-- ----------------------------
-- Table structure for comment
-- ----------------------------
DROP TABLE IF EXISTS `comment`;
CREATE TABLE `comment` (
  `comment_id` int NOT NULL AUTO_INCREMENT COMMENT '评论id',
  `flower_id` int DEFAULT NULL COMMENT '商品id',
  `user_id` int NOT NULL COMMENT '评论人id',
  `comment_content` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '评论内容',
  `comment_time` datetime DEFAULT NULL COMMENT '评论时间',
  PRIMARY KEY (`comment_id`),
  KEY `user_id` (`user_id`),
  KEY `flower_id` (`flower_id`),
  CONSTRAINT `comment_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `comment_ibfk_2` FOREIGN KEY (`flower_id`) REFERENCES `flower` (`flower_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='评论表';

-- ----------------------------
-- Records of comment
-- ----------------------------
BEGIN;
INSERT INTO `comment` VALUES (1, 10027, 100001, 'good!', '2024-03-21 17:17:03');
INSERT INTO `comment` VALUES (2, 10003, 100001, '非常好！', '2024-03-21 17:17:35');
INSERT INTO `comment` VALUES (3, 10027, 100001, '非常好，妈妈很喜欢', '2024-03-21 17:18:05');
INSERT INTO `comment` VALUES (5, 10033, 100001, '非常漂亮，孩子很喜欢！', '2024-05-19 20:17:33');
INSERT INTO `comment` VALUES (6, 10022, 100001, '鲜花非常漂亮，也非常新鲜，店铺很会搭配，适合送礼！', '2024-05-19 20:18:23');
INSERT INTO `comment` VALUES (7, 10022, 100002, 'good！', '2024-05-20 18:02:51');
INSERT INTO `comment` VALUES (8, 10022, 100003, '好', '2024-05-18 18:03:10');
INSERT INTO `comment` VALUES (9, 10022, 100005, '非常喜欢，花材搭配很用心', '2024-05-17 18:03:25');
INSERT INTO `comment` VALUES (10, 10022, 100008, '好，物流给力，花卉很新鲜', '2024-05-20 18:03:58');
INSERT INTO `comment` VALUES (11, 10022, 100001, '花卉很新鲜，在家里能放好几天呢', '2024-05-23 18:04:21');
INSERT INTO `comment` VALUES (12, 10022, 100001, 'good', '2024-05-20 18:12:29');
COMMIT;

-- ----------------------------
-- Table structure for discount
-- ----------------------------
DROP TABLE IF EXISTS `discount`;
CREATE TABLE `discount` (
  `discount_id` int NOT NULL AUTO_INCREMENT COMMENT '优惠套餐id',
  `discount_name` varchar(255) DEFAULT NULL COMMENT '优惠套餐名称',
  `discount_num` int NOT NULL COMMENT '折扣',
  `discount_f_id` int DEFAULT '0' COMMENT '优惠花卉id',
  `discount_c_id` int DEFAULT '0' COMMENT '优惠类别id',
  `discount_start_time` date NOT NULL COMMENT '优惠开始时间',
  `discount_end_time` date NOT NULL COMMENT '优惠结束时间',
  PRIMARY KEY (`discount_id`),
  KEY `discount_f_id` (`discount_f_id`),
  KEY `discount_c_id` (`discount_c_id`)
) ENGINE=InnoDB AUTO_INCREMENT=10023 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='折扣表';

-- ----------------------------
-- Records of discount
-- ----------------------------
BEGIN;
INSERT INTO `discount` VALUES (10002, '永生花圣诞新品特惠', 50, 10015, 0, '2023-12-24', '2023-12-25');
INSERT INTO `discount` VALUES (10003, '2024新年特惠', 85, 0, 0, '2024-02-10', '2024-02-16');
INSERT INTO `discount` VALUES (10005, '2024“爱你一世”情人节优惠套餐', 90, 0, 100001, '2024-02-14', '2024-02-14');
INSERT INTO `discount` VALUES (10006, '2024元宵节优惠', 80, 0, 100033, '2024-02-24', '2024-02-24');
INSERT INTO `discount` VALUES (10018, '2023情人节玫瑰特惠', 90, 0, 0, '2023-02-14', '2023-02-14');
INSERT INTO `discount` VALUES (10021, '商务大花篮单品促销', 60, 10019, 0, '2023-10-01', '2023-10-07');
INSERT INTO `discount` VALUES (10022, '会员折扣', 90, 0, 0, '2024-01-01', '2144-12-31');
COMMIT;

-- ----------------------------
-- Table structure for flower
-- ----------------------------
DROP TABLE IF EXISTS `flower`;
CREATE TABLE `flower` (
  `flower_id` int NOT NULL AUTO_INCREMENT COMMENT '花卉id',
  `flower_class` int NOT NULL COMMENT '花卉类别',
  `flower_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '花卉名称',
  `flower_price` double(10,2) NOT NULL COMMENT '花卉价格',
  `flower_pic` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '/10001/20240307123830248.jpg' COMMENT '花卉展示图',
  `flower_sale` int DEFAULT '0' COMMENT '花卉销量',
  PRIMARY KEY (`flower_id`),
  KEY `flower_class` (`flower_class`),
  CONSTRAINT `flower_ibfk_1` FOREIGN KEY (`flower_class`) REFERENCES `class` (`class_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=10063 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='花卉表';

-- ----------------------------
-- Records of flower
-- ----------------------------
BEGIN;
INSERT INTO `flower` VALUES (10001, 100001, 'Secret love倾慕鲜花系列12枝粉佳人玫瑰', 209.00, '/10001/20240307123300876.jpg', 92);
INSERT INTO `flower` VALUES (10002, 100001, 'Full love浓情鲜花系列52枝白玫瑰抱抱桶', 508.00, '/10001/20240307123346181.jpg', 26);
INSERT INTO `flower` VALUES (10003, 100002, 'Secret love倾慕鲜花系列5枝绿康乃馨+6枝白桔梗', 248.00, '/10001/20240307124254081.jpg', 64);
INSERT INTO `flower` VALUES (10004, 100002, 'Blessing祝福鲜花系列33枝粉康乃馨+白相思梅', 278.00, '/10001/20240307124409677.jpg', 35);
INSERT INTO `flower` VALUES (10005, 100003, 'Friendship挚友鲜花系列10枝向日葵+尤加利叶', 298.00, '/10001/20240307124520685.jpg', 50);
INSERT INTO `flower` VALUES (10006, 100003, 'Friendship挚友鲜花系列7枝向日葵+5枝白桔梗', 498.00, '/10001/20240307124655872.jpg', 35);
INSERT INTO `flower` VALUES (10015, 100016, 'Roselove永生花星座守护色-巨蟹座', 299.00, '/10001/20240307124739443.jpg', 37);
INSERT INTO `flower` VALUES (10019, 100018, '商务鲜花系列财源滚滚开业花篮', 588.00, '/10001/20240307124823324.jpg', 16);
INSERT INTO `flower` VALUES (10020, 100018, '商务鲜花系列生意兴隆开业花篮', 678.00, '/10001/20240307124920640.jpg', 16);
INSERT INTO `flower` VALUES (10021, 100001, 'Cherish珍爱鲜花系列33枝红玫瑰+红天竹', 208.00, '/10001/20240307123516564.jpg', 40);
INSERT INTO `flower` VALUES (10022, 100001, 'Secret love倾慕鲜花系列7枝粉玫瑰+乒乓菊', 258.00, '/10001/20240307123549006.jpg', 85);
INSERT INTO `flower` VALUES (10023, 100001, 'Cherish珍爱鲜花系列99枝白玫瑰纯恋', 828.00, '/10001/20240307123622259.jpg', 94);
INSERT INTO `flower` VALUES (10024, 100002, 'Relative亲情鲜花系列12枝粉康乃馨+白满天星', 158.00, '/10001/20240307124957843.jpg', 64);
INSERT INTO `flower` VALUES (10025, 100002, 'Relative亲情鲜花系列19枝红色康乃馨+白满天星', 218.00, '/10001/20240307125040461.jpg', 53);
INSERT INTO `flower` VALUES (10026, 100001, 'Cherish珍爱鲜花系列99枝红玫瑰', 578.00, '/10001/20240307123706102.jpg', 186);
INSERT INTO `flower` VALUES (10027, 100002, 'Relative亲情鲜花系列9枝紫红色康乃馨+10枝粉色多头康乃馨', 248.00, '/10001/20240307125112907.jpg', 69);
INSERT INTO `flower` VALUES (10028, 100002, 'Blessing祝福鲜花系列19枝绿康乃馨+白满天星', 218.00, '/10001/20240307125436769.jpg', 43);
INSERT INTO `flower` VALUES (10029, 100018, '商务鲜花系列向日葵陪伴开业花篮', 658.00, '/10001/20240307125659724.jpg', 12);
INSERT INTO `flower` VALUES (10030, 100018, '商务鲜花系列四通八达开业花篮', 498.00, '/10001/20240307125801595.jpg', 19);
INSERT INTO `flower` VALUES (10031, 100018, '商务鲜花系列简洁大气讲台花', 428.00, '/10001/20240307130403435.jpg', 20);
INSERT INTO `flower` VALUES (10032, 100018, '商务鲜花系列高端大气会议桌花', 328.00, '/10001/20240307130451138.jpg', 14);
INSERT INTO `flower` VALUES (10033, 100016, 'Eternal永恒系列蓝色妖姬永生花筒', 288.00, '/10001/20240307130600898.jpg', 49);
INSERT INTO `flower` VALUES (10034, 100016, 'Eternal永恒系列粉色心笺永生花高档礼盒', 288.00, '/10001/20240307130631223.jpg', 22);
INSERT INTO `flower` VALUES (10035, 100016, 'Eternal永恒系列永生花相爱小熊玻璃罩', 188.00, '/10001/20240307130715511.jpg', 45);
INSERT INTO `flower` VALUES (10036, 100016, 'Eternal永恒系列高端进口永生花礼盒', 520.00, '/10001/20240307130731690.jpg', 31);
INSERT INTO `flower` VALUES (10037, 100016, 'Eternal永恒系列水晶球蓝牙音箱永生花', 428.00, '/10001/20240307130743447.jpg', 16);
INSERT INTO `flower` VALUES (10062, 100001, 'Cherish珍爱系列七彩玫瑰', 998.00, '/10001/20240520174837773.jpg', 30);
COMMIT;

-- ----------------------------
-- Table structure for gift
-- ----------------------------
DROP TABLE IF EXISTS `gift`;
CREATE TABLE `gift` (
  `gift_id` int NOT NULL AUTO_INCREMENT COMMENT '赠品id',
  `gift_name` varchar(255) NOT NULL COMMENT '赠品名称',
  `gift_point` int NOT NULL COMMENT '赠品兑换积分',
  `gift_stock` int NOT NULL COMMENT '库存',
  `gift_pic` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '/10001/20240307123830248.jpg' COMMENT '展示图',
  PRIMARY KEY (`gift_id`)
) ENGINE=InnoDB AUTO_INCREMENT=10022 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='赠品表';

-- ----------------------------
-- Records of gift
-- ----------------------------
BEGIN;
INSERT INTO `gift` VALUES (10002, '迷你小型手持喷雾', 8000, 799, '/10002/20240307163620617.jpg');
INSERT INTO `gift` VALUES (10003, '星星藤线灯', 2000, 999, '/10002/20240307163724748.jpg');
INSERT INTO `gift` VALUES (10005, '旋转木马', 10000, 499, '/10002/20240307164110374.jpg');
INSERT INTO `gift` VALUES (10006, '卡通独角兽家居摆件', 5000, 999, '/10002/20240307164148754.jpg');
INSERT INTO `gift` VALUES (10007, '几何三角形珍珠耳钉', 3000, 300, '/10002/20240307164233154.jpg');
INSERT INTO `gift` VALUES (10008, '抱抱猴', 6000, 500, '/10002/20240307164300502.jpg');
INSERT INTO `gift` VALUES (10017, '火烈鸟装饰摆件', 4000, 600, '/10002/20240307164414614.jpg');
COMMIT;

-- ----------------------------
-- Table structure for imsingle
-- ----------------------------
DROP TABLE IF EXISTS `imsingle`;
CREATE TABLE `imsingle` (
  `id` int NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `content` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '内容',
  `fromuser` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '发送人',
  `fromavatar` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '发送人头像',
  `time` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '时间',
  `type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '类型',
  `touser` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '接收人',
  `toavatar` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '接收人头像',
  `readed` int DEFAULT '0' COMMENT '是否已读',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=36 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='单人聊天表';

-- ----------------------------
-- Records of imsingle
-- ----------------------------
BEGIN;
INSERT INTO `imsingle` VALUES (27, '你好！', 'USER_zhang', NULL, '2024-03-24 10:34:44', 'text', 'ADMIN_admin', '', 1);
INSERT INTO `imsingle` VALUES (33, '有什么需要帮助的？', 'ADMIN_admin', NULL, '2024-05-20 17:50:00', 'text', 'USER_zhang', NULL, 1);
INSERT INTO `imsingle` VALUES (35, '我想订制鲜花', 'USER_zhang', NULL, '2024-05-20 18:13:44', 'text', 'ADMIN_admin', '', 0);
COMMIT;

-- ----------------------------
-- Table structure for member
-- ----------------------------
DROP TABLE IF EXISTS `member`;
CREATE TABLE `member` (
  `member_id` int NOT NULL AUTO_INCREMENT COMMENT '充值订单id',
  `user_id` int NOT NULL COMMENT '用户id',
  `member_start_time` date NOT NULL COMMENT '会员充值时间',
  `member_end_time` date DEFAULT NULL COMMENT '会员截止日期',
  `member_period` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '本次充值时长',
  `member_money` double(255,2) NOT NULL COMMENT '充值金额',
  PRIMARY KEY (`member_id`) USING BTREE,
  KEY `user_id` (`user_id`),
  CONSTRAINT `member_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=10014 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='会员表';

-- ----------------------------
-- Records of member
-- ----------------------------
BEGIN;
INSERT INTO `member` VALUES (10001, 100001, '2024-01-01', '2025-01-01', '365', 180.00);
INSERT INTO `member` VALUES (10002, 100005, '2024-02-01', '2024-08-31', '151', 60.00);
INSERT INTO `member` VALUES (10003, 100008, '2024-01-01', '2024-06-30', '180', 90.00);
INSERT INTO `member` VALUES (10004, 100002, '2024-02-17', '2024-03-18', '30', 30.00);
INSERT INTO `member` VALUES (10005, 100005, '2024-08-01', '2024-08-31', '30', 30.00);
INSERT INTO `member` VALUES (10006, 100008, '2024-03-19', '2024-04-18', '30', 30.00);
INSERT INTO `member` VALUES (10013, 100001, '2025-01-01', '2026-01-01', '365', 360.00);
COMMIT;

-- ----------------------------
-- Table structure for notice
-- ----------------------------
DROP TABLE IF EXISTS `notice`;
CREATE TABLE `notice` (
  `notice_id` int NOT NULL AUTO_INCREMENT COMMENT '公告id',
  `notice_title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '公告标题',
  `notice_content` varchar(255) DEFAULT NULL COMMENT '公告内容',
  `notice_time` date NOT NULL COMMENT '公告发布时间',
  PRIMARY KEY (`notice_id`)
) ENGINE=InnoDB AUTO_INCREMENT=10006 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='公告表';

-- ----------------------------
-- Records of notice
-- ----------------------------
BEGIN;
INSERT INTO `notice` VALUES (10001, '十年诚信经营', '十年诚信经营，自成立以来，结婚鲜花定制订花网规模和影响力均位居结婚鲜花定制地区前列，销量在结婚鲜花定制鲜花店中名列前茅。我们深知每一张订单都蕴含重大的意义，视口碑为生命，多年来专注鲜花速递行业，以感恩心态服务每一位客户，收获客户、业界和社会的认可。', '2024-02-13');
INSERT INTO `notice` VALUES (10002, '1小时送花上门', '结婚鲜花定制网上订花服务，是结婚鲜花定制本地连锁花店，自有物流体系，专人专车送货上门，1小时快速送达。', '2024-02-15');
INSERT INTO `notice` VALUES (10003, '订单实拍看得见', '结婚鲜花定制鲜花成品花束实拍，满意后再配送，鲜花质量可验证，放心买花。在结婚鲜花定制鲜花店制作完成花束后拍照发送总部，对花材及鲜花成品层层把关，对鲜花品质验收后再配送。', '2024-02-15');
INSERT INTO `notice` VALUES (10005, '打造潮流新花束', '好花拥有获奖花艺师团队，精心设计的花束方能凸显您的品位不俗，更能得到佳人青睐。赋予鲜花以文化、艺术的魅力，不断推出有故事的创新花束，已经设计出超300多款花束，我们会持续引领结婚鲜花定制花艺潮流！', '2024-03-07');
COMMIT;

-- ----------------------------
-- Table structure for order
-- ----------------------------
DROP TABLE IF EXISTS `order`;
CREATE TABLE `order` (
  `order_id` int NOT NULL AUTO_INCREMENT COMMENT '订单id',
  `user_id` int NOT NULL COMMENT '订单所属用户id',
  `order_type` int DEFAULT NULL COMMENT '花卉订单0/礼品换赠订单1',
  `order_price` double(10,2) NOT NULL COMMENT '订单总金额',
  `order_delivery_number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '快递单号',
  `order_time` datetime DEFAULT NULL COMMENT '下单时间',
  `order_time_pay` datetime DEFAULT NULL COMMENT '支付时间',
  `order_time_delivery` datetime DEFAULT NULL COMMENT '发货时间',
  `order_time_receive` datetime DEFAULT NULL COMMENT '收货时间',
  `order_address` varchar(255) DEFAULT NULL COMMENT '地址',
  `order_phone` varchar(255) DEFAULT NULL COMMENT '联系电话',
  `order_state` int NOT NULL COMMENT '订单状态（待支付0/待发货1/待收货2/已收货3/已取消(待退款)4/已退款5）',
  `order_method` int NOT NULL COMMENT '配送方式（到店自取0/送货上门1）',
  `trans_fee` double(10,2) DEFAULT NULL COMMENT '运费',
  `order_discount` int DEFAULT NULL COMMENT '订单使用的优惠套餐id',
  `order_seen` int DEFAULT '1' COMMENT '订单是否可被用户看到（用户删除订单，不可见，0/可见1）',
  PRIMARY KEY (`order_id`),
  KEY `user_id` (`user_id`),
  KEY `order_discount` (`order_discount`),
  CONSTRAINT `order_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=100070 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='订单表';

-- ----------------------------
-- Records of order
-- ----------------------------
BEGIN;
INSERT INTO `order` VALUES (100002, 100003, 0, 69.00, NULL, '2024-02-16 17:28:28', '2024-02-16 17:28:29', '2024-02-16 18:28:34', '2024-02-17 20:28:49', '', '13792289715', 3, 0, 0.00, 0, 1);
INSERT INTO `order` VALUES (100003, 100008, 0, 50.00, '', '2024-02-19 17:47:24', '2024-02-19 17:47:25', '2024-02-20 19:13:58', '2024-02-20 19:20:47', '', '18799977653', 2, 0, 0.00, 0, 1);
INSERT INTO `order` VALUES (100004, 100001, 0, 66.00, 'SF199130201378', '2024-02-26 17:49:33', '2024-03-21 10:57:36', '2024-02-26 19:15:48', '2024-03-21 10:57:51', '山东省滨州市滨城区彭李街道国土馨苑', '13011795597', 3, 1, 5.00, 0, 1);
INSERT INTO `order` VALUES (100005, 100002, 0, 100.00, NULL, '2024-02-14 17:52:25', '2024-02-14 17:52:25', '2024-02-14 18:05:30', '2024-02-14 18:44:42', NULL, '13612345678', 3, 0, 0.00, 0, 1);
INSERT INTO `order` VALUES (100006, 100001, 0, 66.00, NULL, '2024-02-17 17:55:05', '2024-02-17 17:55:05', '2024-02-17 19:00:22', '2024-03-17 19:55:28', NULL, '13011795597', 3, 0, 0.00, 0, 0);
INSERT INTO `order` VALUES (100007, 100005, 0, 188.00, 'SF1234567896104', '2024-02-27 10:59:47', '2024-02-27 12:01:47', '2024-02-29 16:30:24', NULL, '山东省滨州市滨城区山东省北镇中学', '13098765678', 2, 1, 5.00, 0, 1);
INSERT INTO `order` VALUES (100008, 100001, 0, 128.00, NULL, '2024-02-17 18:00:34', '2024-02-18 19:21:10', '2024-02-18 19:21:19', '2024-02-20 19:21:27', NULL, '13567899876', 5, 0, 0.00, 0, 1);
INSERT INTO `order` VALUES (100030, 100001, 0, 507.30, 'SF123456789615', '2024-03-13 19:11:05', '2024-03-13 19:11:05', '2024-03-14 10:24:36', '2024-03-14 18:01:39', NULL, NULL, 3, 0, 0.00, 0, 1);
INSERT INTO `order` VALUES (100038, 100001, 0, 786.30, 'SF123456789', '2024-03-13 19:26:32', '2024-03-13 19:26:32', '2024-03-14 15:39:53', NULL, '山东省滨州市滨城区彭李街道府后街221号国土馨苑', '13011795597', 2, 1, 20.00, 0, 0);
INSERT INTO `order` VALUES (100039, 100001, 0, 376.60, '1', '2024-03-13 21:27:17', '2024-03-13 21:27:17', '2024-03-14 10:33:27', NULL, NULL, NULL, 2, 0, 0.00, 0, 0);
INSERT INTO `order` VALUES (100040, 100001, 0, 188.20, NULL, '2024-03-13 21:29:31', '2024-03-13 21:29:31', NULL, NULL, NULL, NULL, 1, 0, 0.00, 0, 1);
INSERT INTO `order` VALUES (100041, 100001, 0, 884.90, NULL, '2024-03-30 09:58:08', '2024-03-30 09:58:08', NULL, NULL, '山东省滨州市滨城区彭李街道府后街221号国土馨苑', '13011795597', 1, 1, 20.00, 0, 1);
INSERT INTO `order` VALUES (100050, 100001, 0, 998.40, 'SF1232614614', '2024-03-19 17:35:01', '2024-03-19 17:35:01', '2024-03-21 20:13:15', '2024-05-01 10:54:32', NULL, NULL, 3, 0, 0.00, 0, 1);
INSERT INTO `order` VALUES (100054, 100001, 1, 10000.00, NULL, '2024-03-20 16:34:43', '2024-03-21 10:59:39', NULL, '2024-03-21 10:59:49', '北京市朝阳区日坛北街33号', '13782298153', 1, 1, 20.00, 0, 1);
INSERT INTO `order` VALUES (100055, 100001, 1, 5000.00, NULL, '2024-03-20 20:36:06', '2024-03-20 20:36:06', NULL, NULL, NULL, NULL, 1, 0, 0.00, 0, 1);
INSERT INTO `order` VALUES (100056, 100001, 0, 578.00, NULL, '2024-04-29 10:33:47', '2024-04-29 10:33:47', '2024-04-29 11:24:44', '2024-04-29 12:07:50', NULL, NULL, 3, 0, 0.00, 0, 1);
INSERT INTO `order` VALUES (100060, 100001, 0, 319.00, NULL, '2024-04-29 10:59:16', '2024-04-29 10:59:16', NULL, NULL, '山东省滨州市滨城区彭李街道府后街221号国土馨苑', '13011795597', 1, 1, 20.00, 0, 1);
INSERT INTO `order` VALUES (100061, 100001, 0, 1070.00, NULL, '2024-04-29 10:59:17', '2024-04-29 10:59:17', NULL, NULL, '山东省滨州市滨城区彭李街道府后街221号国土馨苑', '13011795597', 1, 1, 20.00, 0, 1);
INSERT INTO `order` VALUES (100062, 100001, 0, 608.00, 'SF1234567', '2024-04-29 11:00:44', '2024-04-29 11:00:44', '2024-05-20 17:49:25', '2024-05-20 18:12:33', '北京市朝阳区日坛北街33号', '13782298153', 3, 1, 20.00, 0, 1);
INSERT INTO `order` VALUES (100063, 100001, 0, 288.00, '1', '2024-05-20 19:46:36', '2024-05-20 19:46:36', '2024-05-20 20:01:10', '2024-05-20 20:17:04', NULL, NULL, 3, 0, 0.00, 0, 1);
INSERT INTO `order` VALUES (100064, 100001, 0, 546.40, 'YT12347658900', '2024-05-19 19:46:52', '2024-05-19 19:46:52', '2024-05-19 20:01:37', '2024-05-19 20:17:07', '山东省济南市历城区港沟街道舜华路1500号山东大学软件园校区', '13011795597', 3, 1, 20.00, 0, 1);
INSERT INTO `order` VALUES (100065, 100001, 0, 546.00, NULL, '2024-05-20 18:07:49', '2024-05-20 18:07:49', NULL, NULL, '山东省济南市历城区港沟街道舜华路1500号山东大学软件园校区', '13011795597', 1, 1, 20.00, 0, 1);
INSERT INTO `order` VALUES (100066, 100001, 0, 660.35, NULL, '2024-05-20 18:07:49', '2024-05-20 18:07:49', NULL, NULL, '山东省济南市历城区港沟街道舜华路1500号山东大学软件园校区', '13011795597', 1, 1, 20.00, 0, 1);
INSERT INTO `order` VALUES (100067, 100001, 0, 283.80, NULL, '2024-05-20 18:12:06', '2024-05-20 18:12:06', NULL, NULL, '山东省济南市历城区港沟街道舜华路1500号山东大学软件园校区', '13011795597', 1, 1, 20.00, 0, 1);
INSERT INTO `order` VALUES (100068, 100001, 0, 1687.60, NULL, '2024-05-20 18:12:06', '2024-05-20 18:12:06', NULL, NULL, '山东省济南市历城区港沟街道舜华路1500号山东大学软件园校区', '13011795597', 1, 1, 20.00, 0, 1);
INSERT INTO `order` VALUES (100069, 100001, 1, 0.00, NULL, '2024-05-20 18:12:57', '2024-05-20 18:12:57', NULL, NULL, NULL, NULL, 1, 0, 0.00, 0, 1);
COMMIT;

-- ----------------------------
-- Table structure for order_detail_flower
-- ----------------------------
DROP TABLE IF EXISTS `order_detail_flower`;
CREATE TABLE `order_detail_flower` (
  `order_id` int NOT NULL COMMENT '订单id',
  `flower_id` int NOT NULL COMMENT '花卉id',
  `pack_ids` varchar(255) DEFAULT NULL COMMENT '包装id数组',
  `number` int NOT NULL COMMENT '花卉数量',
  PRIMARY KEY (`order_id`,`flower_id`),
  KEY `flower_id` (`flower_id`),
  CONSTRAINT `order_detail_flower_ibfk_1` FOREIGN KEY (`order_id`) REFERENCES `order` (`order_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `order_detail_flower_ibfk_2` FOREIGN KEY (`flower_id`) REFERENCES `flower` (`flower_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='花卉订单详情表';

-- ----------------------------
-- Records of order_detail_flower
-- ----------------------------
BEGIN;
INSERT INTO `order_detail_flower` VALUES (100002, 10015, NULL, 1);
INSERT INTO `order_detail_flower` VALUES (100003, 10006, NULL, 1);
INSERT INTO `order_detail_flower` VALUES (100004, 10003, NULL, 1);
INSERT INTO `order_detail_flower` VALUES (100005, 10001, '5,7', 1);
INSERT INTO `order_detail_flower` VALUES (100006, 10003, NULL, 1);
INSERT INTO `order_detail_flower` VALUES (100007, 10019, NULL, 1);
INSERT INTO `order_detail_flower` VALUES (100008, 10020, NULL, 1);
INSERT INTO `order_detail_flower` VALUES (100030, 10027, '1,7,3,5', 2);
INSERT INTO `order_detail_flower` VALUES (100038, 10003, '1,7', 1);
INSERT INTO `order_detail_flower` VALUES (100039, 10035, '7', 2);
INSERT INTO `order_detail_flower` VALUES (100040, 10035, '5', 1);
INSERT INTO `order_detail_flower` VALUES (100041, 10034, '7', 3);
INSERT INTO `order_detail_flower` VALUES (100056, 10026, '', 1);
INSERT INTO `order_detail_flower` VALUES (100060, 10015, '', 1);
INSERT INTO `order_detail_flower` VALUES (100061, 10036, '1', 2);
INSERT INTO `order_detail_flower` VALUES (100062, 10019, '', 1);
INSERT INTO `order_detail_flower` VALUES (100063, 10033, '', 1);
INSERT INTO `order_detail_flower` VALUES (100064, 10022, '1,5', 2);
INSERT INTO `order_detail_flower` VALUES (100065, 10022, '1', 2);
INSERT INTO `order_detail_flower` VALUES (100066, 10021, '7,3', 3);
INSERT INTO `order_detail_flower` VALUES (100067, 10022, '1,6', 1);
INSERT INTO `order_detail_flower` VALUES (100068, 10023, '', 2);
COMMIT;

-- ----------------------------
-- Table structure for order_detail_gift
-- ----------------------------
DROP TABLE IF EXISTS `order_detail_gift`;
CREATE TABLE `order_detail_gift` (
  `order_id` int NOT NULL,
  `gift_id` int NOT NULL,
  `number` int DEFAULT NULL,
  PRIMARY KEY (`order_id`,`gift_id`),
  KEY `gift_id` (`gift_id`),
  CONSTRAINT `order_detail_gift_ibfk_1` FOREIGN KEY (`order_id`) REFERENCES `order` (`order_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `order_detail_gift_ibfk_2` FOREIGN KEY (`gift_id`) REFERENCES `gift` (`gift_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='赠品订单详情表';

-- ----------------------------
-- Records of order_detail_gift
-- ----------------------------
BEGIN;
INSERT INTO `order_detail_gift` VALUES (100054, 10005, 1);
INSERT INTO `order_detail_gift` VALUES (100055, 10006, 1);
INSERT INTO `order_detail_gift` VALUES (100069, 10003, 1);
COMMIT;

-- ----------------------------
-- Table structure for pack
-- ----------------------------
DROP TABLE IF EXISTS `pack`;
CREATE TABLE `pack` (
  `pack_id` int NOT NULL AUTO_INCREMENT COMMENT '花材id',
  `pack_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '花材名',
  `pack_price` decimal(10,2) NOT NULL COMMENT '花材单价',
  PRIMARY KEY (`pack_id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='花材表';

-- ----------------------------
-- Records of pack
-- ----------------------------
BEGIN;
INSERT INTO `pack` VALUES (1, '珍珠串灯', 5.00);
INSERT INTO `pack` VALUES (2, '手揉纸', 0.50);
INSERT INTO `pack` VALUES (3, '彩带', 0.15);
INSERT INTO `pack` VALUES (5, '珠片', 0.20);
INSERT INTO `pack` VALUES (6, '塑料彩纸', 0.80);
INSERT INTO `pack` VALUES (7, '折纸星星', 0.30);
INSERT INTO `pack` VALUES (8, '镭射纸', 1.00);
COMMIT;

-- ----------------------------
-- Table structure for staff
-- ----------------------------
DROP TABLE IF EXISTS `staff`;
CREATE TABLE `staff` (
  `staff_id` int NOT NULL AUTO_INCREMENT COMMENT '员工id',
  `staff_name` varchar(255) NOT NULL COMMENT '员工用户名',
  `staff_pwd` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '123456' COMMENT '员工密码',
  `staff_full_name` varchar(255) DEFAULT NULL COMMENT '员工姓名',
  `staff_role` int NOT NULL COMMENT '员工身份（店长1/普通员工0）',
  `staff_pic` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '/10001/20240307172130346.jpg' COMMENT '员工头像',
  `staff_state` int NOT NULL COMMENT '员工账号状态（可用1/不可用0）',
  `staff_phone` varchar(255) DEFAULT NULL COMMENT '员工手机号',
  PRIMARY KEY (`staff_id`)
) ENGINE=InnoDB AUTO_INCREMENT=100016 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='员工表';

-- ----------------------------
-- Records of staff
-- ----------------------------
BEGIN;
INSERT INTO `staff` VALUES (10001, 'admin', '123', '张嘉棣', 1, '/10001/20240307173112491.png', 1, '13011795597');
INSERT INTO `staff` VALUES (10002, 'staff', '123', '小张', 0, '/10001/20240307172130346.jpg', 1, '13098765658');
INSERT INTO `staff` VALUES (10003, 'liuliu', '123456', '小刘', 0, '/10001/20240307172130346.jpg', 0, '13098987665');
INSERT INTO `staff` VALUES (10004, 'wang', '123456', '小王', 0, '/10001/20240307172130346.jpg', 1, '13018995578');
INSERT INTO `staff` VALUES (100014, 'yyy', '123456', '小杨', 0, '/10001/20240307172130346.jpg', 0, '13098876678');
INSERT INTO `staff` VALUES (100015, 'xiaoli', '123456', '小李', 0, '/10001/20240307172130346.jpg', 1, '13098765432');
COMMIT;

-- ----------------------------
-- Table structure for user
-- ----------------------------
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
  `user_id` int NOT NULL AUTO_INCREMENT COMMENT '用户id',
  `user_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '用户名',
  `user_pwd` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '123456' COMMENT '用户密码',
  `user_phone` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '用户手机号',
  `user_state` int NOT NULL COMMENT '账号状态（可用1/不可用0）',
  `user_pic` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '/10001/20240307170114539.jpg' COMMENT '用户头像',
  `user_role` int NOT NULL COMMENT '用户身份（会员1/非会员0）',
  `member_start_time` date DEFAULT NULL COMMENT '会员开始日期',
  `member_end_time` date DEFAULT NULL COMMENT '会员结束日期',
  `member_point` int DEFAULT '0' COMMENT '会员积分',
  PRIMARY KEY (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=100025 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='用户表';

-- ----------------------------
-- Records of user
-- ----------------------------
BEGIN;
INSERT INTO `user` VALUES (100001, 'zhang', '123', '13011795597', 1, '/100001/20240318191330689.jpg', 1, '2024-01-01', '2025-01-01', 106000);
INSERT INTO `user` VALUES (100002, 'wang', '123456', '12344566789', 1, '/10001/20240307170114539.jpg', 0, '2024-02-17', '2024-03-18', 0);
INSERT INTO `user` VALUES (100003, 'li', '123456', '12355678765', 0, '/10001/20240307170114539.jpg', 0, NULL, NULL, 0);
INSERT INTO `user` VALUES (100005, 'liu', '123456', '13210724567', 0, '/10001/20240307170114539.jpg', 1, '2024-02-01', '2024-08-31', 800);
INSERT INTO `user` VALUES (100008, 'sun', '123456', '13765548890', 1, '/10001/20240307170114539.jpg', 1, '2024-03-19', '2024-05-18', 500);
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
