/*
 Navicat Premium Data Transfer

 Source Server         : commerce_system
 Source Server Type    : MySQL
 Source Server Version : 80024 (8.0.24)
 Source Host           : wzpmc.cn:3306
 Source Schema         : commerce_system

 Target Server Type    : MySQL
 Target Server Version : 80024 (8.0.24)
 File Encoding         : 65001

 Date: 27/04/2023 16:14:29
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for auth_account
-- ----------------------------
DROP TABLE IF EXISTS `auth_account`;
CREATE TABLE `auth_account` (
  `id` int NOT NULL AUTO_INCREMENT COMMENT '#',
  `username` varchar(20) COLLATE utf8mb4_general_ci NOT NULL COMMENT '用户名',
  `email` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '邮箱',
  `rel_name` varchar(5) COLLATE utf8mb4_general_ci NOT NULL COMMENT '真实姓名',
  `password` varchar(255) COLLATE utf8mb4_general_ci NOT NULL COMMENT '密码',
  `status` tinyint(1) DEFAULT '1' COMMENT '状态',
  `role_id` int DEFAULT '0' COMMENT '角色',
  `create_time` timestamp NOT NULL COMMENT '创建时间',
  `update_time` timestamp NULL DEFAULT NULL COMMENT '最近更新时间',
  `del` tinyint(1) DEFAULT '0' COMMENT '逻辑删除',
  PRIMARY KEY (`id`),
  UNIQUE KEY `username` (`username`),
  UNIQUE KEY `email` (`email`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Table structure for auth_permissions
-- ----------------------------
DROP TABLE IF EXISTS `auth_permissions`;
CREATE TABLE `auth_permissions` (
  `id` int NOT NULL AUTO_INCREMENT COMMENT '#',
  `permission_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '权限名',
  `permission_code` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '权限代码',
  `description` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '介绍',
  `account_id` int NOT NULL COMMENT '创建者id',
  `create_time` timestamp NOT NULL COMMENT '创建时间',
  `update_time` timestamp NULL DEFAULT NULL COMMENT '最后更新时间',
  `status` tinyint(1) DEFAULT '1' COMMENT '状态',
  `del` tinyint(1) DEFAULT '0' COMMENT '逻辑删除',
  PRIMARY KEY (`id`),
  UNIQUE KEY `permission_name` (`permission_name`),
  UNIQUE KEY `permission_code` (`permission_code`),
  KEY `account_id` (`account_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Table structure for auth_roles
-- ----------------------------
DROP TABLE IF EXISTS `auth_roles`;
CREATE TABLE `auth_roles` (
  `id` int NOT NULL AUTO_INCREMENT COMMENT '#',
  `role_name` varchar(20) COLLATE utf8mb4_general_ci NOT NULL COMMENT '角色名',
  `description` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '简介',
  `account_id` int NOT NULL COMMENT '创建者id',
  `create_time` timestamp NOT NULL COMMENT '创建时间',
  `update_time` timestamp NULL DEFAULT NULL COMMENT '最后更新时间',
  `status` tinyint(1) DEFAULT '1' COMMENT '状态',
  `del` tinyint(1) DEFAULT '0' COMMENT '逻辑删除',
  PRIMARY KEY (`id`),
  UNIQUE KEY `role_name` (`role_name`),
  KEY `account_id` (`account_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Table structure for auth_route
-- ----------------------------
DROP TABLE IF EXISTS `auth_route`;
CREATE TABLE `auth_route` (
  `id` int NOT NULL COMMENT '#',
  `path` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '前端访问路径',
  `name` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '前端路由名称',
  `parent_id` int DEFAULT NULL COMMENT '父组件id',
  `component` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '前端本地组件路径',
  `title` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '前端标题栏',
  `status` blob COMMENT '状态',
  `create_id` int DEFAULT NULL COMMENT '创建者id',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `update_id` int DEFAULT NULL COMMENT '最后修改者id',
  `update_time` datetime DEFAULT NULL COMMENT '最后修改时间',
  `remark` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '备注',
  `del` int DEFAULT '0' COMMENT '逻辑删除',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Table structure for commission
-- ----------------------------
DROP TABLE IF EXISTS `commission`;
CREATE TABLE `commission` (
  `id` int NOT NULL AUTO_INCREMENT COMMENT '#',
  `price_min` double(9,2) NOT NULL COMMENT '最小区间',
  `price_max` double(9,2) NOT NULL COMMENT '最大区间',
  `commission` double(5,2) NOT NULL COMMENT '佣金',
  `store_id` int NOT NULL COMMENT '店铺名称',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  `del` int DEFAULT '0' COMMENT '逻辑删除',
  `status` blob COMMENT '状态',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Table structure for shop_order
-- ----------------------------
DROP TABLE IF EXISTS `shop_order`;
CREATE TABLE `shop_order` (
  `id` int NOT NULL AUTO_INCREMENT COMMENT '#',
  `order_no` varchar(30) COLLATE utf8mb4_general_ci NOT NULL COMMENT '订单号',
  `order_time` datetime NOT NULL COMMENT '下单时间',
  `order_status` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '订单状态',
  `wang_no` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '旺旺号',
  `wechat_no` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '微信账号',
  `alipay_no` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '支付宝账号',
  `pay_amt` double(10,2) NOT NULL COMMENT '付款金额',
  `store_id` int NOT NULL COMMENT '店铺id',
  `commission` double(10,2) DEFAULT NULL COMMENT '佣金',
  `alipay_name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '支付宝收款名称',
  `rp_name` varchar(20) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '负责人',
  `rp_wechat_name` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '负责放单人微信名',
  `remark` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '备注',
  `phone_number` varchar(11) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '买家电话',
  `card_no` varchar(20) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '银行卡号',
  `flag` int DEFAULT NULL COMMENT '插旗',
  `flag_remark` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '插旗备注',
  `pay_time` datetime DEFAULT NULL COMMENT '付款时间',
  `address` varchar(255) COLLATE utf8mb4_general_ci NOT NULL COMMENT '收货地址',
  `shop_id` int DEFAULT NULL COMMENT '商品id',
  `sku` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'sku',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Table structure for store
-- ----------------------------
DROP TABLE IF EXISTS `store`;
CREATE TABLE `store` (
  `id` int NOT NULL AUTO_INCREMENT COMMENT '#',
  `name` varchar(255) COLLATE utf8mb4_general_ci NOT NULL COMMENT '店铺名称',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  `del` int DEFAULT '0' COMMENT '逻辑删除',
  `status` blob COMMENT '状态',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

SET FOREIGN_KEY_CHECKS = 1;
