From 5891fbcb6a2cb662c24c379e6368f13293e6b0c2 Mon Sep 17 00:00:00 2001
From: Helius <wangdoubleone@gmail.com>
Date: Wed, 22 Sep 2021 18:36:23 +0800
Subject: [PATCH] fix

---
 sql/xc_mall.sql |  117 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 117 insertions(+), 0 deletions(-)

diff --git a/sql/xc_mall.sql b/sql/xc_mall.sql
index 3dec379..89585f9 100644
--- a/sql/xc_mall.sql
+++ b/sql/xc_mall.sql
@@ -126,3 +126,120 @@
    PRIMARY KEY (ID)
 )  COMMENT = '购物车';
 
+DROP TABLE IF EXISTS mall_address_info;
+CREATE TABLE mall_address_info(
+      REVISION INT    COMMENT '乐观锁' ,
+      CREATED_BY VARCHAR(32)    COMMENT '创建人' ,
+      CREATED_TIME DATETIME    COMMENT '创建时间' ,
+      UPDATED_BY VARCHAR(32)    COMMENT '更新人' ,
+      UPDATED_TIME DATETIME    COMMENT '更新时间' ,
+      ID BIGINT NOT NULL AUTO_INCREMENT  COMMENT '主键' ,
+      member_id BIGINT    COMMENT '用户ID' ,
+      name VARCHAR(255)    COMMENT '姓名' ,
+      phone VARCHAR(255)    COMMENT '联系方式' ,
+      area TEXT    COMMENT '地区' ,
+      address TEXT    COMMENT '地址' ,
+      longitude VARCHAR(255)    COMMENT '经度' ,
+      latitude VARCHAR(255)    COMMENT '纬度' ,
+      is_default INT    COMMENT '是否默认;1-是2-否' ,
+      PRIMARY KEY (ID)
+)  COMMENT = '用户地址';
+
+DROP TABLE IF EXISTS mall_order_info;
+CREATE TABLE mall_order_info(
+    REVISION INT    COMMENT '乐观锁' ,
+    CREATED_BY VARCHAR(32)    COMMENT '创建人' ,
+    CREATED_TIME DATETIME    COMMENT '创建时间' ,
+    UPDATED_BY VARCHAR(32)    COMMENT '更新人' ,
+    UPDATED_TIME DATETIME    COMMENT '更新时间' ,
+    ID BIGINT NOT NULL AUTO_INCREMENT  COMMENT '主键' ,
+    order_no VARCHAR(32)    COMMENT '订单号' ,
+    member_id BIGINT    COMMENT '用户ID' ,
+    order_time DATETIME    COMMENT '下单时间' ,
+    pay_time DATETIME    COMMENT '支付时间' ,
+    amount DECIMAL(20,2)    COMMENT '订单金额' ,
+    pay_method VARCHAR(32)    COMMENT '支付方式' ,
+    status INT    COMMENT '状态;1-待支付2-待发货3-待收货4-已完成5-退款中6-已退款7-已取消' ,
+    cancel_type INT    COMMENT '取消类型;1-超时未支付2-主动取消' ,
+    name VARCHAR(32)    COMMENT '联系人' ,
+    phone VARCHAR(32)    COMMENT '联系方式' ,
+    address TEXT    COMMENT '收货地址' ,
+    longitude VARCHAR(255)    COMMENT '经度' ,
+    latitude VARCHAR(255)    COMMENT '纬度' ,
+    remark TEXT    COMMENT '备注' ,
+    PRIMARY KEY (ID)
+)  COMMENT = '订单表';
+
+DROP TABLE IF EXISTS mall_order_item;
+CREATE TABLE mall_order_item(
+    REVISION INT    COMMENT '乐观锁' ,
+    CREATED_BY VARCHAR(32)    COMMENT '创建人' ,
+    CREATED_TIME DATETIME    COMMENT '创建时间' ,
+    UPDATED_BY VARCHAR(32)    COMMENT '更新人' ,
+    UPDATED_TIME DATETIME    COMMENT '更新时间' ,
+    ID BIGINT NOT NULL AUTO_INCREMENT  COMMENT '主键' ,
+    order_id BIGINT    COMMENT '订单ID' ,
+    sku_id BIGINT    COMMENT 'skuID' ,
+    goods_id BIGINT    COMMENT '商品ID' ,
+    goods_name VARCHAR(255)    COMMENT '商品名称' ,
+    style_name VARCHAR(255)    COMMENT '样式名称' ,
+    sku_name VARCHAR(255)    COMMENT 'sku名称' ,
+    cnt INT    COMMENT '数量' ,
+    price DECIMAL(20,2)    COMMENT '单价' ,
+    amount DECIMAL(20,2)    COMMENT '金额' ,
+    PRIMARY KEY (ID)
+)  COMMENT = '订单明细表';
+
+DROP TABLE IF EXISTS mall_money_flow;
+CREATE TABLE mall_money_flow(
+    REVISION INT    COMMENT '乐观锁' ,
+    CREATED_BY VARCHAR(32)    COMMENT '创建人' ,
+    CREATED_TIME DATETIME    COMMENT '创建时间' ,
+    UPDATED_BY VARCHAR(32)    COMMENT '更新人' ,
+    UPDATED_TIME DATETIME    COMMENT '更新时间' ,
+    ID BIGINT NOT NULL AUTO_INCREMENT  COMMENT '主键' ,
+    member_id BIGINT    COMMENT '用户ID' ,
+    amount DECIMAL(20,2)    COMMENT '金额' ,
+    type INT    COMMENT '流水类型;1-分红收入2-业绩奖励3-订单支付4-退款' ,
+    order_no VARCHAR(32)    COMMENT '订单号' ,
+    description TEXT    COMMENT '描述' ,
+    remark TEXT    COMMENT '备注' ,
+    PRIMARY KEY (ID)
+)  COMMENT = '资金流水';
+alter table mall_order_info add del_flag int default 2 null comment '1-已删除2-未删除' after latitude;
+alter table mall_order_info add pay_order_no varchar(500) null comment '支付订单号' after pay_method;
+alter table mall_order_info add pay_result int null comment '支付结果 1-成功2-未成功' after pay_order_no;
+
+alter table mall_member add trade_password varchar(500) null comment '支付密码' after password;
+
+DROP TABLE IF EXISTS mall_member_wallet;
+CREATE TABLE mall_member_wallet(
+   REVISION INT    COMMENT '乐观锁' ,
+   CREATED_BY VARCHAR(32)    COMMENT '创建人' ,
+   CREATED_TIME DATETIME    COMMENT '创建时间' ,
+   UPDATED_BY VARCHAR(32)    COMMENT '更新人' ,
+   UPDATED_TIME DATETIME    COMMENT '更新时间' ,
+   ID BIGINT NOT NULL AUTO_INCREMENT  COMMENT '主键' ,
+   balance DECIMAL(20,2)    COMMENT '余额' ,
+   member_id    bigint         null comment '用户ID',
+   PRIMARY KEY (ID)
+)  COMMENT = '用户钱包';
+alter table mall_order_item add sku_image varchar(1000) null comment 'sku图片' after sku_name;
+
+DROP TABLE IF EXISTS mall_express_info;
+CREATE TABLE mall_express_info(
+  REVISION INT    COMMENT '乐观锁' ,
+  CREATED_BY VARCHAR(32)    COMMENT '创建人' ,
+  CREATED_TIME DATETIME    COMMENT '创建时间' ,
+  UPDATED_BY VARCHAR(32)    COMMENT '更新人' ,
+  UPDATED_TIME DATETIME    COMMENT '更新时间' ,
+  ID BIGINT NOT NULL AUTO_INCREMENT  COMMENT '主键' ,
+  order_id BIGINT    COMMENT '订单ID' ,
+  member_id BIGINT    COMMENT '用户ID' ,
+  express_no VARCHAR(255)    COMMENT '物流单号' ,
+  express_com VARCHAR(255)    COMMENT '物流公司' ,
+  PRIMARY KEY (ID)
+)  COMMENT = '物流信息表';
+
+alter table mall_order_info add receiving_time datetime null comment '收货时间';
+

--
Gitblit v1.9.1