sql脚本-sql格式化
This commit is contained in:
@@ -1,20 +1,21 @@
|
|||||||
create table aliyun_certify (
|
create table aliyun_certify
|
||||||
id bigint not null primary key,
|
(
|
||||||
user_id bigint not null,
|
id bigint not null primary key,
|
||||||
user_phone bigint,
|
user_id bigint not null,
|
||||||
name varchar(128) null,
|
user_phone bigint,
|
||||||
id_card varchar(128) null,
|
name varchar(128) null,
|
||||||
certify_id varchar(64) null,
|
id_card varchar(128) null,
|
||||||
image text null,
|
certify_id varchar(64) null,
|
||||||
message varchar(255) null,
|
image text null,
|
||||||
|
message varchar(255) null,
|
||||||
is_success integer default 0 not null,
|
is_success integer default 0 not null,
|
||||||
is_deleted integer default 0 not null,
|
is_deleted integer default 0 not null,
|
||||||
create_time timestamp not null,
|
create_time timestamp not null,
|
||||||
create_user int8 null,
|
create_user int8 null,
|
||||||
update_time timestamp null,
|
update_time timestamp null,
|
||||||
update_user int8 null,
|
update_user int8 null,
|
||||||
create_dept int8 null,
|
create_dept int8 null,
|
||||||
status integer null
|
status integer null
|
||||||
);
|
);
|
||||||
|
|
||||||
comment on table aliyun_certify is '阿里云实名记录表';
|
comment on table aliyun_certify is '阿里云实名记录表';
|
||||||
|
|||||||
@@ -1,28 +1,30 @@
|
|||||||
CREATE TABLE mall_spu (
|
CREATE TABLE mall_spu
|
||||||
id BIGINT NOT NULL PRIMARY KEY,
|
(
|
||||||
spu_sn VARCHAR(255) DEFAULT '' NOT NULL,
|
id BIGINT NOT NULL PRIMARY KEY,
|
||||||
spu_name VARCHAR(255) DEFAULT '' NOT NULL,
|
spu_sn VARCHAR(255) DEFAULT '' NOT NULL,
|
||||||
main_img VARCHAR(255) DEFAULT '' NOT NULL,
|
spu_name VARCHAR(255) DEFAULT '' NOT NULL,
|
||||||
detail_img text NULL,
|
main_img VARCHAR(255) DEFAULT '' NOT NULL,
|
||||||
top_img text NULL,
|
detail_img text NULL,
|
||||||
cate_id VARCHAR(255) DEFAULT '' NOT NULL,
|
top_img text NULL,
|
||||||
cate_ids VARCHAR(255) DEFAULT '' NOT NULL,
|
cate_id VARCHAR(255) DEFAULT '' NOT NULL,
|
||||||
cost_price DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
|
cate_ids VARCHAR(255) DEFAULT '' NOT NULL,
|
||||||
original_price DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
|
cost_price DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
|
||||||
retail_price DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
|
original_price DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
|
||||||
profit DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
|
retail_price DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
|
||||||
sales INTEGER DEFAULT 0 NOT NULL,
|
profit DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
|
||||||
spu_qty INTEGER DEFAULT 0 NOT NULL,
|
sales INTEGER DEFAULT 0 NOT NULL,
|
||||||
tags text DEFAULT '' NOT NULL,
|
spu_qty INTEGER DEFAULT 0 NOT NULL,
|
||||||
status INTEGER DEFAULT 0 NULL,
|
tags text DEFAULT '' NOT NULL,
|
||||||
create_user int8 NULL,
|
status INTEGER DEFAULT 0 NULL,
|
||||||
create_dept int8 NULL,
|
create_user int8 NULL,
|
||||||
create_time TIMESTAMP NULL,
|
create_dept int8 NULL,
|
||||||
update_user int8 NULL,
|
create_time TIMESTAMP NULL,
|
||||||
update_time TIMESTAMP NULL,
|
update_user int8 NULL,
|
||||||
is_deleted INTEGER DEFAULT 0 NULL
|
update_time TIMESTAMP NULL,
|
||||||
|
is_deleted INTEGER DEFAULT 0 NULL
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
COMMENT ON TABLE mall_spu IS '商城spu';
|
COMMENT ON TABLE mall_spu IS '商城spu';
|
||||||
COMMENT ON COLUMN mall_spu.id IS '主键';
|
COMMENT ON COLUMN mall_spu.id IS '主键';
|
||||||
COMMENT ON COLUMN mall_spu.spu_sn IS '商品编码';
|
COMMENT ON COLUMN mall_spu.spu_sn IS '商品编码';
|
||||||
@@ -49,14 +51,15 @@ COMMENT ON COLUMN mall_spu.is_deleted IS '是否已删除';
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
CREATE TABLE ys_category
|
||||||
CREATE TABLE ys_category (
|
(
|
||||||
id BIGINT NOT NULL PRIMARY KEY,
|
id BIGINT NOT NULL PRIMARY KEY,
|
||||||
cname VARCHAR(100) DEFAULT '' NOT NULL,
|
cname VARCHAR(100) DEFAULT '' NOT NULL,
|
||||||
pid BIGINT DEFAULT 0 NOT NULL,
|
pid BIGINT DEFAULT 0 NOT NULL,
|
||||||
level INTEGER DEFAULT 0 NOT NULL
|
level INTEGER DEFAULT 0 NOT NULL
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
COMMENT ON TABLE ys_category IS '商品分类';
|
COMMENT ON TABLE ys_category IS '商品分类';
|
||||||
COMMENT ON COLUMN ys_category.id IS '主键';
|
COMMENT ON COLUMN ys_category.id IS '主键';
|
||||||
COMMENT ON COLUMN ys_category.cname IS '分类名称';
|
COMMENT ON COLUMN ys_category.cname IS '分类名称';
|
||||||
@@ -64,21 +67,23 @@ COMMENT ON COLUMN ys_category.pid IS 'pid';
|
|||||||
COMMENT ON COLUMN ys_category.level IS 'level';
|
COMMENT ON COLUMN ys_category.level IS 'level';
|
||||||
|
|
||||||
|
|
||||||
CREATE TABLE mall_cart (
|
CREATE TABLE mall_cart
|
||||||
|
(
|
||||||
id BIGINT NOT NULL PRIMARY KEY,
|
id BIGINT NOT NULL PRIMARY KEY,
|
||||||
user_id BIGINT DEFAULT 0 NOT NULL,
|
user_id BIGINT DEFAULT 0 NOT NULL,
|
||||||
title VARCHAR(200) DEFAULT '' NOT NULL,
|
title VARCHAR(200) DEFAULT '' NOT NULL,
|
||||||
spu_id INTEGER DEFAULT 0 NOT NULL,
|
spu_id INTEGER DEFAULT 0 NOT NULL,
|
||||||
quantity INTEGER DEFAULT 0 NOT NULL,
|
quantity INTEGER DEFAULT 0 NOT NULL,
|
||||||
create_user int8 NULL,
|
create_user int8 NULL,
|
||||||
create_dept int8 NULL,
|
create_dept int8 NULL,
|
||||||
create_time TIMESTAMP NULL,
|
create_time TIMESTAMP NULL,
|
||||||
update_user int8 NULL,
|
update_user int8 NULL,
|
||||||
update_time TIMESTAMP NULL,
|
update_time TIMESTAMP NULL,
|
||||||
status INTEGER NULL,
|
status INTEGER NULL,
|
||||||
is_deleted INTEGER DEFAULT 0 NULL
|
is_deleted INTEGER DEFAULT 0 NULL
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
COMMENT ON TABLE mall_cart IS '商城购物车';
|
COMMENT ON TABLE mall_cart IS '商城购物车';
|
||||||
COMMENT ON COLUMN mall_cart.id IS '主键';
|
COMMENT ON COLUMN mall_cart.id IS '主键';
|
||||||
COMMENT ON COLUMN mall_cart.user_id IS '用户id';
|
COMMENT ON COLUMN mall_cart.user_id IS '用户id';
|
||||||
@@ -92,32 +97,33 @@ COMMENT ON COLUMN mall_cart.update_user IS '修改人';
|
|||||||
COMMENT ON COLUMN mall_cart.update_time IS '修改时间';
|
COMMENT ON COLUMN mall_cart.update_time IS '修改时间';
|
||||||
COMMENT ON COLUMN mall_cart.status IS '状态';
|
COMMENT ON COLUMN mall_cart.status IS '状态';
|
||||||
COMMENT ON COLUMN mall_cart.is_deleted IS '是否已删除';
|
COMMENT ON COLUMN mall_cart.is_deleted IS '是否已删除';
|
||||||
|
|
||||||
CREATE INDEX idx_user_id ON mall_cart (user_id);
|
CREATE INDEX idx_user_id ON mall_cart (user_id);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
CREATE TABLE user_address (
|
CREATE TABLE user_address
|
||||||
id BIGINT NOT NULL PRIMARY KEY,
|
(
|
||||||
user_id BIGINT NULL,
|
id BIGINT NOT NULL PRIMARY KEY,
|
||||||
regions_info_id BIGINT NULL,
|
user_id BIGINT NULL,
|
||||||
province VARCHAR(200) NULL,
|
regions_info_id BIGINT NULL,
|
||||||
city VARCHAR(200) NULL,
|
province VARCHAR(200) NULL,
|
||||||
district VARCHAR(200) NULL,
|
city VARCHAR(200) NULL,
|
||||||
street VARCHAR(200) NULL,
|
district VARCHAR(200) NULL,
|
||||||
detail VARCHAR(200) NULL,
|
street VARCHAR(200) NULL,
|
||||||
consignee VARCHAR(200) NULL,
|
detail VARCHAR(200) NULL,
|
||||||
phone VARCHAR(200) NULL,
|
consignee VARCHAR(200) NULL,
|
||||||
is_default INTEGER NULL,
|
phone VARCHAR(200) NULL,
|
||||||
create_user int8 NULL,
|
is_default INTEGER NULL,
|
||||||
create_dept int8 NULL,
|
create_user int8 NULL,
|
||||||
create_time TIMESTAMP NULL,
|
create_dept int8 NULL,
|
||||||
update_user int8 NULL,
|
create_time TIMESTAMP NULL,
|
||||||
update_time TIMESTAMP NULL,
|
update_user int8 NULL,
|
||||||
status INTEGER NULL,
|
update_time TIMESTAMP NULL,
|
||||||
is_deleted INTEGER DEFAULT 0 NULL
|
status INTEGER NULL,
|
||||||
|
is_deleted INTEGER DEFAULT 0 NULL
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
COMMENT ON TABLE user_address IS '用户地址表';
|
COMMENT ON TABLE user_address IS '用户地址表';
|
||||||
COMMENT ON COLUMN user_address.id IS '主键';
|
COMMENT ON COLUMN user_address.id IS '主键';
|
||||||
COMMENT ON COLUMN user_address.user_id IS '用户id';
|
COMMENT ON COLUMN user_address.user_id IS '用户id';
|
||||||
|
|||||||
@@ -1,27 +1,27 @@
|
|||||||
|
CREATE TABLE user_order
|
||||||
CREATE TABLE user_order (
|
(
|
||||||
id BIGINT DEFAULT 0 NOT NULL PRIMARY KEY,
|
id BIGINT DEFAULT 0 NOT NULL PRIMARY KEY,
|
||||||
user_id BIGINT DEFAULT 0 NOT NULL,
|
user_id BIGINT DEFAULT 0 NOT NULL,
|
||||||
order_type INTEGER DEFAULT 0 NOT NULL,
|
order_type INTEGER DEFAULT 0 NOT NULL,
|
||||||
order_id BIGINT DEFAULT 0 NOT NULL,
|
order_id BIGINT DEFAULT 0 NOT NULL,
|
||||||
title VARCHAR(256) DEFAULT '' NOT NULL,
|
title VARCHAR(256) DEFAULT '' NOT NULL,
|
||||||
images VARCHAR(512) NULL,
|
images VARCHAR(512) NULL,
|
||||||
quantity INTEGER NULL,
|
quantity INTEGER NULL,
|
||||||
description VARCHAR(200) DEFAULT '' NOT NULL,
|
description VARCHAR(200) DEFAULT '' NOT NULL,
|
||||||
order_status INTEGER DEFAULT 0 NOT NULL,
|
order_status INTEGER DEFAULT 0 NOT NULL,
|
||||||
total_amount DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
|
total_amount DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
|
||||||
actual_amount DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
|
actual_amount DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
|
||||||
payment_type INTEGER DEFAULT 0 NOT NULL,
|
payment_type INTEGER DEFAULT 0 NOT NULL,
|
||||||
payment_time TIMESTAMP NULL,
|
payment_time TIMESTAMP NULL,
|
||||||
payment_track VARCHAR(255) DEFAULT '' NOT NULL,
|
payment_track VARCHAR(255) DEFAULT '' NOT NULL,
|
||||||
payment_status INTEGER DEFAULT 1 NOT NULL,
|
payment_status INTEGER DEFAULT 1 NOT NULL,
|
||||||
create_user int8 NULL,
|
create_user int8 NULL,
|
||||||
create_dept int8 NULL,
|
create_dept int8 NULL,
|
||||||
create_time TIMESTAMP(6) NULL,
|
create_time TIMESTAMP(6) NULL,
|
||||||
update_user int8 NULL,
|
update_user int8 NULL,
|
||||||
update_time TIMESTAMP(6) NULL,
|
update_time TIMESTAMP(6) NULL,
|
||||||
status INTEGER NULL,
|
status INTEGER NULL,
|
||||||
is_deleted INTEGER DEFAULT 0 NULL
|
is_deleted INTEGER DEFAULT 0 NULL
|
||||||
);
|
);
|
||||||
|
|
||||||
COMMENT ON TABLE user_order IS '用户订单';
|
COMMENT ON TABLE user_order IS '用户订单';
|
||||||
@@ -46,22 +46,40 @@ COMMENT ON COLUMN user_order.create_time IS '创建时间';
|
|||||||
COMMENT ON COLUMN user_order.update_user IS '修改人';
|
COMMENT ON COLUMN user_order.update_user IS '修改人';
|
||||||
COMMENT ON COLUMN user_order.update_time IS '修改时间';
|
COMMENT ON COLUMN user_order.update_time IS '修改时间';
|
||||||
COMMENT ON COLUMN user_order.status IS '状态';
|
COMMENT ON COLUMN user_order.status IS '状态';
|
||||||
|
COMMENT ON COLUMN user_order.update_user IS '修改人';
|
||||||
|
COMMENT ON COLUMN user_order.update_time IS '修改时间';
|
||||||
|
COMMENT ON COLUMN user_order.status IS '状态';
|
||||||
|
COMMENT ON COLUMN user_order.payment_time IS '支付时间';
|
||||||
|
COMMENT ON COLUMN user_order.payment_track IS '支付凭证编号';
|
||||||
|
COMMENT ON COLUMN user_order.payment_status IS '支付状态';
|
||||||
|
COMMENT ON COLUMN user_order.create_user IS '创建人';
|
||||||
|
COMMENT ON COLUMN user_order.create_dept IS '创建部门';
|
||||||
|
COMMENT ON COLUMN user_order.create_time IS '创建时间';
|
||||||
|
COMMENT ON COLUMN user_order.update_user IS '修改人';
|
||||||
|
COMMENT ON COLUMN user_order.update_time IS '修改时间';
|
||||||
|
COMMENT ON COLUMN user_order.status IS '状态';
|
||||||
|
COMMENT ON COLUMN user_order.update_user IS '修改人';
|
||||||
|
COMMENT ON COLUMN user_order.update_time IS '修改时间';
|
||||||
|
COMMENT ON COLUMN user_order.status IS '状态';
|
||||||
|
COMMENT ON COLUMN user_order.update_user IS '修改人';
|
||||||
|
COMMENT ON COLUMN user_order.update_time IS '修改时间';
|
||||||
|
COMMENT ON COLUMN user_order.status IS '状态';
|
||||||
COMMENT ON COLUMN user_order.is_deleted IS '是否已删除';
|
COMMENT ON COLUMN user_order.is_deleted IS '是否已删除';
|
||||||
|
|
||||||
CREATE INDEX user_order_index ON user_order (user_id, order_type);
|
CREATE INDEX user_order_index ON user_order (user_id, order_type);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
CREATE TABLE mall_summary_order
|
||||||
CREATE TABLE mall_summary_order (
|
(
|
||||||
id BIGINT NOT NULL PRIMARY KEY,
|
id BIGINT NOT NULL PRIMARY KEY,
|
||||||
user_id BIGINT DEFAULT 0 NOT NULL,
|
user_id BIGINT DEFAULT 0 NOT NULL,
|
||||||
products_info text NULL,
|
products_info text NULL,
|
||||||
order_info text NULL,
|
order_info text NULL,
|
||||||
confirm_info text NULL,
|
confirm_info text NULL,
|
||||||
vendor_regions_id BIGINT NOT NULL,
|
vendor_regions_id BIGINT NOT NULL,
|
||||||
address_id BIGINT NOT NULL,
|
address_id BIGINT NOT NULL,
|
||||||
delivery_info text NULL,
|
delivery_info text NULL,
|
||||||
freight_amount DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
|
freight_amount DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
|
||||||
cost_amount DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
|
cost_amount DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
|
||||||
order_amount DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
|
order_amount DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
|
||||||
@@ -71,22 +89,22 @@ CREATE TABLE mall_summary_order (
|
|||||||
payment_type INTEGER DEFAULT 0 NOT NULL,
|
payment_type INTEGER DEFAULT 0 NOT NULL,
|
||||||
extra_type INTEGER DEFAULT 0 NOT NULL,
|
extra_type INTEGER DEFAULT 0 NOT NULL,
|
||||||
payment_status INTEGER DEFAULT 0 NOT NULL,
|
payment_status INTEGER DEFAULT 0 NOT NULL,
|
||||||
order_status INTEGER DEFAULT 0 NOT NULL,
|
order_status INTEGER DEFAULT 0 NOT NULL,
|
||||||
payment_completed_time TIMESTAMP NULL,
|
payment_completed_time TIMESTAMP NULL,
|
||||||
payment_track VARCHAR(200) DEFAULT '' NOT NULL,
|
payment_track VARCHAR(200) DEFAULT '' NOT NULL,
|
||||||
expire_time TIMESTAMP NULL,
|
expire_time TIMESTAMP NULL,
|
||||||
give_token DECIMAL(10, 2) NULL,
|
give_token DECIMAL(10, 2) NULL,
|
||||||
actual_give_token DECIMAL(10, 2) NULL,
|
actual_give_token DECIMAL(10, 2) NULL,
|
||||||
is_royalty INTEGER DEFAULT 0 NULL,
|
is_royalty INTEGER DEFAULT 0 NULL,
|
||||||
remarks VARCHAR(200) DEFAULT '' NOT NULL,
|
remarks VARCHAR(200) DEFAULT '' NOT NULL,
|
||||||
version BIGINT DEFAULT 0 NULL,
|
version BIGINT DEFAULT 0 NULL,
|
||||||
create_user int8 NULL,
|
create_user int8 NULL,
|
||||||
create_dept int8 NULL,
|
create_dept int8 NULL,
|
||||||
create_time TIMESTAMP NULL,
|
create_time TIMESTAMP NULL,
|
||||||
update_user int8 NULL,
|
update_user int8 NULL,
|
||||||
update_time TIMESTAMP NULL,
|
update_time TIMESTAMP NULL,
|
||||||
status INTEGER DEFAULT 0 NULL,
|
status INTEGER DEFAULT 0 NULL,
|
||||||
is_deleted INTEGER DEFAULT 0 NULL
|
is_deleted INTEGER DEFAULT 0 NULL
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -108,6 +126,10 @@ COMMENT ON COLUMN mall_summary_order.refund_amount IS '退款金额';
|
|||||||
COMMENT ON COLUMN mall_summary_order.payment_type IS '支付类型';
|
COMMENT ON COLUMN mall_summary_order.payment_type IS '支付类型';
|
||||||
COMMENT ON COLUMN mall_summary_order.extra_type IS '附加支付类型';
|
COMMENT ON COLUMN mall_summary_order.extra_type IS '附加支付类型';
|
||||||
COMMENT ON COLUMN mall_summary_order.payment_status IS '支付状态';
|
COMMENT ON COLUMN mall_summary_order.payment_status IS '支付状态';
|
||||||
|
COMMENT ON COLUMN mall_summary_order.extra_type IS '附加支付类型';
|
||||||
|
COMMENT ON COLUMN mall_summary_order.order_status IS '订单状态 0=失败,1=待确认,2=待发货,3=待收货,4=已完成,5=已取消,6=售后中,7=已完结';
|
||||||
|
COMMENT ON COLUMN mall_summary_order.payment_completed_time IS '支付完成时间';
|
||||||
|
COMMENT ON COLUMN mall_summary_order.payment_track IS '支付凭证';
|
||||||
COMMENT ON COLUMN mall_summary_order.order_status IS '订单状态 0=失败,1=待确认,2=待发货,3=待收货,4=已完成,5=已取消,6=售后中,7=已完结';
|
COMMENT ON COLUMN mall_summary_order.order_status IS '订单状态 0=失败,1=待确认,2=待发货,3=待收货,4=已完成,5=已取消,6=售后中,7=已完结';
|
||||||
COMMENT ON COLUMN mall_summary_order.payment_completed_time IS '支付完成时间';
|
COMMENT ON COLUMN mall_summary_order.payment_completed_time IS '支付完成时间';
|
||||||
COMMENT ON COLUMN mall_summary_order.payment_track IS '支付凭证';
|
COMMENT ON COLUMN mall_summary_order.payment_track IS '支付凭证';
|
||||||
@@ -125,29 +147,29 @@ CREATE INDEX mso_status_index ON mall_summary_order (payment_status, status);
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
CREATE TABLE mall_detail_order
|
||||||
CREATE TABLE mall_detail_order (
|
(
|
||||||
id BIGINT NOT NULL PRIMARY KEY,
|
id BIGINT NOT NULL PRIMARY KEY,
|
||||||
user_id BIGINT DEFAULT 0 NOT NULL,
|
user_id BIGINT DEFAULT 0 NOT NULL,
|
||||||
summary_order_id BIGINT DEFAULT 0 NOT NULL,
|
summary_order_id BIGINT DEFAULT 0 NOT NULL,
|
||||||
spu_id BIGINT DEFAULT 0 NOT NULL,
|
spu_id BIGINT DEFAULT 0 NOT NULL,
|
||||||
quantity INTEGER DEFAULT 0 NOT NULL,
|
quantity INTEGER DEFAULT 0 NOT NULL,
|
||||||
sku_snapshot text NULL,
|
sku_snapshot text NULL,
|
||||||
actual_cost_amount DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
|
actual_cost_amount DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
|
||||||
order_amount DECIMAL(10, 2) NULL,
|
order_amount DECIMAL(10, 2) NULL,
|
||||||
cost_amount DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
|
cost_amount DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
|
||||||
actual_amount DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
|
actual_amount DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
|
||||||
given_amount DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
|
given_amount DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
|
||||||
remarks VARCHAR(200) DEFAULT '' NOT NULL,
|
remarks VARCHAR(200) DEFAULT '' NOT NULL,
|
||||||
order_status INTEGER DEFAULT 0 NOT NULL,
|
order_status INTEGER DEFAULT 0 NOT NULL,
|
||||||
version integer DEFAULT 0 NULL,
|
version integer DEFAULT 0 NULL,
|
||||||
create_user int8 NULL,
|
create_user int8 NULL,
|
||||||
create_dept int8 NULL,
|
create_dept int8 NULL,
|
||||||
create_time TIMESTAMP NULL,
|
create_time TIMESTAMP NULL,
|
||||||
update_user int8 NULL,
|
update_user int8 NULL,
|
||||||
update_time TIMESTAMP NULL,
|
update_time TIMESTAMP NULL,
|
||||||
status INTEGER DEFAULT -1 NULL,
|
status INTEGER DEFAULT -1 NULL,
|
||||||
is_deleted INTEGER DEFAULT 0 NULL
|
is_deleted INTEGER DEFAULT 0 NULL
|
||||||
);
|
);
|
||||||
|
|
||||||
COMMENT ON TABLE mall_detail_order IS '商城详情订单';
|
COMMENT ON TABLE mall_detail_order IS '商城详情订单';
|
||||||
@@ -156,51 +178,61 @@ COMMENT ON COLUMN mall_detail_order.user_id IS '用户id';
|
|||||||
COMMENT ON COLUMN mall_detail_order.summary_order_id IS '主订单id';
|
COMMENT ON COLUMN mall_detail_order.summary_order_id IS '主订单id';
|
||||||
COMMENT ON COLUMN mall_detail_order.spu_id IS '商品id';
|
COMMENT ON COLUMN mall_detail_order.spu_id IS '商品id';
|
||||||
COMMENT ON COLUMN mall_detail_order.quantity IS '数量';
|
COMMENT ON COLUMN mall_detail_order.quantity IS '数量';
|
||||||
|
COMMENT ON COLUMN mall_detail_order.summary_order_id IS '主订单id';
|
||||||
|
COMMENT ON COLUMN mall_detail_order.spu_id IS '商品id';
|
||||||
|
COMMENT ON COLUMN mall_detail_order.quantity IS '数量';
|
||||||
COMMENT ON COLUMN mall_detail_order.sku_snapshot IS '商品快照';
|
COMMENT ON COLUMN mall_detail_order.sku_snapshot IS '商品快照';
|
||||||
COMMENT ON COLUMN mall_detail_order.actual_cost_amount IS '实际成本';
|
COMMENT ON COLUMN mall_detail_order.actual_cost_amount IS '实际成本';
|
||||||
COMMENT ON COLUMN mall_detail_order.order_amount IS '订单金额';
|
COMMENT ON COLUMN mall_detail_order.order_amount IS '订单金额';
|
||||||
COMMENT ON COLUMN mall_detail_order.cost_amount IS '订单成本';
|
COMMENT ON COLUMN mall_detail_order.cost_amount IS '订单成本';
|
||||||
|
COMMENT ON COLUMN mall_detail_order.cost_amount IS '订单成本';
|
||||||
COMMENT ON COLUMN mall_detail_order.actual_amount IS '实际支付';
|
COMMENT ON COLUMN mall_detail_order.actual_amount IS '实际支付';
|
||||||
COMMENT ON COLUMN mall_detail_order.given_amount IS '赠送积分';
|
COMMENT ON COLUMN mall_detail_order.given_amount IS '赠送积分';
|
||||||
COMMENT ON COLUMN mall_detail_order.remarks IS '备注';
|
COMMENT ON COLUMN mall_detail_order.remarks IS '备注';
|
||||||
|
COMMENT ON COLUMN mall_detail_order.given_amount IS '赠送积分';
|
||||||
|
COMMENT ON COLUMN mall_detail_order.remarks IS '备注';
|
||||||
|
COMMENT ON COLUMN mall_detail_order.remarks IS '备注';
|
||||||
COMMENT ON COLUMN mall_detail_order.order_status IS '订单状态 0=失败,1=待确认,2=待发货,3=待收货,4=已完成,5=已取消,6=售后中,7=已完结';
|
COMMENT ON COLUMN mall_detail_order.order_status IS '订单状态 0=失败,1=待确认,2=待发货,3=待收货,4=已完成,5=已取消,6=售后中,7=已完结';
|
||||||
COMMENT ON COLUMN mall_detail_order.status IS '状态';
|
COMMENT ON COLUMN mall_detail_order.status IS '状态';
|
||||||
COMMENT ON COLUMN mall_detail_order.is_deleted IS '是否已删除';
|
COMMENT ON COLUMN mall_detail_order.is_deleted IS '是否已删除';
|
||||||
|
COMMENT ON COLUMN mall_detail_order.status IS '状态';
|
||||||
|
COMMENT ON COLUMN mall_detail_order.is_deleted IS '是否已删除';
|
||||||
|
|
||||||
CREATE INDEX mdo_index ON mall_detail_order (summary_order_id);
|
CREATE INDEX mdo_index ON mall_detail_order (summary_order_id);
|
||||||
CREATE INDEX mdo_uid_index ON mall_detail_order (user_id);
|
CREATE INDEX mdo_uid_index ON mall_detail_order (user_id);
|
||||||
|
|
||||||
|
|
||||||
CREATE TABLE mall_summary_order_after (
|
CREATE TABLE mall_summary_order_after
|
||||||
id BIGINT NOT NULL PRIMARY KEY,
|
(
|
||||||
user_id BIGINT DEFAULT -1 NOT NULL,
|
id BIGINT NOT NULL PRIMARY KEY,
|
||||||
summary_order_id BIGINT DEFAULT -1 NOT NULL,
|
user_id BIGINT DEFAULT -1 NOT NULL,
|
||||||
goods_id BIGINT DEFAULT -1 NOT NULL,
|
summary_order_id BIGINT DEFAULT -1 NOT NULL,
|
||||||
sku_id BIGINT NOT NULL,
|
goods_id BIGINT DEFAULT -1 NOT NULL,
|
||||||
goods_name VARCHAR(256) NOT NULL,
|
sku_id BIGINT NOT NULL,
|
||||||
third_plat_order_no VARCHAR(32) NOT NULL,
|
goods_name VARCHAR(256) NOT NULL,
|
||||||
third_plat_after_no VARCHAR(32) NOT NULL,
|
third_plat_order_no VARCHAR(32) NOT NULL,
|
||||||
quantity INTEGER DEFAULT -1 NULL,
|
third_plat_after_no VARCHAR(32) NOT NULL,
|
||||||
apply_type INTEGER NULL,
|
quantity INTEGER DEFAULT -1 NULL,
|
||||||
apply_reason VARCHAR(100) DEFAULT '-1' NULL,
|
apply_type INTEGER NULL,
|
||||||
apply_pic_urls TEXT NULL,
|
apply_reason VARCHAR(100) DEFAULT '-1' NULL,
|
||||||
refund_amount DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
|
apply_pic_urls TEXT NULL,
|
||||||
refund_status INTEGER DEFAULT 0 NULL,
|
refund_amount DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
|
||||||
refund_reason VARCHAR(255) NULL,
|
refund_status INTEGER DEFAULT 0 NULL,
|
||||||
receiver VARCHAR(125) NULL,
|
refund_reason VARCHAR(255) NULL,
|
||||||
receiver_phone VARCHAR(255) NULL,
|
receiver VARCHAR(125) NULL,
|
||||||
receiver_addr VARCHAR(255) NULL,
|
receiver_phone VARCHAR(255) NULL,
|
||||||
receiver_delivery_no VARCHAR(255) NULL,
|
receiver_addr VARCHAR(255) NULL,
|
||||||
remarks VARCHAR(200) DEFAULT '' NULL,
|
receiver_delivery_no VARCHAR(255) NULL,
|
||||||
version integer DEFAULT 0 NULL,
|
remarks VARCHAR(200) DEFAULT '' NULL,
|
||||||
create_user int8 NULL,
|
version integer DEFAULT 0 NULL,
|
||||||
create_dept int8 NULL,
|
create_user int8 NULL,
|
||||||
create_time TIMESTAMP NULL,
|
create_dept int8 NULL,
|
||||||
update_user int8 NULL,
|
create_time TIMESTAMP NULL,
|
||||||
update_time TIMESTAMP NULL,
|
update_user int8 NULL,
|
||||||
status INTEGER DEFAULT 0 NULL,
|
update_time TIMESTAMP NULL,
|
||||||
is_deleted INTEGER DEFAULT 0 NULL,
|
status INTEGER DEFAULT 0 NULL,
|
||||||
after_info JSON NULL
|
is_deleted INTEGER DEFAULT 0 NULL,
|
||||||
|
after_info JSON NULL
|
||||||
);
|
);
|
||||||
|
|
||||||
COMMENT ON TABLE mall_summary_order_after IS '商品售后订单表';
|
COMMENT ON TABLE mall_summary_order_after IS '商品售后订单表';
|
||||||
@@ -225,6 +257,18 @@ COMMENT ON COLUMN mall_summary_order_after.receiver_addr IS '退件地址';
|
|||||||
COMMENT ON COLUMN mall_summary_order_after.receiver_delivery_no IS '退货物流单号';
|
COMMENT ON COLUMN mall_summary_order_after.receiver_delivery_no IS '退货物流单号';
|
||||||
COMMENT ON COLUMN mall_summary_order_after.remarks IS '备注';
|
COMMENT ON COLUMN mall_summary_order_after.remarks IS '备注';
|
||||||
COMMENT ON COLUMN mall_summary_order_after.status IS '状态';
|
COMMENT ON COLUMN mall_summary_order_after.status IS '状态';
|
||||||
|
COMMENT ON COLUMN mall_summary_order_after.status IS '状态';
|
||||||
|
COMMENT ON COLUMN mall_summary_order_after.is_deleted IS '是否已删除';
|
||||||
|
COMMENT ON COLUMN mall_summary_order_after.after_info IS '售后详情';
|
||||||
|
COMMENT ON COLUMN mall_summary_order_after.refund_amount IS '退款金额';
|
||||||
|
COMMENT ON COLUMN mall_summary_order_after.refund_status IS '处理售后状态';
|
||||||
|
COMMENT ON COLUMN mall_summary_order_after.refund_reason IS '处理回复';
|
||||||
|
COMMENT ON COLUMN mall_summary_order_after.receiver IS '退件收货人姓名';
|
||||||
|
COMMENT ON COLUMN mall_summary_order_after.receiver_phone IS '退件收货人电话';
|
||||||
|
COMMENT ON COLUMN mall_summary_order_after.receiver_addr IS '退件地址';
|
||||||
|
COMMENT ON COLUMN mall_summary_order_after.receiver_delivery_no IS '退货物流单号';
|
||||||
|
COMMENT ON COLUMN mall_summary_order_after.remarks IS '备注';
|
||||||
|
COMMENT ON COLUMN mall_summary_order_after.status IS '状态';
|
||||||
COMMENT ON COLUMN mall_summary_order_after.is_deleted IS '是否已删除';
|
COMMENT ON COLUMN mall_summary_order_after.is_deleted IS '是否已删除';
|
||||||
COMMENT ON COLUMN mall_summary_order_after.after_info IS '售后详情';
|
COMMENT ON COLUMN mall_summary_order_after.after_info IS '售后详情';
|
||||||
|
|
||||||
|
|||||||
@@ -1,39 +1,40 @@
|
|||||||
CREATE TABLE IF NOT EXISTS registration_order (
|
CREATE TABLE registration_order
|
||||||
id BIGINT NOT NULL PRIMARY KEY,
|
(
|
||||||
spu_id BIGINT NULL,
|
id BIGINT NOT NULL PRIMARY KEY,
|
||||||
sku_id BIGINT NULL,
|
spu_id BIGINT NULL,
|
||||||
title VARCHAR(100) NOT NULL,
|
sku_id BIGINT NULL,
|
||||||
transaction_type INTEGER NOT NULL,
|
title VARCHAR(100) NOT NULL,
|
||||||
thumbnail VARCHAR(500) NOT NULL,
|
transaction_type INTEGER NOT NULL,
|
||||||
thumbnail_height INTEGER NULL,
|
thumbnail VARCHAR(500) NOT NULL,
|
||||||
detail TEXT NULL,
|
thumbnail_height INTEGER NULL,
|
||||||
price DECIMAL(10, 2) NOT NULL,
|
detail TEXT NULL,
|
||||||
points DECIMAL(10, 2) NOT NULL,
|
price DECIMAL(10, 2) NOT NULL,
|
||||||
quantity INTEGER NOT NULL,
|
points DECIMAL(10, 2) NOT NULL,
|
||||||
remaining INTEGER NOT NULL,
|
quantity INTEGER NOT NULL,
|
||||||
user_id BIGINT NOT NULL,
|
remaining INTEGER NOT NULL,
|
||||||
user_nickname VARCHAR(100) NULL,
|
user_id BIGINT NOT NULL,
|
||||||
in_transaction INTEGER DEFAULT 0 NOT NULL,
|
user_nickname VARCHAR(100) NULL,
|
||||||
is_full_package INTEGER DEFAULT 0 NOT NULL,
|
in_transaction INTEGER DEFAULT 0 NOT NULL,
|
||||||
delivery_type INTEGER DEFAULT 1 NULL,
|
is_full_package INTEGER DEFAULT 0 NOT NULL,
|
||||||
region_code VARCHAR(10) NULL,
|
delivery_type INTEGER DEFAULT 1 NULL,
|
||||||
region_name VARCHAR(100) NULL,
|
region_code VARCHAR(10) NULL,
|
||||||
receiver_address VARCHAR(100) NULL,
|
region_name VARCHAR(100) NULL,
|
||||||
contact VARCHAR(100) NULL,
|
receiver_address VARCHAR(100) NULL,
|
||||||
contact_number VARCHAR(100) NULL,
|
contact VARCHAR(100) NULL,
|
||||||
is_virtual INTEGER DEFAULT 0 NOT NULL,
|
contact_number VARCHAR(100) NULL,
|
||||||
is_closed INTEGER DEFAULT 0 NOT NULL,
|
is_virtual INTEGER DEFAULT 0 NOT NULL,
|
||||||
version integer DEFAULT 0 NOT NULL,
|
is_closed INTEGER DEFAULT 0 NOT NULL,
|
||||||
create_user int8 NULL,
|
version integer DEFAULT 0 NOT NULL,
|
||||||
create_dept int8 NULL,
|
create_user int8 NULL,
|
||||||
create_time TIMESTAMP(6) NULL,
|
create_dept int8 NULL,
|
||||||
update_user int8 NULL,
|
create_time TIMESTAMP(6) NULL,
|
||||||
update_time TIMESTAMP (6) NULL,
|
update_user int8 NULL,
|
||||||
status INTEGER NULL,
|
update_time TIMESTAMP(6) NULL,
|
||||||
is_deleted INTEGER DEFAULT 0 NULL,
|
status INTEGER NULL,
|
||||||
is_vendor INTEGER DEFAULT 0 NULL,
|
is_deleted INTEGER DEFAULT 0 NULL,
|
||||||
is_priority INTEGER DEFAULT 0 NULL
|
is_vendor INTEGER DEFAULT 0 NULL,
|
||||||
);
|
is_priority INTEGER DEFAULT 0 NULL
|
||||||
|
);
|
||||||
|
|
||||||
COMMENT ON TABLE registration_order IS '挂单表';
|
COMMENT ON TABLE registration_order IS '挂单表';
|
||||||
COMMENT ON COLUMN registration_order.id IS '挂单ID';
|
COMMENT ON COLUMN registration_order.id IS '挂单ID';
|
||||||
@@ -73,40 +74,41 @@ COMMENT ON COLUMN registration_order.is_priority IS '是否优先';
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS transaction_order (
|
CREATE TABLE transaction_order
|
||||||
id BIGINT NOT NULL PRIMARY KEY,
|
(
|
||||||
registration_id BIGINT NOT NULL,
|
id BIGINT NOT NULL PRIMARY KEY,
|
||||||
sku_id BIGINT NULL,
|
registration_id BIGINT NOT NULL,
|
||||||
title VARCHAR(100) NOT NULL,
|
sku_id BIGINT NULL,
|
||||||
transaction_type INTEGER NOT NULL,
|
title VARCHAR(100) NOT NULL,
|
||||||
thumbnail VARCHAR(500) NOT NULL,
|
transaction_type INTEGER NOT NULL,
|
||||||
price DECIMAL(10, 2) NOT NULL,
|
thumbnail VARCHAR(500) NOT NULL,
|
||||||
points DECIMAL(10, 2) NOT NULL,
|
price DECIMAL(10, 2) NOT NULL,
|
||||||
quantity INTEGER NOT NULL,
|
points DECIMAL(10, 2) NOT NULL,
|
||||||
total_amount DECIMAL(10, 2) NOT NULL,
|
quantity INTEGER NOT NULL,
|
||||||
total_points DECIMAL(10, 2) NOT NULL,
|
total_amount DECIMAL(10, 2) NOT NULL,
|
||||||
user_id BIGINT NOT NULL,
|
total_points DECIMAL(10, 2) NOT NULL,
|
||||||
user_nickname VARCHAR(500) NULL,
|
user_id BIGINT NOT NULL,
|
||||||
payment_voucher VARCHAR(500) NULL,
|
user_nickname VARCHAR(500) NULL,
|
||||||
delivery_voucher VARCHAR(500) NULL,
|
payment_voucher VARCHAR(500) NULL,
|
||||||
delivery_type INTEGER DEFAULT 1 NOT NULL,
|
delivery_voucher VARCHAR(500) NULL,
|
||||||
region_code VARCHAR(10) NULL,
|
delivery_type INTEGER DEFAULT 1 NOT NULL,
|
||||||
region_name VARCHAR(100) NULL,
|
region_code VARCHAR(10) NULL,
|
||||||
receiver_address VARCHAR(100) NULL,
|
region_name VARCHAR(100) NULL,
|
||||||
contact VARCHAR(100) NULL,
|
receiver_address VARCHAR(100) NULL,
|
||||||
contact_number VARCHAR(100) NULL,
|
contact VARCHAR(100) NULL,
|
||||||
counterparty_order_id BIGINT DEFAULT 0 NOT NULL,
|
contact_number VARCHAR(100) NULL,
|
||||||
is_virtual INTEGER DEFAULT 0 NOT NULL,
|
counterparty_order_id BIGINT DEFAULT 0 NOT NULL,
|
||||||
supplier_order_sn VARCHAR(100) NULL,
|
is_virtual INTEGER DEFAULT 0 NOT NULL,
|
||||||
expire_time TIMESTAMP(6) NULL,
|
supplier_order_sn VARCHAR(100) NULL,
|
||||||
create_user int8 NULL,
|
expire_time TIMESTAMP NULL,
|
||||||
create_dept int8 NULL,
|
create_user int8 NULL,
|
||||||
create_time TIMESTAMP(6) NULL,
|
create_dept int8 NULL,
|
||||||
update_user int8 NULL,
|
create_time TIMESTAMP(6) NULL,
|
||||||
update_time TIMESTAMP(6) NULL,
|
update_user int8 NULL,
|
||||||
status INTEGER NULL,
|
update_time TIMESTAMP(6) NULL,
|
||||||
is_deleted INTEGER DEFAULT 0 NULL
|
status INTEGER NULL,
|
||||||
);
|
is_deleted INTEGER DEFAULT 0 NULL
|
||||||
|
);
|
||||||
|
|
||||||
COMMENT ON TABLE transaction_order IS '交易单表';
|
COMMENT ON TABLE transaction_order IS '交易单表';
|
||||||
COMMENT ON COLUMN transaction_order.id IS '交易单ID';
|
COMMENT ON COLUMN transaction_order.id IS '交易单ID';
|
||||||
@@ -142,25 +144,26 @@ COMMENT ON COLUMN transaction_order.update_time IS '修改时间';
|
|||||||
COMMENT ON COLUMN transaction_order.status IS '状态 1-待支付 2-已支付 3-待发货 4-已发货 5-已完成';
|
COMMENT ON COLUMN transaction_order.status IS '状态 1-待支付 2-已支付 3-待发货 4-已发货 5-已完成';
|
||||||
COMMENT ON COLUMN transaction_order.is_deleted IS '是否已删除';
|
COMMENT ON COLUMN transaction_order.is_deleted IS '是否已删除';
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS user_inventory (
|
CREATE TABLE user_inventory
|
||||||
id BIGINT NOT NULL PRIMARY KEY,
|
(
|
||||||
user_id BIGINT NOT NULL,
|
id BIGINT NOT NULL PRIMARY KEY,
|
||||||
sku_id BIGINT NOT NULL,
|
user_id BIGINT NOT NULL,
|
||||||
title VARCHAR(100) NOT NULL,
|
sku_id BIGINT NOT NULL,
|
||||||
thumbnail VARCHAR(500) NOT NULL,
|
title VARCHAR(100) NOT NULL,
|
||||||
price DECIMAL(10, 2) NOT NULL,
|
thumbnail VARCHAR(500) NOT NULL,
|
||||||
quantity INTEGER NOT NULL,
|
price DECIMAL(10, 2) NOT NULL,
|
||||||
is_virtual INTEGER DEFAULT 0 NOT NULL,
|
quantity INTEGER NOT NULL,
|
||||||
attribute JSON NULL,
|
is_virtual INTEGER DEFAULT 0 NOT NULL,
|
||||||
version integer DEFAULT 0 NOT NULL,
|
attribute JSON NULL,
|
||||||
create_user int8 NULL,
|
version BIGINT DEFAULT 0 NOT NULL,
|
||||||
create_dept int8 NULL,
|
create_user int8 NULL,
|
||||||
create_time TIMESTAMP(6) NULL,
|
create_dept int8 NULL,
|
||||||
update_user int8 NULL,
|
create_time TIMESTAMP(6) NULL,
|
||||||
update_time TIMESTAMP(6) NULL,
|
update_user int8 NULL,
|
||||||
status INTEGER NULL,
|
update_time TIMESTAMP(6) NULL,
|
||||||
is_deleted INTEGER DEFAULT 0 NULL
|
status INTEGER NULL,
|
||||||
);
|
is_deleted INTEGER DEFAULT 0 NULL
|
||||||
|
);
|
||||||
|
|
||||||
COMMENT ON TABLE user_inventory IS '用户库存';
|
COMMENT ON TABLE user_inventory IS '用户库存';
|
||||||
COMMENT ON COLUMN user_inventory.id IS '库存ID';
|
COMMENT ON COLUMN user_inventory.id IS '库存ID';
|
||||||
@@ -182,18 +185,19 @@ COMMENT ON COLUMN user_inventory.status IS '状态';
|
|||||||
COMMENT ON COLUMN user_inventory.is_deleted IS '是否已删除';
|
COMMENT ON COLUMN user_inventory.is_deleted IS '是否已删除';
|
||||||
|
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS calendar_non_working (
|
CREATE TABLE calendar_non_working
|
||||||
id BIGINT NOT NULL PRIMARY KEY,
|
(
|
||||||
off_date DATE NOT NULL,
|
id BIGINT NOT NULL PRIMARY KEY,
|
||||||
remark VARCHAR(200) NULL,
|
off_date DATE NOT NULL,
|
||||||
create_user int8 NULL,
|
remark VARCHAR(200) NULL,
|
||||||
create_dept int8 NULL,
|
create_user int8 NULL,
|
||||||
create_time TIMESTAMP(6) NULL,
|
create_dept int8 NULL,
|
||||||
update_user int8 NULL,
|
create_time TIMESTAMP(6) NULL,
|
||||||
update_time TIMESTAMP(6) NULL,
|
update_user int8 NULL,
|
||||||
status INTEGER NULL,
|
update_time TIMESTAMP(6) NULL,
|
||||||
is_deleted INTEGER DEFAULT 0 NULL
|
status INTEGER NULL,
|
||||||
);
|
is_deleted INTEGER DEFAULT 0 NULL
|
||||||
|
);
|
||||||
|
|
||||||
COMMENT ON TABLE calendar_non_working IS '节假日';
|
COMMENT ON TABLE calendar_non_working IS '节假日';
|
||||||
COMMENT ON COLUMN calendar_non_working.id IS '主键';
|
COMMENT ON COLUMN calendar_non_working.id IS '主键';
|
||||||
@@ -209,23 +213,24 @@ COMMENT ON COLUMN calendar_non_working.is_deleted IS '是否已删除';
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS user_otc_info (
|
CREATE TABLE user_otc_info
|
||||||
id BIGINT NOT NULL PRIMARY KEY,
|
(
|
||||||
user_id BIGINT NOT NULL,
|
id BIGINT NOT NULL PRIMARY KEY,
|
||||||
alipay_account VARCHAR(200) NULL,
|
user_id BIGINT NOT NULL,
|
||||||
wechat_account VARCHAR(200) NULL,
|
alipay_account VARCHAR(200) NULL,
|
||||||
alipay_qr_code VARCHAR(200) NULL,
|
wechat_account VARCHAR(200) NULL,
|
||||||
wechat_qr_code VARCHAR(200) NULL,
|
alipay_qr_code VARCHAR(200) NULL,
|
||||||
bank_account VARCHAR(200) NULL,
|
wechat_qr_code VARCHAR(200) NULL,
|
||||||
branch_info VARCHAR(200) NULL,
|
bank_account VARCHAR(200) NULL,
|
||||||
create_user int8 NULL,
|
branch_info VARCHAR(200) NULL,
|
||||||
create_dept int8 NULL,
|
create_user int8 NULL,
|
||||||
create_time TIMESTAMP(6) NULL,
|
create_dept int8 NULL,
|
||||||
update_user int8 NULL,
|
create_time TIMESTAMP(6) NULL,
|
||||||
update_time TIMESTAMP(6) NULL,
|
update_user int8 NULL,
|
||||||
status INTEGER NULL,
|
update_time TIMESTAMP(6) NULL,
|
||||||
is_deleted INTEGER DEFAULT 0 NULL
|
status INTEGER NULL,
|
||||||
);
|
is_deleted INTEGER DEFAULT 0 NULL
|
||||||
|
);
|
||||||
|
|
||||||
COMMENT ON TABLE user_otc_info IS 'OTC收款信息';
|
COMMENT ON TABLE user_otc_info IS 'OTC收款信息';
|
||||||
COMMENT ON COLUMN user_otc_info.id IS 'ID';
|
COMMENT ON COLUMN user_otc_info.id IS 'ID';
|
||||||
|
|||||||
@@ -1,19 +1,20 @@
|
|||||||
CREATE TABLE IF NOT EXISTS regions_info (
|
CREATE TABLE regions_info
|
||||||
id SERIAL PRIMARY KEY,
|
(
|
||||||
name VARCHAR(50) NULL,
|
id SERIAL PRIMARY KEY,
|
||||||
level INTEGER NULL,
|
name VARCHAR(50) NULL,
|
||||||
pid INTEGER DEFAULT 0 NULL,
|
level INTEGER NULL,
|
||||||
lon DECIMAL(10, 6) NULL,
|
pid INTEGER DEFAULT 0 NULL,
|
||||||
lat DECIMAL(10, 6) NULL,
|
lon DECIMAL(10, 6) NULL,
|
||||||
region_code VARCHAR(128) NULL,
|
lat DECIMAL(10, 6) NULL,
|
||||||
full_name VARCHAR(200) NULL,
|
region_code VARCHAR(128) NULL,
|
||||||
vendor_region_id BIGINT NULL,
|
full_name VARCHAR(200) NULL,
|
||||||
store_city_id BIGINT NULL,
|
vendor_region_id BIGINT NULL,
|
||||||
hotel_city_code VARCHAR(128) NULL,
|
store_city_id BIGINT NULL,
|
||||||
hotel_city_pinyin VARCHAR(128) NULL,
|
hotel_city_code VARCHAR(128) NULL,
|
||||||
hotel_city_initials VARCHAR(4) NULL,
|
hotel_city_pinyin VARCHAR(128) NULL,
|
||||||
sight_city_name VARCHAR(32) NULL
|
hotel_city_initials VARCHAR(4) NULL,
|
||||||
);
|
sight_city_name VARCHAR(32) NULL
|
||||||
|
);
|
||||||
|
|
||||||
COMMENT ON TABLE regions_info IS '地区详情表';
|
COMMENT ON TABLE regions_info IS '地区详情表';
|
||||||
COMMENT ON COLUMN regions_info.id IS '主键';
|
COMMENT ON COLUMN regions_info.id IS '主键';
|
||||||
|
|||||||
@@ -1,19 +1,20 @@
|
|||||||
CREATE TABLE IF NOT EXISTS user_daily_sign (
|
CREATE TABLE user_daily_sign
|
||||||
id BIGINT NOT NULL PRIMARY KEY,
|
(
|
||||||
user_id BIGINT NULL,
|
id BIGINT NOT NULL PRIMARY KEY,
|
||||||
user_phone bigint,
|
user_id BIGINT NULL,
|
||||||
user_name varchar(128),
|
user_phone bigint,
|
||||||
statistics_date DATE NULL,
|
user_name varchar(128),
|
||||||
sign_count INTEGER NULL,
|
statistics_date DATE NULL,
|
||||||
type INTEGER DEFAULT 1 NULL,
|
sign_count INTEGER NULL,
|
||||||
remarks TEXT NULL,
|
type INTEGER DEFAULT 1 NULL,
|
||||||
is_deleted INTEGER DEFAULT 0 NULL,
|
remarks TEXT NULL,
|
||||||
create_time TIMESTAMP(6) NULL,
|
is_deleted INTEGER DEFAULT 0 NULL,
|
||||||
create_user int8 NULL,
|
create_time TIMESTAMP(6) NULL,
|
||||||
update_time TIMESTAMP(6) NULL,
|
create_user int8 NULL,
|
||||||
update_user int8 NULL,
|
update_time TIMESTAMP(6) NULL,
|
||||||
status INTEGER NULL,
|
update_user int8 NULL,
|
||||||
create_dept BIGINT NULL
|
status INTEGER NULL,
|
||||||
|
create_dept BIGINT NULL
|
||||||
);
|
);
|
||||||
|
|
||||||
COMMENT ON TABLE user_daily_sign IS '用户看广告记录表';
|
COMMENT ON TABLE user_daily_sign IS '用户看广告记录表';
|
||||||
@@ -40,20 +41,21 @@ CREATE INDEX uds_uid_index
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
CREATE TABLE ads (
|
CREATE TABLE ads
|
||||||
id BIGINT NOT NULL PRIMARY KEY,
|
(
|
||||||
name VARCHAR(255) NULL,
|
id BIGINT NOT NULL PRIMARY KEY,
|
||||||
url VARCHAR(255) NULL,
|
name VARCHAR(255) NULL,
|
||||||
sort INTEGER DEFAULT 1,
|
url VARCHAR(255) NULL,
|
||||||
type INTEGER DEFAULT 1,
|
sort INTEGER DEFAULT 1,
|
||||||
ads_time INTEGER NULL,
|
type INTEGER DEFAULT 1,
|
||||||
is_deleted INTEGER DEFAULT 0,
|
ads_time INTEGER NULL,
|
||||||
create_time TIMESTAMP(6) NULL,
|
is_deleted INTEGER DEFAULT 0,
|
||||||
create_user int8 NULL,
|
create_time TIMESTAMP(6) NULL,
|
||||||
update_time TIMESTAMP(6) NULL,
|
create_user int8 NULL,
|
||||||
update_user int8 NULL,
|
update_time TIMESTAMP(6) NULL,
|
||||||
create_dept int8 NULL,
|
update_user int8 NULL,
|
||||||
status INTEGER NULL
|
create_dept int8 NULL,
|
||||||
|
status INTEGER NULL
|
||||||
);
|
);
|
||||||
|
|
||||||
COMMENT ON TABLE ads IS '广告表';
|
COMMENT ON TABLE ads IS '广告表';
|
||||||
|
|||||||
@@ -1,23 +1,23 @@
|
|||||||
create table user_genealogy
|
create table user_genealogy
|
||||||
(
|
(
|
||||||
id bigint not null primary key,
|
id bigint not null primary key,
|
||||||
name varchar(128),
|
name varchar(128),
|
||||||
phone bigint,
|
phone bigint,
|
||||||
level integer default 1, --当前层数
|
level integer default 1, --当前层数
|
||||||
pid bigint,
|
pid bigint,
|
||||||
root_id bigint, --遍历当前树
|
root_id bigint, --遍历当前树
|
||||||
group_id bigint, --树内最近团队长的id
|
group_id bigint, --树内最近团队长的id
|
||||||
genealogy_list bigint[] , -- 往上所有父级
|
genealogy_list bigint[], -- 往上所有父级
|
||||||
user_child_number int, --用户下线总人数
|
user_child_number int, --用户下线总人数
|
||||||
user_direct_number int, --用户直推总人数
|
user_direct_number int, --用户直推总人数
|
||||||
user_direct_list bigint[], --直推列表
|
user_direct_list bigint[], --直推列表
|
||||||
create_user int8,
|
create_user int8,
|
||||||
create_dept int8,
|
create_dept int8,
|
||||||
create_time timestamp(6),
|
create_time timestamp(6),
|
||||||
update_user int8,
|
update_user int8,
|
||||||
update_time timestamp(6),
|
update_time timestamp(6),
|
||||||
status integer default 1,
|
status integer default 1,
|
||||||
is_deleted integer default 0
|
is_deleted integer default 0
|
||||||
);
|
);
|
||||||
|
|
||||||
CREATE INDEX user_genealogy_list_gin_idx
|
CREATE INDEX user_genealogy_list_gin_idx
|
||||||
@@ -54,14 +54,14 @@ alter table user_genealogy
|
|||||||
|
|
||||||
create table user_tree
|
create table user_tree
|
||||||
(
|
(
|
||||||
id bigint not null primary key,
|
id bigint not null primary key,
|
||||||
name varchar(128),
|
name varchar(128),
|
||||||
phone bigint,
|
phone bigint,
|
||||||
level integer default 1,
|
level integer default 1,
|
||||||
pid bigint,
|
pid bigint,
|
||||||
p_name varchar(128),
|
p_name varchar(128),
|
||||||
p_phone bigint,
|
p_phone bigint,
|
||||||
p_level integer default 1,
|
p_level integer default 1,
|
||||||
create_user int8,
|
create_user int8,
|
||||||
create_dept int8,
|
create_dept int8,
|
||||||
create_time timestamp(6),
|
create_time timestamp(6),
|
||||||
@@ -96,25 +96,25 @@ alter table user_tree
|
|||||||
|
|
||||||
create table user_increase_day
|
create table user_increase_day
|
||||||
(
|
(
|
||||||
id bigint not null primary key,
|
id bigint not null primary key,
|
||||||
name varchar(128),
|
name varchar(128),
|
||||||
phone bigint,
|
phone bigint,
|
||||||
number integer default 1, -- 新增人数
|
number integer default 1, -- 新增人数
|
||||||
direct_number integer default 1, -- 新增人数
|
direct_number integer default 1, -- 新增人数
|
||||||
user_benefit decimal(14,4) default 0, --福利值
|
user_benefit decimal(14, 4) default 0, --福利值
|
||||||
order_amount decimal(14,4) default 0, --订单金额(整个团队)
|
order_amount decimal(14, 4) default 0, --订单金额(整个团队)
|
||||||
current_level_id int , --用户当前等级
|
current_level_id int, --用户当前等级
|
||||||
current_level_name varchar(12) , --用户当前等级
|
current_level_name varchar(12), --用户当前等级
|
||||||
p_name varchar(128),
|
p_name varchar(128),
|
||||||
p_phone bigint,
|
p_phone bigint,
|
||||||
p_level integer default 1,
|
p_level integer default 1,
|
||||||
create_user int8,
|
create_user int8,
|
||||||
create_dept int8,
|
create_dept int8,
|
||||||
create_time timestamp(6),
|
create_time timestamp(6),
|
||||||
update_user int8,
|
update_user int8,
|
||||||
update_time timestamp(6),
|
update_time timestamp(6),
|
||||||
status integer default 1,
|
status integer default 1,
|
||||||
is_deleted integer default 0
|
is_deleted integer default 0
|
||||||
);
|
);
|
||||||
create index user_increase_day_phone_index
|
create index user_increase_day_phone_index
|
||||||
on user_increase_day (is_deleted, phone);
|
on user_increase_day (is_deleted, phone);
|
||||||
@@ -140,26 +140,27 @@ alter table user_increase_day
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
CREATE TABLE level_info (
|
CREATE TABLE level_info
|
||||||
id BIGINT NOT NULL PRIMARY KEY,
|
(
|
||||||
name VARCHAR(128) NULL,
|
id BIGINT NOT NULL PRIMARY KEY,
|
||||||
child_qty INTEGER NULL,
|
name VARCHAR(128) NULL,
|
||||||
performance DECIMAL(16, 4) NULL,
|
child_qty INTEGER NULL,
|
||||||
|
performance DECIMAL(16, 4) NULL,
|
||||||
performance_benefit DECIMAL(16, 4) NULL,
|
performance_benefit DECIMAL(16, 4) NULL,
|
||||||
next_level_id BIGINT , --晋升等级id
|
next_level_id BIGINT, --晋升等级id
|
||||||
is_lowest int DEFAULT 0, --是否最低等级
|
is_lowest int DEFAULT 0, --是否最低等级
|
||||||
is_highest int DEFAULT 0, --是否最高等级
|
is_highest int DEFAULT 0, --是否最高等级
|
||||||
bonus_cash_day DECIMAL(16, 4) NULL,
|
bonus_cash_day DECIMAL(16, 4) NULL,
|
||||||
bonus_cash_all DECIMAL(16, 4) NULL,
|
bonus_cash_all DECIMAL(16, 4) NULL,
|
||||||
bonus_benefit DECIMAL(16, 4) NULL,
|
bonus_benefit DECIMAL(16, 4) NULL,
|
||||||
version integer DEFAULT 1,
|
version integer DEFAULT 1,
|
||||||
create_user int8,
|
create_user int8,
|
||||||
create_dept int8,
|
create_dept int8,
|
||||||
create_time timestamp(6),
|
create_time timestamp(6),
|
||||||
update_user int8,
|
update_user int8,
|
||||||
update_time timestamp(6),
|
update_time timestamp(6),
|
||||||
status integer default 1,
|
status integer default 1,
|
||||||
is_deleted integer default 0
|
is_deleted integer default 0
|
||||||
);
|
);
|
||||||
|
|
||||||
COMMENT ON TABLE level_info IS '等级信息表';
|
COMMENT ON TABLE level_info IS '等级信息表';
|
||||||
@@ -187,20 +188,20 @@ alter table level_info
|
|||||||
|
|
||||||
create table user_level_log
|
create table user_level_log
|
||||||
(
|
(
|
||||||
id bigint not null primary key,
|
id bigint not null primary key,
|
||||||
statistical_date timestamp(6),
|
statistical_date timestamp(6),
|
||||||
user_id bigint,
|
user_id bigint,
|
||||||
user_phone bigint,
|
user_phone bigint,
|
||||||
user_name varchar(128),
|
user_name varchar(128),
|
||||||
level_id bigint,
|
level_id bigint,
|
||||||
level_name varchar(128),
|
level_name varchar(128),
|
||||||
is_lowest int , --是否最低等级
|
is_lowest int, --是否最低等级
|
||||||
is_highest int, --是否最高等级
|
is_highest int, --是否最高等级
|
||||||
bonus_cash_day DECIMAL(16, 4) NULL,
|
bonus_cash_day DECIMAL(16, 4) NULL,
|
||||||
bonus_cash_all DECIMAL(16, 4) NULL,
|
bonus_cash_all DECIMAL(16, 4) NULL,
|
||||||
bonus_benefit DECIMAL(16, 4) NULL,
|
bonus_benefit DECIMAL(16, 4) NULL,
|
||||||
bonus_detail text,
|
bonus_detail text,
|
||||||
remark text,
|
remark text,
|
||||||
create_user int8,
|
create_user int8,
|
||||||
create_dept int8,
|
create_dept int8,
|
||||||
create_time timestamp(6),
|
create_time timestamp(6),
|
||||||
@@ -241,29 +242,29 @@ alter table user_level_log
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
CREATE TABLE package_info
|
||||||
CREATE TABLE package_info (
|
(
|
||||||
id BIGINT NOT NULL PRIMARY KEY,
|
id BIGINT NOT NULL PRIMARY KEY,
|
||||||
name VARCHAR(128) NULL,
|
name VARCHAR(128) NULL,
|
||||||
buy_qty INTEGER default 0, -- 最大购买数量
|
buy_qty INTEGER default 0, -- 最大购买数量
|
||||||
day_total decimal(16,4) default 0, -- 产出总天数
|
day_total decimal(16, 4) default 0, -- 产出总天数
|
||||||
amount_total decimal(14,4) default 0, -- 总产出福利积分
|
amount_total decimal(14, 4) default 0, -- 总产出福利积分
|
||||||
give_amount decimal(14,4) default 0, -- 购买赠与福利值
|
give_amount decimal(14, 4) default 0, -- 购买赠与福利值
|
||||||
bonus decimal(16,4) default 0, -- 激活比率
|
bonus decimal(16, 4) default 0, -- 激活比率
|
||||||
user_benefit decimal(14,4) default 0, --兑换包需要的福利积分
|
user_benefit decimal(14, 4) default 0, --兑换包需要的福利积分
|
||||||
user_cash decimal(14,4) default 0, --兑换包需要的现金券
|
user_cash decimal(14, 4) default 0, --兑换包需要的现金券
|
||||||
is_need_benefit int DEFAULT 0, --是否需要福利积分
|
is_need_benefit int DEFAULT 0, --是否需要福利积分
|
||||||
is_need_cash int DEFAULT 0, --是否需要现金券
|
is_need_cash int DEFAULT 0, --是否需要现金券
|
||||||
max_exchange_qty integer default 0, -- 全网最大兑换数量
|
max_exchange_qty integer default 0, -- 全网最大兑换数量
|
||||||
exchanged_qty integer default 0, -- 已兑换数量
|
exchanged_qty integer default 0, -- 已兑换数量
|
||||||
version integer default 1,
|
version integer default 1,
|
||||||
create_user int8,
|
create_user int8,
|
||||||
create_dept int8,
|
create_dept int8,
|
||||||
create_time timestamp(6),
|
create_time timestamp(6),
|
||||||
update_user int8,
|
update_user int8,
|
||||||
update_time timestamp(6),
|
update_time timestamp(6),
|
||||||
status integer default 1,
|
status integer default 1,
|
||||||
is_deleted integer default 0
|
is_deleted integer default 0
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -294,35 +295,34 @@ alter table package_info
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
create table user_package_info
|
create table user_package_info
|
||||||
(
|
(
|
||||||
id bigint not null primary key,
|
id bigint not null primary key,
|
||||||
statistical_date timestamp(6),
|
statistical_date timestamp(6),
|
||||||
user_id bigint,
|
user_id bigint,
|
||||||
phone bigint,
|
phone bigint,
|
||||||
user_name varchar(128),
|
user_name varchar(128),
|
||||||
package_id bigint,
|
package_id bigint,
|
||||||
package_name varchar(128),
|
package_name varchar(128),
|
||||||
user_benefit decimal(14,4) default 0, --兑换包需要的福利积分
|
user_benefit decimal(14, 4) default 0, --兑换包需要的福利积分
|
||||||
user_cash decimal(14,4) default 0, --兑换包需要的现金券
|
user_cash decimal(14, 4) default 0, --兑换包需要的现金券
|
||||||
give_amount decimal(14,4) default 0, -- 购买赠与福利值
|
give_amount decimal(14, 4) default 0, -- 购买赠与福利值
|
||||||
day_total decimal(16,4) default 0, -- 产出总天数
|
day_total decimal(16, 4) default 0, -- 产出总天数
|
||||||
amount_total decimal(14,4) default 0, -- 总产出福利积分
|
amount_total decimal(14, 4) default 0, -- 总产出福利积分
|
||||||
amount_day decimal(14,4) default 0, -- 每日产出福利积分 = 总产出 / 总产出
|
amount_day decimal(14, 4) default 0, -- 每日产出福利积分 = 总产出 / 总产出
|
||||||
amount_out decimal(16,4) default 0, -- 已产出福利积分
|
amount_out decimal(16, 4) default 0, -- 已产出福利积分
|
||||||
out_day decimal(16,4) default 0, -- 已产出天数
|
out_day decimal(16, 4) default 0, -- 已产出天数
|
||||||
is_complete integer default 0, -- 是否完成 0未完成 1完成
|
is_complete integer default 0, -- 是否完成 0未完成 1完成
|
||||||
expired_date timestamp(6),
|
expired_date timestamp(6),
|
||||||
is_expired integer default 0,
|
is_expired integer default 0,
|
||||||
remark text,
|
remark text,
|
||||||
create_user int8,
|
create_user int8,
|
||||||
create_dept int8,
|
create_dept int8,
|
||||||
create_time timestamp(6),
|
create_time timestamp(6),
|
||||||
update_user int8,
|
update_user int8,
|
||||||
update_time timestamp(6),
|
update_time timestamp(6),
|
||||||
status integer default 1,
|
status integer default 1,
|
||||||
is_deleted integer default 0
|
is_deleted integer default 0
|
||||||
);
|
);
|
||||||
|
|
||||||
create index upi_complete_index
|
create index upi_complete_index
|
||||||
@@ -366,42 +366,42 @@ alter table user_package_info
|
|||||||
|
|
||||||
create table user_package_info_copy
|
create table user_package_info_copy
|
||||||
(
|
(
|
||||||
id bigint not null primary key,
|
id bigint not null primary key,
|
||||||
statistical_date timestamp(6),
|
statistical_date timestamp(6),
|
||||||
user_id bigint,
|
user_id bigint,
|
||||||
phone bigint,
|
phone bigint,
|
||||||
user_name varchar(128),
|
user_name varchar(128),
|
||||||
user_package_info bigint, --user_package_info id
|
user_package_info bigint, --user_package_info id
|
||||||
package_id bigint,
|
package_id bigint,
|
||||||
package_name varchar(128),
|
package_name varchar(128),
|
||||||
user_benefit decimal(14,4) default 0, --兑换包需要的福利积分
|
user_benefit decimal(14, 4) default 0, --兑换包需要的福利积分
|
||||||
user_cash decimal(14,4) default 0, --兑换包需要的现金券
|
user_cash decimal(14, 4) default 0, --兑换包需要的现金券
|
||||||
give_amount decimal(14,4) default 0, -- 购买赠与福利值
|
give_amount decimal(14, 4) default 0, -- 购买赠与福利值
|
||||||
day_total decimal(16,4) default 0, -- 产出总天数
|
day_total decimal(16, 4) default 0, -- 产出总天数
|
||||||
amount_total decimal(14,4) default 0, -- 总产出福利积分
|
amount_total decimal(14, 4) default 0, -- 总产出福利积分
|
||||||
amount_day decimal(14,4) default 0, -- 每日产出福利积分 = 总产出 / 总产出
|
amount_day decimal(14, 4) default 0, -- 每日产出福利积分 = 总产出 / 总产出
|
||||||
amount_out decimal(16,4) default 0, -- 已产出多少福利积分
|
amount_out decimal(16, 4) default 0, -- 已产出多少福利积分
|
||||||
remaining_amount decimal(16,4) default 0, -- 剩余可产出福利积分 (总计 - 已经经历多少天 * 每天产出 - 加速积分)
|
remaining_amount decimal(16, 4) default 0, -- 剩余可产出福利积分 (总计 - 已经经历多少天 * 每天产出 - 加速积分)
|
||||||
accelerated_amount decimal(16,4) default 0, -- 已加速多少福利积分
|
accelerated_amount decimal(16, 4) default 0, -- 已加速多少福利积分
|
||||||
parent_id bigint, -- 给到谁10%积分,到用户id
|
parent_id bigint, -- 给到谁10%积分,到用户id
|
||||||
parent_amount decimal(16,4) default 0, -- 给到谁10%积分,到积分账户(福利积分)
|
parent_amount decimal(16, 4) default 0, -- 给到谁10%积分,到积分账户(福利积分)
|
||||||
out_day decimal(16,4) default 0, -- 产出天数 当前包已经产出天数
|
out_day decimal(16, 4) default 0, -- 产出天数 当前包已经产出天数
|
||||||
experience_day decimal(16,4) default 0, -- 当前包已经经历的天数
|
experience_day decimal(16, 4) default 0, -- 当前包已经经历的天数
|
||||||
not_sign_list bigint[], -- 未签到日期详情 (数组)
|
not_sign_list bigint[], -- 未签到日期详情 (数组)
|
||||||
is_complete integer default 0, -- 是否完成 0未完成 1完成
|
is_complete integer default 0, -- 是否完成 0未完成 1完成
|
||||||
start_time timestamp(6), -- 当前包生效时间
|
start_time timestamp(6), -- 当前包生效时间
|
||||||
sign_bitmap bigint default 0, -- 位图将包的签到时间360天二进制转成十进制
|
sign_bitmap bigint default 0, -- 位图将包的签到时间360天二进制转成十进制
|
||||||
expired_date timestamp(6),
|
expired_date timestamp(6),
|
||||||
is_expired integer default 0,
|
is_expired integer default 0,
|
||||||
version integer default 1,
|
version integer default 1,
|
||||||
remark text,
|
remark text,
|
||||||
create_user int8,
|
create_user int8,
|
||||||
create_dept int8,
|
create_dept int8,
|
||||||
create_time timestamp(6),
|
create_time timestamp(6),
|
||||||
update_user int8,
|
update_user int8,
|
||||||
update_time timestamp(6),
|
update_time timestamp(6),
|
||||||
status integer default 1,
|
status integer default 1,
|
||||||
is_deleted integer default 0
|
is_deleted integer default 0
|
||||||
|
|
||||||
);
|
);
|
||||||
create index upi_copy_complete_index
|
create index upi_copy_complete_index
|
||||||
@@ -453,19 +453,19 @@ COMMENT ON COLUMN user_package_info_copy.is_deleted IS '是否已删除';
|
|||||||
-- 佣金账户表
|
-- 佣金账户表
|
||||||
create table user_commission_account
|
create table user_commission_account
|
||||||
(
|
(
|
||||||
id bigint not null primary key,
|
id bigint not null primary key,
|
||||||
account_name varchar(128), -- 账户名称
|
account_name varchar(128), -- 账户名称
|
||||||
account_number varchar(64), -- 账户编号
|
account_number varchar(64), -- 账户编号
|
||||||
account_code varchar(64), -- 账户代码
|
account_code varchar(64), -- 账户代码
|
||||||
amount decimal(14,4) default 0, -- 账户总余额
|
amount decimal(14, 4) default 0, -- 账户总余额
|
||||||
version int default 1,
|
version int default 1,
|
||||||
create_user int8,
|
create_user int8,
|
||||||
create_dept int8,
|
create_dept int8,
|
||||||
create_time timestamp(6),
|
create_time timestamp(6),
|
||||||
update_user int8,
|
update_user int8,
|
||||||
update_time timestamp(6),
|
update_time timestamp(6),
|
||||||
status integer default 1,
|
status integer default 1,
|
||||||
is_deleted integer default 0
|
is_deleted integer default 0
|
||||||
);
|
);
|
||||||
|
|
||||||
create index user_commission_account_index
|
create index user_commission_account_index
|
||||||
@@ -492,31 +492,31 @@ alter table user_commission_account
|
|||||||
-- 25%商品成本佣金流水表
|
-- 25%商品成本佣金流水表
|
||||||
create table user_commission_goods_cost_log
|
create table user_commission_goods_cost_log
|
||||||
(
|
(
|
||||||
id bigint not null primary key,
|
id bigint not null primary key,
|
||||||
account_id bigint, -- 账户id
|
account_id bigint, -- 账户id
|
||||||
account_name varchar(128), -- 账户名称
|
account_name varchar(128), -- 账户名称
|
||||||
account_number varchar(64), -- 账户编号
|
account_number varchar(64), -- 账户编号
|
||||||
account_code varchar(64), -- 账户代码
|
account_code varchar(64), -- 账户代码
|
||||||
user_id bigint,
|
user_id bigint,
|
||||||
user_phone bigint,
|
user_phone bigint,
|
||||||
user_name varchar(128),
|
user_name varchar(128),
|
||||||
amount decimal(14,4) default 0, -- 变动金额
|
amount decimal(14, 4) default 0, -- 变动金额
|
||||||
source_id bigint, -- 来源id
|
source_id bigint, -- 来源id
|
||||||
source_detail text, -- 来源详情
|
source_detail text, -- 来源详情
|
||||||
order_id bigint, -- 订单id
|
order_id bigint, -- 订单id
|
||||||
order_detail text, -- 订单详情
|
order_detail text, -- 订单详情
|
||||||
type int default 1, -- 类型 1-收入 2-支出
|
type int default 1, -- 类型 1-收入 2-支出
|
||||||
statistical_date timestamp(6), -- 统计时间
|
statistical_date timestamp(6), -- 统计时间
|
||||||
channel varchar(64), -- 渠道
|
channel varchar(64), -- 渠道
|
||||||
channel_detail text, -- 渠道详情
|
channel_detail text, -- 渠道详情
|
||||||
remark text, -- 备注
|
remark text, -- 备注
|
||||||
create_user int8,
|
create_user int8,
|
||||||
create_dept int8,
|
create_dept int8,
|
||||||
create_time timestamp(6),
|
create_time timestamp(6),
|
||||||
update_user int8,
|
update_user int8,
|
||||||
update_time timestamp(6),
|
update_time timestamp(6),
|
||||||
status integer default 1,
|
status integer default 1,
|
||||||
is_deleted integer default 0
|
is_deleted integer default 0
|
||||||
);
|
);
|
||||||
|
|
||||||
create index ucc_log_date_index
|
create index ucc_log_date_index
|
||||||
@@ -555,31 +555,31 @@ alter table user_commission_goods_cost_log
|
|||||||
-- 30%购买人获取用户积分佣金流水表
|
-- 30%购买人获取用户积分佣金流水表
|
||||||
create table user_commission_user_point_log
|
create table user_commission_user_point_log
|
||||||
(
|
(
|
||||||
id bigint not null primary key,
|
id bigint not null primary key,
|
||||||
account_id bigint, -- 账户id
|
account_id bigint, -- 账户id
|
||||||
account_name varchar(128), -- 账户名称
|
account_name varchar(128), -- 账户名称
|
||||||
account_number varchar(64), -- 账户编号
|
account_number varchar(64), -- 账户编号
|
||||||
account_code varchar(64), -- 账户代码
|
account_code varchar(64), -- 账户代码
|
||||||
user_id bigint,
|
user_id bigint,
|
||||||
user_phone bigint,
|
user_phone bigint,
|
||||||
user_name varchar(128),
|
user_name varchar(128),
|
||||||
amount decimal(14,4) default 0, -- 变动金额
|
amount decimal(14, 4) default 0, -- 变动金额
|
||||||
source_id bigint, -- 来源id
|
source_id bigint, -- 来源id
|
||||||
source_detail text, -- 来源详情
|
source_detail text, -- 来源详情
|
||||||
order_id bigint, -- 订单id
|
order_id bigint, -- 订单id
|
||||||
order_detail text, -- 订单详情
|
order_detail text, -- 订单详情
|
||||||
type int default 1, -- 类型 1-收入 2-支出
|
type int default 1, -- 类型 1-收入 2-支出
|
||||||
statistical_date timestamp(6), -- 统计时间
|
statistical_date timestamp(6), -- 统计时间
|
||||||
channel varchar(64), -- 渠道
|
channel varchar(64), -- 渠道
|
||||||
channel_detail text, -- 渠道详情
|
channel_detail text, -- 渠道详情
|
||||||
remark text, -- 备注
|
remark text, -- 备注
|
||||||
create_user int8,
|
create_user int8,
|
||||||
create_dept int8,
|
create_dept int8,
|
||||||
create_time timestamp(6),
|
create_time timestamp(6),
|
||||||
update_user int8,
|
update_user int8,
|
||||||
update_time timestamp(6),
|
update_time timestamp(6),
|
||||||
status integer default 1,
|
status integer default 1,
|
||||||
is_deleted integer default 0
|
is_deleted integer default 0
|
||||||
);
|
);
|
||||||
|
|
||||||
create index ucup_log_date_index
|
create index ucup_log_date_index
|
||||||
@@ -618,31 +618,31 @@ alter table user_commission_user_point_log
|
|||||||
-- 10%直推人佣金流水表
|
-- 10%直推人佣金流水表
|
||||||
create table user_commission_direct_push_log
|
create table user_commission_direct_push_log
|
||||||
(
|
(
|
||||||
id bigint not null primary key,
|
id bigint not null primary key,
|
||||||
account_id bigint, -- 账户id
|
account_id bigint, -- 账户id
|
||||||
account_name varchar(128), -- 账户名称
|
account_name varchar(128), -- 账户名称
|
||||||
account_number varchar(64), -- 账户编号
|
account_number varchar(64), -- 账户编号
|
||||||
account_code varchar(64), -- 账户代码
|
account_code varchar(64), -- 账户代码
|
||||||
user_id bigint,
|
user_id bigint,
|
||||||
user_phone bigint,
|
user_phone bigint,
|
||||||
user_name varchar(128),
|
user_name varchar(128),
|
||||||
amount decimal(14,4) default 0, -- 变动金额
|
amount decimal(14, 4) default 0, -- 变动金额
|
||||||
source_id bigint, -- 来源id
|
source_id bigint, -- 来源id
|
||||||
source_detail text, -- 来源详情
|
source_detail text, -- 来源详情
|
||||||
order_id bigint, -- 订单id
|
order_id bigint, -- 订单id
|
||||||
order_detail text, -- 订单详情
|
order_detail text, -- 订单详情
|
||||||
type int default 1, -- 类型 1-收入 2-支出
|
type int default 1, -- 类型 1-收入 2-支出
|
||||||
statistical_date timestamp(6), -- 统计时间
|
statistical_date timestamp(6), -- 统计时间
|
||||||
channel varchar(64), -- 渠道
|
channel varchar(64), -- 渠道
|
||||||
channel_detail text, -- 渠道详情
|
channel_detail text, -- 渠道详情
|
||||||
remark text, -- 备注
|
remark text, -- 备注
|
||||||
create_user int8,
|
create_user int8,
|
||||||
create_dept int8,
|
create_dept int8,
|
||||||
create_time timestamp(6),
|
create_time timestamp(6),
|
||||||
update_user int8,
|
update_user int8,
|
||||||
update_time timestamp(6),
|
update_time timestamp(6),
|
||||||
status integer default 1,
|
status integer default 1,
|
||||||
is_deleted integer default 0
|
is_deleted integer default 0
|
||||||
);
|
);
|
||||||
|
|
||||||
create index ucdp_log_date_index
|
create index ucdp_log_date_index
|
||||||
@@ -681,33 +681,33 @@ alter table user_commission_direct_push_log
|
|||||||
-- 5%运营佣金流水表
|
-- 5%运营佣金流水表
|
||||||
create table user_commission_operation_log
|
create table user_commission_operation_log
|
||||||
(
|
(
|
||||||
id bigint not null primary key,
|
id bigint not null primary key,
|
||||||
account_id bigint, -- 账户id
|
account_id bigint, -- 账户id
|
||||||
account_name varchar(128), -- 账户名称
|
account_name varchar(128), -- 账户名称
|
||||||
account_number varchar(64), -- 账户编号
|
account_number varchar(64), -- 账户编号
|
||||||
account_code varchar(64), -- 账户代码
|
account_code varchar(64), -- 账户代码
|
||||||
user_id bigint,
|
user_id bigint,
|
||||||
user_phone bigint,
|
user_phone bigint,
|
||||||
user_name varchar(128),
|
user_name varchar(128),
|
||||||
amount decimal(14,4) default 0, -- 变动金额
|
amount decimal(14, 4) default 0, -- 变动金额
|
||||||
source_id bigint, -- 来源id
|
source_id bigint, -- 来源id
|
||||||
source_detail text, -- 来源详情
|
source_detail text, -- 来源详情
|
||||||
order_id bigint, -- 订单id
|
order_id bigint, -- 订单id
|
||||||
order_detail text, -- 订单详情
|
order_detail text, -- 订单详情
|
||||||
type int default 1, -- 类型 1-收入 2-支出
|
type int default 1, -- 类型 1-收入 2-支出
|
||||||
statistical_date timestamp(6), -- 统计时间
|
statistical_date timestamp(6), -- 统计时间
|
||||||
channel varchar(64), -- 渠道
|
channel varchar(64), -- 渠道
|
||||||
channel_detail text, -- 渠道详情
|
channel_detail text, -- 渠道详情
|
||||||
remark text, -- 备注
|
remark text, -- 备注
|
||||||
random_deduction decimal(14,4) default 0, -- 随机立减金额
|
random_deduction decimal(14, 4) default 0, -- 随机立减金额
|
||||||
random_deduction_desc text, -- 随机立减说明
|
random_deduction_desc text, -- 随机立减说明
|
||||||
create_user int8,
|
create_user int8,
|
||||||
create_dept int8,
|
create_dept int8,
|
||||||
create_time timestamp(6),
|
create_time timestamp(6),
|
||||||
update_user int8,
|
update_user int8,
|
||||||
update_time timestamp(6),
|
update_time timestamp(6),
|
||||||
status integer default 1,
|
status integer default 1,
|
||||||
is_deleted integer default 0
|
is_deleted integer default 0
|
||||||
);
|
);
|
||||||
|
|
||||||
create index ucop_log_date_index
|
create index ucop_log_date_index
|
||||||
@@ -748,30 +748,30 @@ alter table user_commission_operation_log
|
|||||||
-- 5%广告补贴佣金流水表
|
-- 5%广告补贴佣金流水表
|
||||||
create table user_commission_advertising_log
|
create table user_commission_advertising_log
|
||||||
(
|
(
|
||||||
id bigint not null primary key,
|
id bigint not null primary key,
|
||||||
account_id bigint, -- 账户id
|
account_id bigint, -- 账户id
|
||||||
account_name varchar(128), -- 账户名称
|
account_name varchar(128), -- 账户名称
|
||||||
account_number varchar(64), -- 账户编号
|
account_number varchar(64), -- 账户编号
|
||||||
account_code varchar(64), -- 账户代码
|
account_code varchar(64), -- 账户代码
|
||||||
amount decimal(14,4) default 0, -- 变动金额
|
amount decimal(14, 4) default 0, -- 变动金额
|
||||||
source_id bigint, -- 来源id
|
source_id bigint, -- 来源id
|
||||||
source_detail text, -- 来源详情
|
source_detail text, -- 来源详情
|
||||||
order_id bigint, -- 订单id
|
order_id bigint, -- 订单id
|
||||||
order_detail text, -- 订单详情
|
order_detail text, -- 订单详情
|
||||||
type int default 1, -- 类型 1-收入 2-支出
|
type int default 1, -- 类型 1-收入 2-支出
|
||||||
statistical_date timestamp(6), -- 统计时间
|
statistical_date timestamp(6), -- 统计时间
|
||||||
channel varchar(64), -- 渠道
|
channel varchar(64), -- 渠道
|
||||||
channel_detail text, -- 渠道详情
|
channel_detail text, -- 渠道详情
|
||||||
remark text, -- 备注
|
remark text, -- 备注
|
||||||
daily_statistics_date timestamp(6), -- 每日统计日期
|
daily_statistics_date timestamp(6), -- 每日统计日期
|
||||||
statistics_cycle varchar(32), -- 统计周期
|
statistics_cycle varchar(32), -- 统计周期
|
||||||
create_user int8,
|
create_user int8,
|
||||||
create_dept int8,
|
create_dept int8,
|
||||||
create_time timestamp(6),
|
create_time timestamp(6),
|
||||||
update_user int8,
|
update_user int8,
|
||||||
update_time timestamp(6),
|
update_time timestamp(6),
|
||||||
status integer default 1,
|
status integer default 1,
|
||||||
is_deleted integer default 0
|
is_deleted integer default 0
|
||||||
);
|
);
|
||||||
|
|
||||||
create index uca_log_date_index
|
create index uca_log_date_index
|
||||||
@@ -810,32 +810,32 @@ alter table user_commission_advertising_log
|
|||||||
create table user_commission_service_provider_log
|
create table user_commission_service_provider_log
|
||||||
(
|
(
|
||||||
id bigint not null primary key,
|
id bigint not null primary key,
|
||||||
account_id bigint, -- 账户id
|
account_id bigint, -- 账户id
|
||||||
account_name varchar(128), -- 账户名称
|
account_name varchar(128), -- 账户名称
|
||||||
account_number varchar(64), -- 账户编号
|
account_number varchar(64), -- 账户编号
|
||||||
account_code varchar(64), -- 账户代码
|
account_code varchar(64), -- 账户代码
|
||||||
user_id bigint,
|
user_id bigint,
|
||||||
user_phone bigint,
|
user_phone bigint,
|
||||||
user_name varchar(128),
|
user_name varchar(128),
|
||||||
amount decimal(14,4) default 0, -- 变动金额
|
amount decimal(14, 4) default 0, -- 变动金额
|
||||||
source_id bigint, -- 来源id
|
source_id bigint, -- 来源id
|
||||||
source_detail text, -- 来源详情
|
source_detail text, -- 来源详情
|
||||||
order_id bigint, -- 订单id
|
order_id bigint, -- 订单id
|
||||||
order_detail text, -- 订单详情
|
order_detail text, -- 订单详情
|
||||||
type int default 1, -- 类型 1-收入 2-支出
|
type int default 1, -- 类型 1-收入 2-支出
|
||||||
statistical_date timestamp(6), -- 统计时间
|
statistical_date timestamp(6), -- 统计时间
|
||||||
channel varchar(64), -- 渠道
|
channel varchar(64), -- 渠道
|
||||||
channel_detail text, -- 渠道详情
|
channel_detail text, -- 渠道详情
|
||||||
remark text, -- 备注
|
remark text, -- 备注
|
||||||
service_type varchar(64), -- 服务类型
|
service_type varchar(64), -- 服务类型
|
||||||
service_provider_id bigint, -- 服务商ID
|
service_provider_id bigint, -- 服务商ID
|
||||||
create_user int8,
|
create_user int8,
|
||||||
create_dept int8,
|
create_dept int8,
|
||||||
create_time timestamp(6),
|
create_time timestamp(6),
|
||||||
update_user int8,
|
update_user int8,
|
||||||
update_time timestamp(6),
|
update_time timestamp(6),
|
||||||
status integer default 1,
|
status integer default 1,
|
||||||
is_deleted integer default 0
|
is_deleted integer default 0
|
||||||
);
|
);
|
||||||
|
|
||||||
create index ucsp_log_date_index
|
create index ucsp_log_date_index
|
||||||
@@ -873,33 +873,33 @@ alter table user_commission_service_provider_log
|
|||||||
-- 15%极差代理佣金流水表
|
-- 15%极差代理佣金流水表
|
||||||
create table user_commission_agency_log
|
create table user_commission_agency_log
|
||||||
(
|
(
|
||||||
id bigint not null primary key,
|
id bigint not null primary key,
|
||||||
account_id bigint, -- 账户id
|
account_id bigint, -- 账户id
|
||||||
account_name varchar(128), -- 账户名称
|
account_name varchar(128), -- 账户名称
|
||||||
account_number varchar(64), -- 账户编号
|
account_number varchar(64), -- 账户编号
|
||||||
account_code varchar(64), -- 账户代码
|
account_code varchar(64), -- 账户代码
|
||||||
user_id bigint,
|
user_id bigint,
|
||||||
user_phone bigint,
|
user_phone bigint,
|
||||||
user_name varchar(128),
|
user_name varchar(128),
|
||||||
amount decimal(14,4) default 0, -- 变动金额
|
amount decimal(14, 4) default 0, -- 变动金额
|
||||||
source_id bigint, -- 来源id
|
source_id bigint, -- 来源id
|
||||||
source_detail text, -- 来源详情
|
source_detail text, -- 来源详情
|
||||||
order_id bigint, -- 订单id
|
order_id bigint, -- 订单id
|
||||||
order_detail text, -- 订单详情
|
order_detail text, -- 订单详情
|
||||||
type int default 1, -- 类型 1-收入 2-支出
|
type int default 1, -- 类型 1-收入 2-支出
|
||||||
statistical_date timestamp(6), -- 统计时间
|
statistical_date timestamp(6), -- 统计时间
|
||||||
channel varchar(64), -- 渠道
|
channel varchar(64), -- 渠道
|
||||||
channel_detail text, -- 渠道详情
|
channel_detail text, -- 渠道详情
|
||||||
remark text, -- 备注
|
remark text, -- 备注
|
||||||
agency_level varchar(32), -- 代理级别
|
agency_level varchar(32), -- 代理级别
|
||||||
agency_parent_id bigint, -- 上级代理ID
|
agency_parent_id bigint, -- 上级代理ID
|
||||||
create_user int8,
|
create_user int8,
|
||||||
create_dept int8,
|
create_dept int8,
|
||||||
create_time timestamp(6),
|
create_time timestamp(6),
|
||||||
update_user int8,
|
update_user int8,
|
||||||
update_time timestamp(6),
|
update_time timestamp(6),
|
||||||
status integer default 1,
|
status integer default 1,
|
||||||
is_deleted integer default 0
|
is_deleted integer default 0
|
||||||
);
|
);
|
||||||
|
|
||||||
create index ucal_log_date_index
|
create index ucal_log_date_index
|
||||||
@@ -940,33 +940,33 @@ alter table user_commission_agency_log
|
|||||||
-- 5%联创佣金流水表
|
-- 5%联创佣金流水表
|
||||||
create table user_commission_co_creator_log
|
create table user_commission_co_creator_log
|
||||||
(
|
(
|
||||||
id bigint not null primary key,
|
id bigint not null primary key,
|
||||||
account_id bigint, -- 账户id
|
account_id bigint, -- 账户id
|
||||||
account_name varchar(128), -- 账户名称
|
account_name varchar(128), -- 账户名称
|
||||||
account_number varchar(64), -- 账户编号
|
account_number varchar(64), -- 账户编号
|
||||||
account_code varchar(64), -- 账户代码
|
account_code varchar(64), -- 账户代码
|
||||||
user_id bigint,
|
user_id bigint,
|
||||||
user_phone bigint,
|
user_phone bigint,
|
||||||
user_name varchar(128),
|
user_name varchar(128),
|
||||||
amount decimal(14,4) default 0, -- 变动金额
|
amount decimal(14, 4) default 0, -- 变动金额
|
||||||
source_id bigint, -- 来源id
|
source_id bigint, -- 来源id
|
||||||
source_detail text, -- 来源详情
|
source_detail text, -- 来源详情
|
||||||
order_id bigint, -- 订单id
|
order_id bigint, -- 订单id
|
||||||
order_detail text, -- 订单详情
|
order_detail text, -- 订单详情
|
||||||
type int default 1, -- 类型 1-收入 2-支出
|
type int default 1, -- 类型 1-收入 2-支出
|
||||||
statistical_date timestamp(6), -- 统计时间
|
statistical_date timestamp(6), -- 统计时间
|
||||||
channel varchar(64), -- 渠道
|
channel varchar(64), -- 渠道
|
||||||
channel_detail text, -- 渠道详情
|
channel_detail text, -- 渠道详情
|
||||||
remark text, -- 备注
|
remark text, -- 备注
|
||||||
co_creator_type varchar(64), -- 联创类型
|
co_creator_type varchar(64), -- 联创类型
|
||||||
co_creator_rank varchar(32), -- 联创等级
|
co_creator_rank varchar(32), -- 联创等级
|
||||||
create_user int8,
|
create_user int8,
|
||||||
create_dept int8,
|
create_dept int8,
|
||||||
create_time timestamp(6),
|
create_time timestamp(6),
|
||||||
update_user int8,
|
update_user int8,
|
||||||
update_time timestamp(6),
|
update_time timestamp(6),
|
||||||
status integer default 1,
|
status integer default 1,
|
||||||
is_deleted integer default 0
|
is_deleted integer default 0
|
||||||
);
|
);
|
||||||
|
|
||||||
create index uccc_log_date_index
|
create index uccc_log_date_index
|
||||||
|
|||||||
@@ -1,20 +1,19 @@
|
|||||||
|
|
||||||
create table user_performance
|
create table user_performance
|
||||||
(
|
(
|
||||||
id bigint not null primary key,
|
id bigint not null primary key,
|
||||||
user_id bigint,
|
user_id bigint,
|
||||||
user_phone bigint,
|
user_phone bigint,
|
||||||
user_name varchar(128),
|
user_name varchar(128),
|
||||||
performance decimal(16,4) default 0,
|
performance decimal(16, 4) default 0,
|
||||||
own_performance decimal(16,4) default 0,
|
own_performance decimal(16, 4) default 0,
|
||||||
version int default 1,
|
version int default 1,
|
||||||
create_user int8,
|
create_user int8,
|
||||||
create_dept int8,
|
create_dept int8,
|
||||||
create_time timestamp(6),
|
create_time timestamp(6),
|
||||||
update_user int8,
|
update_user int8,
|
||||||
update_time timestamp(6),
|
update_time timestamp(6),
|
||||||
status integer default 1,
|
status integer default 1,
|
||||||
is_deleted integer default 0
|
is_deleted integer default 0
|
||||||
);
|
);
|
||||||
create index up_index
|
create index up_index
|
||||||
on user_performance (is_deleted, user_id);
|
on user_performance (is_deleted, user_id);
|
||||||
@@ -39,26 +38,26 @@ alter table user_performance
|
|||||||
|
|
||||||
create table user_performance_log
|
create table user_performance_log
|
||||||
(
|
(
|
||||||
id bigint not null primary key,
|
id bigint not null primary key,
|
||||||
user_id bigint,
|
user_id bigint,
|
||||||
user_phone bigint,
|
user_phone bigint,
|
||||||
user_name varchar(128),
|
user_name varchar(128),
|
||||||
amount decimal(14,4) default 0,
|
amount decimal(14, 4) default 0,
|
||||||
source_id bigint,
|
source_id bigint,
|
||||||
source_detail text,
|
source_detail text,
|
||||||
order_id bigint,
|
order_id bigint,
|
||||||
type int default 1,
|
type int default 1,
|
||||||
statistical_date timestamp(6),
|
statistical_date timestamp(6),
|
||||||
channel varchar(64),
|
channel varchar(64),
|
||||||
channel_detail text,
|
channel_detail text,
|
||||||
remark text,
|
remark text,
|
||||||
create_user int8,
|
create_user int8,
|
||||||
create_dept int8,
|
create_dept int8,
|
||||||
create_time timestamp(6),
|
create_time timestamp(6),
|
||||||
update_user int8,
|
update_user int8,
|
||||||
update_time timestamp(6),
|
update_time timestamp(6),
|
||||||
status integer default 1,
|
status integer default 1,
|
||||||
is_deleted integer default 0
|
is_deleted integer default 0
|
||||||
);
|
);
|
||||||
|
|
||||||
create index user_performance_log_index
|
create index user_performance_log_index
|
||||||
@@ -77,7 +76,6 @@ comment on column user_performance_log.type is '类型 1增加 2减少';
|
|||||||
comment on column user_performance_log.statistical_date is '统计日期';
|
comment on column user_performance_log.statistical_date is '统计日期';
|
||||||
comment on column user_performance_log.channel is '渠道';
|
comment on column user_performance_log.channel is '渠道';
|
||||||
comment on column user_performance_log.channel_detail is '渠道详情';
|
comment on column user_performance_log.channel_detail is '渠道详情';
|
||||||
|
|
||||||
comment on column user_performance_log.remark is '备注';
|
comment on column user_performance_log.remark is '备注';
|
||||||
comment on column user_performance_log.create_user is '创建人';
|
comment on column user_performance_log.create_user is '创建人';
|
||||||
comment on column user_performance_log.create_dept is '创建部门';
|
comment on column user_performance_log.create_dept is '创建部门';
|
||||||
@@ -93,20 +91,20 @@ alter table user_performance_log
|
|||||||
|
|
||||||
create table user_performance_benefit
|
create table user_performance_benefit
|
||||||
(
|
(
|
||||||
id bigint not null primary key,
|
id bigint not null primary key,
|
||||||
user_id bigint,
|
user_id bigint,
|
||||||
user_phone bigint,
|
user_phone bigint,
|
||||||
user_name varchar(128),
|
user_name varchar(128),
|
||||||
performance decimal(16,4) default 0,
|
performance decimal(16, 4) default 0,
|
||||||
own_performance decimal(16,4) default 0,
|
own_performance decimal(16, 4) default 0,
|
||||||
version int default 1,
|
version int default 1,
|
||||||
create_user int8,
|
create_user int8,
|
||||||
create_dept int8,
|
create_dept int8,
|
||||||
create_time timestamp(6),
|
create_time timestamp(6),
|
||||||
update_user int8,
|
update_user int8,
|
||||||
update_time timestamp(6),
|
update_time timestamp(6),
|
||||||
status integer default 1,
|
status integer default 1,
|
||||||
is_deleted integer default 0
|
is_deleted integer default 0
|
||||||
);
|
);
|
||||||
create index upb_index
|
create index upb_index
|
||||||
on user_performance_benefit (is_deleted, user_id);
|
on user_performance_benefit (is_deleted, user_id);
|
||||||
@@ -131,26 +129,26 @@ alter table user_performance_benefit
|
|||||||
|
|
||||||
create table user_performance_benefit_log
|
create table user_performance_benefit_log
|
||||||
(
|
(
|
||||||
id bigint not null primary key,
|
id bigint not null primary key,
|
||||||
user_id bigint,
|
user_id bigint,
|
||||||
user_phone bigint,
|
user_phone bigint,
|
||||||
user_name varchar(128),
|
user_name varchar(128),
|
||||||
amount decimal(14,4) default 0,
|
amount decimal(14, 4) default 0,
|
||||||
source_id bigint,
|
source_id bigint,
|
||||||
source_detail text,
|
source_detail text,
|
||||||
order_id bigint,
|
order_id bigint,
|
||||||
type int default 1,
|
type int default 1,
|
||||||
statistical_date timestamp(6),
|
statistical_date timestamp(6),
|
||||||
channel varchar(64),
|
channel varchar(64),
|
||||||
channel_detail text,
|
channel_detail text,
|
||||||
remark text,
|
remark text,
|
||||||
create_user int8,
|
create_user int8,
|
||||||
create_dept int8,
|
create_dept int8,
|
||||||
create_time timestamp(6),
|
create_time timestamp(6),
|
||||||
update_user int8,
|
update_user int8,
|
||||||
update_time timestamp(6),
|
update_time timestamp(6),
|
||||||
status integer default 1,
|
status integer default 1,
|
||||||
is_deleted integer default 0
|
is_deleted integer default 0
|
||||||
);
|
);
|
||||||
|
|
||||||
create index upbl_index
|
create index upbl_index
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
create table user_benefit
|
create table user_benefit
|
||||||
(
|
(
|
||||||
id bigint not null primary key,
|
id bigint not null primary key,
|
||||||
user_id bigint,
|
user_id bigint,
|
||||||
amount decimal(14,4) default 0,
|
amount decimal(14, 4) default 0,
|
||||||
version int default 1,
|
version int default 1,
|
||||||
create_user int8,
|
create_user int8,
|
||||||
create_dept int8,
|
create_dept int8,
|
||||||
create_time timestamp(6),
|
create_time timestamp(6),
|
||||||
update_user int8,
|
update_user int8,
|
||||||
update_time timestamp(6),
|
update_time timestamp(6),
|
||||||
status integer default 1,
|
status integer default 1,
|
||||||
is_deleted integer default 0
|
is_deleted integer default 0
|
||||||
);
|
);
|
||||||
|
|
||||||
create index user_benefit_index
|
create index user_benefit_index
|
||||||
@@ -34,27 +34,27 @@ alter table user_benefit
|
|||||||
|
|
||||||
create table user_benefit_log
|
create table user_benefit_log
|
||||||
(
|
(
|
||||||
id bigint not null primary key,
|
id bigint not null primary key,
|
||||||
user_id bigint,
|
user_id bigint,
|
||||||
user_phone bigint,
|
user_phone bigint,
|
||||||
user_name varchar(128),
|
user_name varchar(128),
|
||||||
amount decimal(14,4) default 0,
|
amount decimal(14, 4) default 0,
|
||||||
source_id bigint,
|
source_id bigint,
|
||||||
user_pack_id bigint,
|
user_pack_id bigint,
|
||||||
source_detail text,
|
source_detail text,
|
||||||
order_id bigint,
|
order_id bigint,
|
||||||
type int default 1,
|
type int default 1,
|
||||||
statistical_date timestamp(6),
|
statistical_date timestamp(6),
|
||||||
channel varchar(64),
|
channel varchar(64),
|
||||||
channel_detail text,
|
channel_detail text,
|
||||||
remark text,
|
remark text,
|
||||||
create_user int8,
|
create_user int8,
|
||||||
create_dept int8,
|
create_dept int8,
|
||||||
create_time timestamp(6),
|
create_time timestamp(6),
|
||||||
update_user int8,
|
update_user int8,
|
||||||
update_time timestamp(6),
|
update_time timestamp(6),
|
||||||
status integer default 1,
|
status integer default 1,
|
||||||
is_deleted integer default 0
|
is_deleted integer default 0
|
||||||
|
|
||||||
);
|
);
|
||||||
create index ub_log_date_index
|
create index ub_log_date_index
|
||||||
@@ -89,17 +89,17 @@ alter table user_benefit_log
|
|||||||
|
|
||||||
create table user_commission
|
create table user_commission
|
||||||
(
|
(
|
||||||
id bigint not null primary key,
|
id bigint not null primary key,
|
||||||
user_id bigint,
|
user_id bigint,
|
||||||
amount decimal(14,4) default 0,
|
amount decimal(14, 4) default 0,
|
||||||
version int default 1,
|
version int default 1,
|
||||||
create_user int8,
|
create_user int8,
|
||||||
create_dept int8,
|
create_dept int8,
|
||||||
create_time timestamp(6),
|
create_time timestamp(6),
|
||||||
update_user int8,
|
update_user int8,
|
||||||
update_time timestamp(6),
|
update_time timestamp(6),
|
||||||
status integer default 1,
|
status integer default 1,
|
||||||
is_deleted integer default 0
|
is_deleted integer default 0
|
||||||
);
|
);
|
||||||
|
|
||||||
create index user_commission_index
|
create index user_commission_index
|
||||||
@@ -124,26 +124,26 @@ alter table user_commission
|
|||||||
|
|
||||||
create table user_commission_log
|
create table user_commission_log
|
||||||
(
|
(
|
||||||
id bigint not null primary key,
|
id bigint not null primary key,
|
||||||
user_id bigint,
|
user_id bigint,
|
||||||
user_phone bigint,
|
user_phone bigint,
|
||||||
user_name varchar(128),
|
user_name varchar(128),
|
||||||
amount decimal(14,4) default 0,
|
amount decimal(14, 4) default 0,
|
||||||
source_id bigint,
|
source_id bigint,
|
||||||
source_detail text,
|
source_detail text,
|
||||||
order_id bigint,
|
order_id bigint,
|
||||||
type int default 1,
|
type int default 1,
|
||||||
statistical_date timestamp(6),
|
statistical_date timestamp(6),
|
||||||
channel varchar(64),
|
channel varchar(64),
|
||||||
channel_detail text,
|
channel_detail text,
|
||||||
remark text,
|
remark text,
|
||||||
create_user int8,
|
create_user int8,
|
||||||
create_dept int8,
|
create_dept int8,
|
||||||
create_time timestamp(6),
|
create_time timestamp(6),
|
||||||
update_user int8,
|
update_user int8,
|
||||||
update_time timestamp(6),
|
update_time timestamp(6),
|
||||||
status integer default 1,
|
status integer default 1,
|
||||||
is_deleted integer default 0
|
is_deleted integer default 0
|
||||||
);
|
);
|
||||||
|
|
||||||
create index user_commission_log_index
|
create index user_commission_log_index
|
||||||
@@ -177,16 +177,16 @@ alter table user_commission_log
|
|||||||
|
|
||||||
create table user_cash
|
create table user_cash
|
||||||
(
|
(
|
||||||
id bigint not null primary key,
|
id bigint not null primary key,
|
||||||
user_id bigint,
|
user_id bigint,
|
||||||
amount decimal(14,4) default 0,
|
amount decimal(14, 4) default 0,
|
||||||
version int default 1,
|
version int default 1,
|
||||||
create_user int8,
|
create_user int8,
|
||||||
create_dept int8,
|
create_dept int8,
|
||||||
create_time timestamp(6),
|
create_time timestamp(6),
|
||||||
update_user int8,
|
update_user int8,
|
||||||
update_time timestamp(6),
|
update_time timestamp(6),
|
||||||
is_deleted integer default 0
|
is_deleted integer default 0
|
||||||
);
|
);
|
||||||
|
|
||||||
create index user_cash_index
|
create index user_cash_index
|
||||||
@@ -210,26 +210,26 @@ alter table user_cash
|
|||||||
|
|
||||||
create table user_cash_log
|
create table user_cash_log
|
||||||
(
|
(
|
||||||
id bigint not null primary key,
|
id bigint not null primary key,
|
||||||
user_id bigint,
|
user_id bigint,
|
||||||
user_phone bigint,
|
user_phone bigint,
|
||||||
user_name varchar(128),
|
user_name varchar(128),
|
||||||
amount decimal(14,4) default 0,
|
amount decimal(14, 4) default 0,
|
||||||
source_id bigint,
|
source_id bigint,
|
||||||
source_detail text,
|
source_detail text,
|
||||||
order_id bigint,
|
order_id bigint,
|
||||||
type int default 1,
|
type int default 1,
|
||||||
statistical_date timestamp(6),
|
statistical_date timestamp(6),
|
||||||
channel varchar(64),
|
channel varchar(64),
|
||||||
channel_detail text,
|
channel_detail text,
|
||||||
remark text,
|
remark text,
|
||||||
create_user int8,
|
create_user int8,
|
||||||
create_dept int8,
|
create_dept int8,
|
||||||
create_time timestamp(6),
|
create_time timestamp(6),
|
||||||
update_user int8,
|
update_user int8,
|
||||||
update_time timestamp(6),
|
update_time timestamp(6),
|
||||||
status integer default 1,
|
status integer default 1,
|
||||||
is_deleted integer default 0
|
is_deleted integer default 0
|
||||||
);
|
);
|
||||||
|
|
||||||
create index user_cash_log_index
|
create index user_cash_log_index
|
||||||
@@ -263,16 +263,16 @@ alter table user_cash_log
|
|||||||
|
|
||||||
create table user_mall_integral
|
create table user_mall_integral
|
||||||
(
|
(
|
||||||
id bigint not null primary key,
|
id bigint not null primary key,
|
||||||
user_id bigint,
|
user_id bigint,
|
||||||
amount decimal(14,4) default 0,
|
amount decimal(14, 4) default 0,
|
||||||
version int default 1,
|
version int default 1,
|
||||||
create_user int8,
|
create_user int8,
|
||||||
create_dept int8,
|
create_dept int8,
|
||||||
create_time timestamp(6),
|
create_time timestamp(6),
|
||||||
update_user int8,
|
update_user int8,
|
||||||
update_time timestamp(6),
|
update_time timestamp(6),
|
||||||
is_deleted integer default 0
|
is_deleted integer default 0
|
||||||
);
|
);
|
||||||
|
|
||||||
create index user_mall_integral_index
|
create index user_mall_integral_index
|
||||||
@@ -296,26 +296,26 @@ alter table user_mall_integral
|
|||||||
|
|
||||||
create table user_mall_integral_log
|
create table user_mall_integral_log
|
||||||
(
|
(
|
||||||
id bigint not null primary key,
|
id bigint not null primary key,
|
||||||
user_id bigint,
|
user_id bigint,
|
||||||
user_phone bigint,
|
user_phone bigint,
|
||||||
user_name varchar(128),
|
user_name varchar(128),
|
||||||
amount decimal(14,4) default 0,
|
amount decimal(14, 4) default 0,
|
||||||
source_id bigint,
|
source_id bigint,
|
||||||
source_detail text,
|
source_detail text,
|
||||||
order_id bigint,
|
order_id bigint,
|
||||||
type int default 1,
|
type int default 1,
|
||||||
statistical_date timestamp(6),
|
statistical_date timestamp(6),
|
||||||
channel varchar(64),
|
channel varchar(64),
|
||||||
channel_detail text,
|
channel_detail text,
|
||||||
remark text,
|
remark text,
|
||||||
create_user int8,
|
create_user int8,
|
||||||
create_dept int8,
|
create_dept int8,
|
||||||
create_time timestamp(6),
|
create_time timestamp(6),
|
||||||
update_user int8,
|
update_user int8,
|
||||||
update_time timestamp(6),
|
update_time timestamp(6),
|
||||||
status integer default 1,
|
status integer default 1,
|
||||||
is_deleted integer default 0
|
is_deleted integer default 0
|
||||||
);
|
);
|
||||||
|
|
||||||
create index user_mall_integral_log_index
|
create index user_mall_integral_log_index
|
||||||
@@ -348,23 +348,22 @@ alter table user_mall_integral_log
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
create table user_gains_day
|
create table user_gains_day
|
||||||
(
|
(
|
||||||
id bigint not null primary key,
|
id bigint not null primary key,
|
||||||
statistical_date timestamp(6),
|
statistical_date timestamp(6),
|
||||||
user_id bigint,
|
user_id bigint,
|
||||||
amount decimal(14,4) default 0,
|
amount decimal(14, 4) default 0,
|
||||||
gains_details text,
|
gains_details text,
|
||||||
is_credited integer default 0,
|
is_credited integer default 0,
|
||||||
version int default 1,
|
version int default 1,
|
||||||
create_user int8,
|
create_user int8,
|
||||||
create_dept int8,
|
create_dept int8,
|
||||||
create_time timestamp(6),
|
create_time timestamp(6),
|
||||||
update_user int8,
|
update_user int8,
|
||||||
update_time timestamp(6),
|
update_time timestamp(6),
|
||||||
status integer default 1,
|
status integer default 1,
|
||||||
is_deleted integer default 0
|
is_deleted integer default 0
|
||||||
);
|
);
|
||||||
|
|
||||||
create index ugd_date_index
|
create index ugd_date_index
|
||||||
@@ -391,25 +390,25 @@ alter table user_gains_day
|
|||||||
|
|
||||||
create table user_gains_day_log
|
create table user_gains_day_log
|
||||||
(
|
(
|
||||||
id bigint not null primary key,
|
id bigint not null primary key,
|
||||||
user_id bigint,
|
user_id bigint,
|
||||||
user_phone bigint,
|
user_phone bigint,
|
||||||
user_name varchar(128),
|
user_name varchar(128),
|
||||||
amount decimal(14,4) default 0,
|
amount decimal(14, 4) default 0,
|
||||||
source_id bigint,
|
source_id bigint,
|
||||||
source_detail text,
|
source_detail text,
|
||||||
gains_details text,
|
gains_details text,
|
||||||
order_id bigint,
|
order_id bigint,
|
||||||
statistical_date timestamp(6),
|
statistical_date timestamp(6),
|
||||||
is_summary integer default 0,
|
is_summary integer default 0,
|
||||||
remark text,
|
remark text,
|
||||||
create_user int8,
|
create_user int8,
|
||||||
create_dept int8,
|
create_dept int8,
|
||||||
create_time timestamp(6),
|
create_time timestamp(6),
|
||||||
update_user int8,
|
update_user int8,
|
||||||
update_time timestamp(6),
|
update_time timestamp(6),
|
||||||
status integer default 1,
|
status integer default 1,
|
||||||
is_deleted integer default 0
|
is_deleted integer default 0
|
||||||
|
|
||||||
);
|
);
|
||||||
create index ugd_log_date_index
|
create index ugd_log_date_index
|
||||||
|
|||||||
@@ -1,19 +1,20 @@
|
|||||||
CREATE TABLE vendor_daily_activity (
|
CREATE TABLE vendor_daily_activity
|
||||||
id BIGINT NOT NULL PRIMARY KEY,
|
(
|
||||||
settle_date DATE NOT NULL,
|
id BIGINT NOT NULL PRIMARY KEY,
|
||||||
region_id BIGINT NOT NULL,
|
settle_date DATE NOT NULL,
|
||||||
region_level INTEGER DEFAULT 0 NOT NULL,
|
region_id BIGINT NOT NULL,
|
||||||
total_amount INTEGER DEFAULT 0 NOT NULL,
|
region_level INTEGER DEFAULT 0 NOT NULL,
|
||||||
activity_amount INTEGER DEFAULT 0 NOT NULL,
|
total_amount INTEGER DEFAULT 0 NOT NULL,
|
||||||
activity_value_amount DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
|
activity_amount INTEGER DEFAULT 0 NOT NULL,
|
||||||
increase_activity_value_amount DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
|
activity_value_amount DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
|
||||||
create_user int8 NULL,
|
increase_activity_value_amount DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
|
||||||
create_dept int8 NULL,
|
create_user int8 NULL,
|
||||||
create_time TIMESTAMP(6) NULL,
|
create_dept int8 NULL,
|
||||||
update_user int8 NULL,
|
create_time TIMESTAMP(6) NULL,
|
||||||
update_time TIMESTAMP(6) NULL,
|
update_user int8 NULL,
|
||||||
status INTEGER NULL,
|
update_time TIMESTAMP(6) NULL,
|
||||||
is_deleted INTEGER DEFAULT 0 NULL
|
status INTEGER NULL,
|
||||||
|
is_deleted INTEGER DEFAULT 0 NULL
|
||||||
);
|
);
|
||||||
|
|
||||||
COMMENT ON TABLE vendor_daily_activity IS '服务商用户收益';
|
COMMENT ON TABLE vendor_daily_activity IS '服务商用户收益';
|
||||||
@@ -34,23 +35,24 @@ COMMENT ON COLUMN vendor_daily_activity.status IS '状态';
|
|||||||
COMMENT ON COLUMN vendor_daily_activity.is_deleted IS '是否已删除';
|
COMMENT ON COLUMN vendor_daily_activity.is_deleted IS '是否已删除';
|
||||||
|
|
||||||
|
|
||||||
CREATE TABLE vendor_daily_profit (
|
CREATE TABLE vendor_daily_profit
|
||||||
id BIGINT NOT NULL PRIMARY KEY,
|
(
|
||||||
settle_date DATE NOT NULL,
|
id BIGINT NOT NULL PRIMARY KEY,
|
||||||
region_id BIGINT NOT NULL,
|
settle_date DATE NOT NULL,
|
||||||
region_level INTEGER DEFAULT 0 NOT NULL,
|
region_id BIGINT NOT NULL,
|
||||||
profit_type INTEGER DEFAULT 0 NOT NULL,
|
region_level INTEGER DEFAULT 0 NOT NULL,
|
||||||
order_type INTEGER NOT NULL,
|
profit_type INTEGER DEFAULT 0 NOT NULL,
|
||||||
total_amount DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
|
order_type INTEGER NOT NULL,
|
||||||
profit_amount DECIMAL(10, 1) DEFAULT 0.0 NOT NULL,
|
total_amount DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
|
||||||
quantity INTEGER DEFAULT 0 NOT NULL,
|
profit_amount DECIMAL(10, 1) DEFAULT 0.0 NOT NULL,
|
||||||
create_user int8 NULL,
|
quantity INTEGER DEFAULT 0 NOT NULL,
|
||||||
create_dept int8 NULL,
|
create_user int8 NULL,
|
||||||
create_time TIMESTAMP(6) NULL,
|
create_dept int8 NULL,
|
||||||
update_user int8 NULL,
|
create_time TIMESTAMP(6) NULL,
|
||||||
update_time TIMESTAMP(6) NULL,
|
update_user int8 NULL,
|
||||||
status INTEGER NULL,
|
update_time TIMESTAMP(6) NULL,
|
||||||
is_deleted INTEGER DEFAULT 0 NULL
|
status INTEGER NULL,
|
||||||
|
is_deleted INTEGER DEFAULT 0 NULL
|
||||||
);
|
);
|
||||||
|
|
||||||
COMMENT ON TABLE vendor_daily_profit IS '服务商营收收益';
|
COMMENT ON TABLE vendor_daily_profit IS '服务商营收收益';
|
||||||
@@ -73,30 +75,30 @@ COMMENT ON COLUMN vendor_daily_profit.is_deleted IS '是否已删除';
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
CREATE TABLE vendor_info
|
||||||
CREATE TABLE vendor_info (
|
(
|
||||||
id BIGINT NOT NULL PRIMARY KEY,
|
id BIGINT NOT NULL PRIMARY KEY,
|
||||||
region_id BIGINT NOT NULL,
|
region_id BIGINT NOT NULL,
|
||||||
user_id BIGINT NOT NULL,
|
user_id BIGINT NOT NULL,
|
||||||
company_name VARCHAR(200) DEFAULT '' NOT NULL,
|
company_name VARCHAR(200) DEFAULT '' NOT NULL,
|
||||||
legal_person_name VARCHAR(200) DEFAULT '' NOT NULL,
|
legal_person_name VARCHAR(200) DEFAULT '' NOT NULL,
|
||||||
id_card VARCHAR(50) DEFAULT '' NOT NULL,
|
id_card VARCHAR(50) DEFAULT '' NOT NULL,
|
||||||
contact_no VARCHAR(50) DEFAULT '' NOT NULL,
|
contact_no VARCHAR(50) DEFAULT '' NOT NULL,
|
||||||
id_card_front VARCHAR(200) DEFAULT '' NOT NULL,
|
id_card_front VARCHAR(200) DEFAULT '' NOT NULL,
|
||||||
id_card_back VARCHAR(200) DEFAULT '' NOT NULL,
|
id_card_back VARCHAR(200) DEFAULT '' NOT NULL,
|
||||||
id_card_handheld VARCHAR(200) DEFAULT '' NOT NULL,
|
id_card_handheld VARCHAR(200) DEFAULT '' NOT NULL,
|
||||||
business_license VARCHAR(200) DEFAULT '' NOT NULL,
|
business_license VARCHAR(200) DEFAULT '' NOT NULL,
|
||||||
audit_status INTEGER DEFAULT 1 NOT NULL,
|
audit_status INTEGER DEFAULT 1 NOT NULL,
|
||||||
auditor BIGINT NULL,
|
auditor BIGINT NULL,
|
||||||
reject_reason VARCHAR(200) DEFAULT '' NOT NULL,
|
reject_reason VARCHAR(200) DEFAULT '' NOT NULL,
|
||||||
create_user int8 NULL,
|
create_user int8 NULL,
|
||||||
create_dept int8 NULL,
|
create_dept int8 NULL,
|
||||||
create_time TIMESTAMP(6) NULL,
|
create_time TIMESTAMP(6) NULL,
|
||||||
update_user int8 NULL,
|
update_user int8 NULL,
|
||||||
update_time TIMESTAMP(6) NULL,
|
update_time TIMESTAMP(6) NULL,
|
||||||
status INTEGER NULL,
|
status INTEGER NULL,
|
||||||
is_deleted INTEGER DEFAULT 0 NULL,
|
is_deleted INTEGER DEFAULT 0 NULL,
|
||||||
apply_time TIMESTAMP(6) NULL
|
apply_time TIMESTAMP(6) NULL
|
||||||
);
|
);
|
||||||
|
|
||||||
COMMENT ON TABLE vendor_info IS '服务商';
|
COMMENT ON TABLE vendor_info IS '服务商';
|
||||||
@@ -125,26 +127,27 @@ COMMENT ON COLUMN vendor_info.apply_time IS '申请时间';
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
CREATE TABLE vendor_payout_apply (
|
CREATE TABLE vendor_payout_apply
|
||||||
id BIGINT NOT NULL PRIMARY KEY,
|
(
|
||||||
user_id BIGINT DEFAULT 0 NOT NULL,
|
id BIGINT NOT NULL PRIMARY KEY,
|
||||||
apply_amount DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
|
user_id BIGINT DEFAULT 0 NOT NULL,
|
||||||
company_fully_name VARCHAR(255) NULL,
|
apply_amount DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
|
||||||
bank_account VARCHAR(255) NULL,
|
company_fully_name VARCHAR(255) NULL,
|
||||||
branch_info VARCHAR(255) NULL,
|
bank_account VARCHAR(255) NULL,
|
||||||
transfer_description VARCHAR(255) NULL,
|
branch_info VARCHAR(255) NULL,
|
||||||
invoice_url TEXT NULL,
|
transfer_description VARCHAR(255) NULL,
|
||||||
invoice_number VARCHAR(255) NULL,
|
invoice_url TEXT NULL,
|
||||||
transfer_voucher TEXT NULL,
|
invoice_number VARCHAR(255) NULL,
|
||||||
apply_status INTEGER DEFAULT 1 NOT NULL,
|
transfer_voucher TEXT NULL,
|
||||||
remark VARCHAR(255) NULL,
|
apply_status INTEGER DEFAULT 1 NOT NULL,
|
||||||
create_user int8 NULL,
|
remark VARCHAR(255) NULL,
|
||||||
create_dept int8 NULL,
|
create_user int8 NULL,
|
||||||
create_time TIMESTAMP(6) NULL,
|
create_dept int8 NULL,
|
||||||
update_user int8 NULL,
|
create_time TIMESTAMP(6) NULL,
|
||||||
update_time TIMESTAMP(6) NULL,
|
update_user int8 NULL,
|
||||||
status INTEGER NULL,
|
update_time TIMESTAMP(6) NULL,
|
||||||
is_deleted INTEGER NULL
|
status INTEGER NULL,
|
||||||
|
is_deleted INTEGER NULL
|
||||||
);
|
);
|
||||||
|
|
||||||
COMMENT ON TABLE vendor_payout_apply IS '服务商提现申请';
|
COMMENT ON TABLE vendor_payout_apply IS '服务商提现申请';
|
||||||
@@ -170,26 +173,27 @@ COMMENT ON COLUMN vendor_payout_apply.is_deleted IS '是否已删除';
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
CREATE TABLE vendor_profit_detail (
|
CREATE TABLE vendor_profit_detail
|
||||||
id BIGINT NOT NULL PRIMARY KEY,
|
(
|
||||||
order_id BIGINT DEFAULT 0 NOT NULL,
|
id BIGINT NOT NULL PRIMARY KEY,
|
||||||
user_id BIGINT DEFAULT 0 NOT NULL,
|
order_id BIGINT DEFAULT 0 NOT NULL,
|
||||||
district_id BIGINT DEFAULT 0 NOT NULL,
|
user_id BIGINT DEFAULT 0 NOT NULL,
|
||||||
city_id BIGINT DEFAULT 0 NOT NULL,
|
district_id BIGINT DEFAULT 0 NOT NULL,
|
||||||
province_id BIGINT DEFAULT 0 NOT NULL,
|
city_id BIGINT DEFAULT 0 NOT NULL,
|
||||||
order_type INTEGER DEFAULT 0 NOT NULL,
|
province_id BIGINT DEFAULT 0 NOT NULL,
|
||||||
payment_type INTEGER DEFAULT 0 NOT NULL,
|
order_type INTEGER DEFAULT 0 NOT NULL,
|
||||||
actual_amount DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
|
payment_type INTEGER DEFAULT 0 NOT NULL,
|
||||||
cost_amount DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
|
actual_amount DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
|
||||||
profit_amount DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
|
cost_amount DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
|
||||||
order_settle_date TIMESTAMP NULL,
|
profit_amount DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
|
||||||
create_user int8 NULL,
|
order_settle_date TIMESTAMP NULL,
|
||||||
create_dept int8 NULL,
|
create_user int8 NULL,
|
||||||
create_time TIMESTAMP(6) NULL,
|
create_dept int8 NULL,
|
||||||
update_user int8 NULL,
|
create_time TIMESTAMP(6) NULL,
|
||||||
update_time TIMESTAMP(6) NULL,
|
update_user int8 NULL,
|
||||||
status INTEGER NULL,
|
update_time TIMESTAMP(6) NULL,
|
||||||
is_deleted INTEGER NULL
|
status INTEGER NULL,
|
||||||
|
is_deleted INTEGER NULL
|
||||||
);
|
);
|
||||||
|
|
||||||
COMMENT ON TABLE vendor_profit_detail IS '服务商分润详情';
|
COMMENT ON TABLE vendor_profit_detail IS '服务商分润详情';
|
||||||
@@ -215,20 +219,20 @@ COMMENT ON COLUMN vendor_profit_detail.is_deleted IS '是否已删除';
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
CREATE TABLE vendor_regions
|
||||||
CREATE TABLE vendor_regions (
|
(
|
||||||
id BIGINT NOT NULL PRIMARY KEY,
|
id BIGINT NOT NULL PRIMARY KEY,
|
||||||
name VARCHAR(50) NULL,
|
name VARCHAR(50) NULL,
|
||||||
level INTEGER NULL,
|
level INTEGER NULL,
|
||||||
pid INTEGER DEFAULT 0 NULL,
|
pid INTEGER DEFAULT 0 NULL,
|
||||||
lon DECIMAL(10, 6) NULL,
|
lon DECIMAL(10, 6) NULL,
|
||||||
lat DECIMAL(10, 6) NULL,
|
lat DECIMAL(10, 6) NULL,
|
||||||
vendor_id BIGINT NULL,
|
vendor_id BIGINT NULL,
|
||||||
token_amount DECIMAL(10, 2) DEFAULT 0.00 NULL,
|
token_amount DECIMAL(10, 2) DEFAULT 0.00 NULL,
|
||||||
points_amount DECIMAL(10, 2) DEFAULT 0.00 NULL,
|
points_amount DECIMAL(10, 2) DEFAULT 0.00 NULL,
|
||||||
apply_amount DECIMAL(10, 2) DEFAULT 0.00 NULL,
|
apply_amount DECIMAL(10, 2) DEFAULT 0.00 NULL,
|
||||||
apply_status INTEGER DEFAULT 1 NULL,
|
apply_status INTEGER DEFAULT 1 NULL,
|
||||||
region_code VARCHAR(10) NULL
|
region_code VARCHAR(10) NULL
|
||||||
);
|
);
|
||||||
|
|
||||||
COMMENT ON TABLE vendor_regions IS '服务商地区';
|
COMMENT ON TABLE vendor_regions IS '服务商地区';
|
||||||
@@ -247,23 +251,23 @@ COMMENT ON COLUMN vendor_regions.region_code IS '区划编号';
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
CREATE TABLE vendor_virtual_data_activity
|
||||||
CREATE TABLE vendor_virtual_data_activity (
|
(
|
||||||
id BIGINT NOT NULL PRIMARY KEY,
|
id BIGINT NOT NULL PRIMARY KEY,
|
||||||
region_id INTEGER NOT NULL,
|
region_id INTEGER NOT NULL,
|
||||||
user_amount INTEGER DEFAULT 0 NOT NULL,
|
user_amount INTEGER DEFAULT 0 NOT NULL,
|
||||||
active_user_amount INTEGER DEFAULT 0 NOT NULL,
|
active_user_amount INTEGER DEFAULT 0 NOT NULL,
|
||||||
order_amount DECIMAL(10, 2) DEFAULT 0.00 NULL,
|
order_amount DECIMAL(10, 2) DEFAULT 0.00 NULL,
|
||||||
order_quantity INTEGER DEFAULT 0 NOT NULL,
|
order_quantity INTEGER DEFAULT 0 NOT NULL,
|
||||||
activity_value DECIMAL(10, 2) DEFAULT 0.00 NULL,
|
activity_value DECIMAL(10, 2) DEFAULT 0.00 NULL,
|
||||||
increase_activity_value DECIMAL(10, 2) DEFAULT 0.00 NULL,
|
increase_activity_value DECIMAL(10, 2) DEFAULT 0.00 NULL,
|
||||||
create_user int8 NULL,
|
create_user int8 NULL,
|
||||||
create_dept int8 NULL,
|
create_dept int8 NULL,
|
||||||
create_time TIMESTAMP(6) NULL,
|
create_time TIMESTAMP(6) NULL,
|
||||||
update_user int8 NULL,
|
update_user int8 NULL,
|
||||||
update_time TIMESTAMP(6) NULL,
|
update_time TIMESTAMP(6) NULL,
|
||||||
status INTEGER NULL,
|
status INTEGER NULL,
|
||||||
is_deleted INTEGER DEFAULT 0 NULL
|
is_deleted INTEGER DEFAULT 0 NULL
|
||||||
);
|
);
|
||||||
|
|
||||||
COMMENT ON TABLE vendor_virtual_data_activity IS '服务商活跃度虚拟增益';
|
COMMENT ON TABLE vendor_virtual_data_activity IS '服务商活跃度虚拟增益';
|
||||||
@@ -285,21 +289,21 @@ COMMENT ON COLUMN vendor_virtual_data_activity.is_deleted IS '是否已删除';
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
CREATE TABLE vendor_virtual_data_profit
|
||||||
CREATE TABLE vendor_virtual_data_profit (
|
(
|
||||||
id BIGINT NOT NULL PRIMARY KEY,
|
id BIGINT NOT NULL PRIMARY KEY,
|
||||||
region_id INTEGER NOT NULL,
|
region_id INTEGER NOT NULL,
|
||||||
settle_date DATE NOT NULL,
|
settle_date DATE NOT NULL,
|
||||||
online_amount DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
|
online_amount DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
|
||||||
offline_amount DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
|
offline_amount DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
|
||||||
activity_amount DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
|
activity_amount DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
|
||||||
create_user int8 NULL,
|
create_user int8 NULL,
|
||||||
create_dept int8 NULL,
|
create_dept int8 NULL,
|
||||||
create_time TIMESTAMP(6) NULL,
|
create_time TIMESTAMP(6) NULL,
|
||||||
update_user int8 NULL,
|
update_user int8 NULL,
|
||||||
update_time TIMESTAMP(6) NULL,
|
update_time TIMESTAMP(6) NULL,
|
||||||
status INTEGER NULL,
|
status INTEGER NULL,
|
||||||
is_deleted INTEGER DEFAULT 0 NULL
|
is_deleted INTEGER DEFAULT 0 NULL
|
||||||
);
|
);
|
||||||
|
|
||||||
COMMENT ON TABLE vendor_virtual_data_profit IS '服务商营收虚拟增益';
|
COMMENT ON TABLE vendor_virtual_data_profit IS '服务商营收虚拟增益';
|
||||||
|
|||||||
@@ -1,18 +1,19 @@
|
|||||||
CREATE TABLE prize_spu (
|
CREATE TABLE prize_spu
|
||||||
id BIGINT NOT NULL PRIMARY KEY,
|
(
|
||||||
spu_name VARCHAR(255) DEFAULT '' NOT NULL,
|
id BIGINT NOT NULL PRIMARY KEY,
|
||||||
main_img VARCHAR(255) DEFAULT '' NOT NULL,
|
spu_name VARCHAR(255) DEFAULT '' NOT NULL,
|
||||||
detail_img text NULL,
|
main_img VARCHAR(255) DEFAULT '' NOT NULL,
|
||||||
cost_price DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
|
detail_img text NULL,
|
||||||
original_price DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
|
cost_price DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
|
||||||
spu_qty INTEGER DEFAULT 0 NOT NULL,
|
original_price DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
|
||||||
status INTEGER DEFAULT 0 NULL,
|
spu_qty INTEGER DEFAULT 0 NOT NULL,
|
||||||
create_user int8 NULL,
|
status INTEGER DEFAULT 0 NULL,
|
||||||
create_dept int8 NULL,
|
create_user int8 NULL,
|
||||||
create_time TIMESTAMP(6) NULL,
|
create_dept int8 NULL,
|
||||||
update_user int8 NULL,
|
create_time TIMESTAMP(6) NULL,
|
||||||
update_time TIMESTAMP(6) NULL,
|
update_user int8 NULL,
|
||||||
is_deleted INTEGER DEFAULT 0 NULL
|
update_time TIMESTAMP(6) NULL,
|
||||||
|
is_deleted INTEGER DEFAULT 0 NULL
|
||||||
);
|
);
|
||||||
|
|
||||||
COMMENT ON TABLE prize_spu IS '奖池商品';
|
COMMENT ON TABLE prize_spu IS '奖池商品';
|
||||||
@@ -33,26 +34,27 @@ COMMENT ON COLUMN prize_spu.is_deleted IS '是否已删除';
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
CREATE TABLE prize_spu_order (
|
CREATE TABLE prize_spu_order
|
||||||
id bigint NOT NULL PRIMARY KEY,
|
(
|
||||||
user_id bigint DEFAULT 0 NOT NULL,
|
id BIGINT NOT NULL PRIMARY KEY,
|
||||||
|
user_id BIGINT DEFAULT 0 NOT NULL,
|
||||||
user_name VARCHAR(128) NULL,
|
user_name VARCHAR(128) NULL,
|
||||||
user_phone bigint NULL,
|
user_phone bigint NULL,
|
||||||
spu_id bigint NULL,
|
spu_id bigint NULL,
|
||||||
spu_name VARCHAR(255) NULL,
|
spu_name VARCHAR(255) NULL,
|
||||||
main_img VARCHAR(255) NULL,
|
main_img VARCHAR(255) NULL,
|
||||||
detail_img text NULL,
|
detail_img text NULL,
|
||||||
quantity INTEGER DEFAULT 0 NOT NULL,
|
quantity INTEGER DEFAULT 0 NOT NULL,
|
||||||
order_status INTEGER DEFAULT 0 NOT NULL,
|
order_status INTEGER DEFAULT 0 NOT NULL,
|
||||||
version BIGINT DEFAULT 0 NULL,
|
version BIGINT DEFAULT 0 NULL,
|
||||||
create_user int8 NULL,
|
create_user int8 NULL,
|
||||||
create_dept int8 NULL,
|
create_dept int8 NULL,
|
||||||
create_time TIMESTAMP(6) NULL,
|
create_time TIMESTAMP(6) NULL,
|
||||||
update_user int8 NULL,
|
update_user int8 NULL,
|
||||||
update_time TIMESTAMP(6) NULL,
|
update_time TIMESTAMP(6) NULL,
|
||||||
status INTEGER DEFAULT -1 NULL,
|
status INTEGER DEFAULT -1 NULL,
|
||||||
is_deleted INTEGER DEFAULT 0 NULL
|
is_deleted INTEGER DEFAULT 0 NULL
|
||||||
);
|
);
|
||||||
|
|
||||||
create index prize_spu_order_index on prize_spu_order (user_id);
|
create index prize_spu_order_index on prize_spu_order (user_id);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user