sql脚本-sql格式化

This commit is contained in:
2026-01-26 23:23:12 +08:00
parent dd1328f20f
commit f13ce7886d
11 changed files with 1116 additions and 1054 deletions

View File

@@ -1,20 +1,21 @@
create table aliyun_certify (
id bigint not null primary key,
user_id bigint not null,
user_phone bigint,
name varchar(128) null,
id_card varchar(128) null,
certify_id varchar(64) null,
image text null,
message varchar(255) null,
create table aliyun_certify
(
id bigint not null primary key,
user_id bigint not null,
user_phone bigint,
name varchar(128) null,
id_card varchar(128) null,
certify_id varchar(64) null,
image text null,
message varchar(255) null,
is_success integer default 0 not null,
is_deleted integer default 0 not null,
create_time timestamp not null,
create_user int8 null,
update_time timestamp null,
update_user int8 null,
create_dept int8 null,
status integer null
create_time timestamp not null,
create_user int8 null,
update_time timestamp null,
update_user int8 null,
create_dept int8 null,
status integer null
);
comment on table aliyun_certify is '阿里云实名记录表';

View File

@@ -1,28 +1,30 @@
CREATE TABLE mall_spu (
id BIGINT NOT NULL PRIMARY KEY,
spu_sn VARCHAR(255) DEFAULT '' NOT NULL,
spu_name VARCHAR(255) DEFAULT '' NOT NULL,
main_img VARCHAR(255) DEFAULT '' NOT NULL,
detail_img text NULL,
top_img text NULL,
cate_id VARCHAR(255) DEFAULT '' NOT NULL,
cate_ids VARCHAR(255) DEFAULT '' NOT NULL,
cost_price DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
original_price DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
retail_price DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
profit DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
sales INTEGER DEFAULT 0 NOT NULL,
spu_qty INTEGER DEFAULT 0 NOT NULL,
tags text DEFAULT '' NOT NULL,
status INTEGER DEFAULT 0 NULL,
create_user int8 NULL,
create_dept int8 NULL,
create_time TIMESTAMP NULL,
update_user int8 NULL,
update_time TIMESTAMP NULL,
is_deleted INTEGER DEFAULT 0 NULL
CREATE TABLE mall_spu
(
id BIGINT NOT NULL PRIMARY KEY,
spu_sn VARCHAR(255) DEFAULT '' NOT NULL,
spu_name VARCHAR(255) DEFAULT '' NOT NULL,
main_img VARCHAR(255) DEFAULT '' NOT NULL,
detail_img text NULL,
top_img text NULL,
cate_id VARCHAR(255) DEFAULT '' NOT NULL,
cate_ids VARCHAR(255) DEFAULT '' NOT NULL,
cost_price DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
original_price DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
retail_price DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
profit DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
sales INTEGER DEFAULT 0 NOT NULL,
spu_qty INTEGER DEFAULT 0 NOT NULL,
tags text DEFAULT '' NOT NULL,
status INTEGER DEFAULT 0 NULL,
create_user int8 NULL,
create_dept int8 NULL,
create_time TIMESTAMP NULL,
update_user int8 NULL,
update_time TIMESTAMP NULL,
is_deleted INTEGER DEFAULT 0 NULL
);
COMMENT ON TABLE mall_spu IS '商城spu';
COMMENT ON COLUMN mall_spu.id 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 (
id BIGINT NOT NULL PRIMARY KEY,
cname VARCHAR(100) DEFAULT '' NOT NULL,
pid BIGINT DEFAULT 0 NOT NULL,
level INTEGER DEFAULT 0 NOT NULL
CREATE TABLE ys_category
(
id BIGINT NOT NULL PRIMARY KEY,
cname VARCHAR(100) DEFAULT '' NOT NULL,
pid BIGINT DEFAULT 0 NOT NULL,
level INTEGER DEFAULT 0 NOT NULL
);
COMMENT ON TABLE ys_category IS '商品分类';
COMMENT ON COLUMN ys_category.id 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';
CREATE TABLE mall_cart (
CREATE TABLE mall_cart
(
id BIGINT NOT NULL PRIMARY KEY,
user_id BIGINT DEFAULT 0 NOT NULL,
title VARCHAR(200) DEFAULT '' NOT NULL,
spu_id INTEGER DEFAULT 0 NOT NULL,
quantity INTEGER DEFAULT 0 NOT NULL,
create_user int8 NULL,
create_dept int8 NULL,
create_time TIMESTAMP NULL,
update_user int8 NULL,
update_time TIMESTAMP NULL,
status INTEGER NULL,
is_deleted INTEGER DEFAULT 0 NULL
create_user int8 NULL,
create_dept int8 NULL,
create_time TIMESTAMP NULL,
update_user int8 NULL,
update_time TIMESTAMP NULL,
status INTEGER NULL,
is_deleted INTEGER DEFAULT 0 NULL
);
COMMENT ON TABLE mall_cart IS '商城购物车';
COMMENT ON COLUMN mall_cart.id IS '主键';
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.status IS '状态';
COMMENT ON COLUMN mall_cart.is_deleted IS '是否已删除';
CREATE INDEX idx_user_id ON mall_cart (user_id);
CREATE TABLE user_address (
id BIGINT NOT NULL PRIMARY KEY,
user_id BIGINT NULL,
regions_info_id BIGINT NULL,
province VARCHAR(200) NULL,
city VARCHAR(200) NULL,
district VARCHAR(200) NULL,
street VARCHAR(200) NULL,
detail VARCHAR(200) NULL,
consignee VARCHAR(200) NULL,
phone VARCHAR(200) NULL,
is_default INTEGER NULL,
create_user int8 NULL,
create_dept int8 NULL,
create_time TIMESTAMP NULL,
update_user int8 NULL,
update_time TIMESTAMP NULL,
status INTEGER NULL,
is_deleted INTEGER DEFAULT 0 NULL
CREATE TABLE user_address
(
id BIGINT NOT NULL PRIMARY KEY,
user_id BIGINT NULL,
regions_info_id BIGINT NULL,
province VARCHAR(200) NULL,
city VARCHAR(200) NULL,
district VARCHAR(200) NULL,
street VARCHAR(200) NULL,
detail VARCHAR(200) NULL,
consignee VARCHAR(200) NULL,
phone VARCHAR(200) NULL,
is_default INTEGER NULL,
create_user int8 NULL,
create_dept int8 NULL,
create_time TIMESTAMP NULL,
update_user int8 NULL,
update_time TIMESTAMP NULL,
status INTEGER NULL,
is_deleted INTEGER DEFAULT 0 NULL
);
COMMENT ON TABLE user_address IS '用户地址表';
COMMENT ON COLUMN user_address.id IS '主键';
COMMENT ON COLUMN user_address.user_id IS '用户id';

View File

@@ -1,27 +1,27 @@
CREATE TABLE user_order (
CREATE TABLE user_order
(
id BIGINT DEFAULT 0 NOT NULL PRIMARY KEY,
user_id BIGINT DEFAULT 0 NOT NULL,
order_type INTEGER DEFAULT 0 NOT NULL,
order_id BIGINT DEFAULT 0 NOT NULL,
title VARCHAR(256) DEFAULT '' NOT NULL,
images VARCHAR(512) NULL,
quantity INTEGER NULL,
images VARCHAR(512) NULL,
quantity INTEGER NULL,
description VARCHAR(200) DEFAULT '' NOT NULL,
order_status INTEGER DEFAULT 0 NOT NULL,
total_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_time TIMESTAMP NULL,
payment_time TIMESTAMP NULL,
payment_track VARCHAR(255) DEFAULT '' NOT NULL,
payment_status INTEGER DEFAULT 1 NOT NULL,
create_user int8 NULL,
create_dept int8 NULL,
create_time TIMESTAMP(6) NULL,
update_user int8 NULL,
update_time TIMESTAMP(6) NULL,
status INTEGER NULL,
is_deleted INTEGER DEFAULT 0 NULL
create_user int8 NULL,
create_dept int8 NULL,
create_time TIMESTAMP(6) NULL,
update_user int8 NULL,
update_time TIMESTAMP(6) NULL,
status INTEGER NULL,
is_deleted INTEGER DEFAULT 0 NULL
);
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_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.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 '是否已删除';
CREATE INDEX user_order_index ON user_order (user_id, order_type);
CREATE TABLE mall_summary_order (
id BIGINT NOT NULL PRIMARY KEY,
CREATE TABLE mall_summary_order
(
id BIGINT NOT NULL PRIMARY KEY,
user_id BIGINT DEFAULT 0 NOT NULL,
products_info text NULL,
order_info text NULL,
confirm_info text NULL,
products_info text NULL,
order_info text NULL,
confirm_info text NULL,
vendor_regions_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,
cost_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,
extra_type INTEGER DEFAULT 0 NOT NULL,
payment_status INTEGER DEFAULT 0 NOT NULL,
order_status INTEGER DEFAULT 0 NOT NULL,
payment_completed_time TIMESTAMP NULL,
order_status INTEGER DEFAULT 0 NOT NULL,
payment_completed_time TIMESTAMP NULL,
payment_track VARCHAR(200) DEFAULT '' NOT NULL,
expire_time TIMESTAMP NULL,
give_token DECIMAL(10, 2) NULL,
actual_give_token DECIMAL(10, 2) NULL,
is_royalty INTEGER DEFAULT 0 NULL,
expire_time TIMESTAMP NULL,
give_token DECIMAL(10, 2) NULL,
actual_give_token DECIMAL(10, 2) NULL,
is_royalty INTEGER DEFAULT 0 NULL,
remarks VARCHAR(200) DEFAULT '' NOT NULL,
version BIGINT DEFAULT 0 NULL,
create_user int8 NULL,
create_dept int8 NULL,
create_time TIMESTAMP NULL,
update_user int8 NULL,
update_time TIMESTAMP NULL,
status INTEGER DEFAULT 0 NULL,
is_deleted INTEGER DEFAULT 0 NULL
version BIGINT DEFAULT 0 NULL,
create_user int8 NULL,
create_dept int8 NULL,
create_time TIMESTAMP NULL,
update_user int8 NULL,
update_time TIMESTAMP NULL,
status 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.extra_type 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.payment_completed_time 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 (
id BIGINT NOT NULL PRIMARY KEY,
user_id BIGINT DEFAULT 0 NOT NULL,
summary_order_id BIGINT DEFAULT 0 NOT NULL,
spu_id BIGINT DEFAULT 0 NOT NULL,
quantity INTEGER DEFAULT 0 NOT NULL,
sku_snapshot text NULL,
actual_cost_amount DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
order_amount DECIMAL(10, 2) NULL,
cost_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,
remarks VARCHAR(200) DEFAULT '' NOT NULL,
order_status INTEGER DEFAULT 0 NOT NULL,
version integer DEFAULT 0 NULL,
create_user int8 NULL,
create_dept int8 NULL,
create_time TIMESTAMP NULL,
update_user int8 NULL,
update_time TIMESTAMP NULL,
status INTEGER DEFAULT -1 NULL,
is_deleted INTEGER DEFAULT 0 NULL
CREATE TABLE mall_detail_order
(
id BIGINT NOT NULL PRIMARY KEY,
user_id BIGINT DEFAULT 0 NOT NULL,
summary_order_id BIGINT DEFAULT 0 NOT NULL,
spu_id BIGINT DEFAULT 0 NOT NULL,
quantity INTEGER DEFAULT 0 NOT NULL,
sku_snapshot text NULL,
actual_cost_amount DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
order_amount DECIMAL(10, 2) NULL,
cost_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,
remarks VARCHAR(200) DEFAULT '' NOT NULL,
order_status INTEGER DEFAULT 0 NOT NULL,
version integer DEFAULT 0 NULL,
create_user int8 NULL,
create_dept int8 NULL,
create_time TIMESTAMP NULL,
update_user int8 NULL,
update_time TIMESTAMP NULL,
status INTEGER DEFAULT -1 NULL,
is_deleted INTEGER DEFAULT 0 NULL
);
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.spu_id IS '商品id';
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.actual_cost_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.actual_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.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.status 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_uid_index ON mall_detail_order (user_id);
CREATE TABLE mall_summary_order_after (
id BIGINT NOT NULL PRIMARY KEY,
user_id BIGINT DEFAULT -1 NOT NULL,
summary_order_id BIGINT DEFAULT -1 NOT NULL,
goods_id BIGINT DEFAULT -1 NOT NULL,
sku_id BIGINT NOT NULL,
goods_name VARCHAR(256) NOT NULL,
third_plat_order_no VARCHAR(32) NOT NULL,
third_plat_after_no VARCHAR(32) NOT NULL,
quantity INTEGER DEFAULT -1 NULL,
apply_type INTEGER NULL,
apply_reason VARCHAR(100) DEFAULT '-1' NULL,
apply_pic_urls TEXT NULL,
refund_amount DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
refund_status INTEGER DEFAULT 0 NULL,
refund_reason VARCHAR(255) NULL,
receiver VARCHAR(125) NULL,
receiver_phone VARCHAR(255) NULL,
receiver_addr VARCHAR(255) NULL,
receiver_delivery_no VARCHAR(255) NULL,
remarks VARCHAR(200) DEFAULT '' NULL,
version integer DEFAULT 0 NULL,
create_user int8 NULL,
create_dept int8 NULL,
create_time TIMESTAMP NULL,
update_user int8 NULL,
update_time TIMESTAMP NULL,
status INTEGER DEFAULT 0 NULL,
is_deleted INTEGER DEFAULT 0 NULL,
after_info JSON NULL
CREATE TABLE mall_summary_order_after
(
id BIGINT NOT NULL PRIMARY KEY,
user_id BIGINT DEFAULT -1 NOT NULL,
summary_order_id BIGINT DEFAULT -1 NOT NULL,
goods_id BIGINT DEFAULT -1 NOT NULL,
sku_id BIGINT NOT NULL,
goods_name VARCHAR(256) NOT NULL,
third_plat_order_no VARCHAR(32) NOT NULL,
third_plat_after_no VARCHAR(32) NOT NULL,
quantity INTEGER DEFAULT -1 NULL,
apply_type INTEGER NULL,
apply_reason VARCHAR(100) DEFAULT '-1' NULL,
apply_pic_urls TEXT NULL,
refund_amount DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
refund_status INTEGER DEFAULT 0 NULL,
refund_reason VARCHAR(255) NULL,
receiver VARCHAR(125) NULL,
receiver_phone VARCHAR(255) NULL,
receiver_addr VARCHAR(255) NULL,
receiver_delivery_no VARCHAR(255) NULL,
remarks VARCHAR(200) DEFAULT '' NULL,
version integer DEFAULT 0 NULL,
create_user int8 NULL,
create_dept int8 NULL,
create_time TIMESTAMP NULL,
update_user int8 NULL,
update_time TIMESTAMP NULL,
status INTEGER DEFAULT 0 NULL,
is_deleted INTEGER DEFAULT 0 NULL,
after_info JSON NULL
);
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.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.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.after_info IS '售后详情';

View File

@@ -1,39 +1,40 @@
CREATE TABLE IF NOT EXISTS registration_order (
id BIGINT NOT NULL PRIMARY KEY,
spu_id BIGINT NULL,
sku_id BIGINT NULL,
title VARCHAR(100) NOT NULL,
transaction_type INTEGER NOT NULL,
thumbnail VARCHAR(500) NOT NULL,
thumbnail_height INTEGER NULL,
detail TEXT NULL,
price DECIMAL(10, 2) NOT NULL,
points DECIMAL(10, 2) NOT NULL,
quantity INTEGER NOT NULL,
remaining INTEGER NOT NULL,
user_id BIGINT NOT NULL,
user_nickname VARCHAR(100) NULL,
in_transaction INTEGER DEFAULT 0 NOT NULL,
is_full_package INTEGER DEFAULT 0 NOT NULL,
delivery_type INTEGER DEFAULT 1 NULL,
region_code VARCHAR(10) NULL,
region_name VARCHAR(100) NULL,
receiver_address VARCHAR(100) NULL,
contact VARCHAR(100) NULL,
contact_number VARCHAR(100) NULL,
is_virtual INTEGER DEFAULT 0 NOT NULL,
is_closed INTEGER DEFAULT 0 NOT NULL,
version integer DEFAULT 0 NOT NULL,
create_user int8 NULL,
create_dept int8 NULL,
create_time TIMESTAMP(6) NULL,
update_user int8 NULL,
update_time TIMESTAMP (6) NULL,
status INTEGER NULL,
is_deleted INTEGER DEFAULT 0 NULL,
is_vendor INTEGER DEFAULT 0 NULL,
is_priority INTEGER DEFAULT 0 NULL
);
CREATE TABLE registration_order
(
id BIGINT NOT NULL PRIMARY KEY,
spu_id BIGINT NULL,
sku_id BIGINT NULL,
title VARCHAR(100) NOT NULL,
transaction_type INTEGER NOT NULL,
thumbnail VARCHAR(500) NOT NULL,
thumbnail_height INTEGER NULL,
detail TEXT NULL,
price DECIMAL(10, 2) NOT NULL,
points DECIMAL(10, 2) NOT NULL,
quantity INTEGER NOT NULL,
remaining INTEGER NOT NULL,
user_id BIGINT NOT NULL,
user_nickname VARCHAR(100) NULL,
in_transaction INTEGER DEFAULT 0 NOT NULL,
is_full_package INTEGER DEFAULT 0 NOT NULL,
delivery_type INTEGER DEFAULT 1 NULL,
region_code VARCHAR(10) NULL,
region_name VARCHAR(100) NULL,
receiver_address VARCHAR(100) NULL,
contact VARCHAR(100) NULL,
contact_number VARCHAR(100) NULL,
is_virtual INTEGER DEFAULT 0 NOT NULL,
is_closed INTEGER DEFAULT 0 NOT NULL,
version integer DEFAULT 0 NOT NULL,
create_user int8 NULL,
create_dept int8 NULL,
create_time TIMESTAMP(6) NULL,
update_user int8 NULL,
update_time TIMESTAMP(6) NULL,
status INTEGER NULL,
is_deleted INTEGER DEFAULT 0 NULL,
is_vendor INTEGER DEFAULT 0 NULL,
is_priority INTEGER DEFAULT 0 NULL
);
COMMENT ON TABLE registration_order IS '挂单表';
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 (
id BIGINT NOT NULL PRIMARY KEY,
registration_id BIGINT NOT NULL,
sku_id BIGINT NULL,
title VARCHAR(100) NOT NULL,
transaction_type INTEGER NOT NULL,
thumbnail VARCHAR(500) NOT NULL,
price DECIMAL(10, 2) NOT NULL,
points DECIMAL(10, 2) NOT NULL,
quantity INTEGER NOT NULL,
total_amount DECIMAL(10, 2) NOT NULL,
total_points DECIMAL(10, 2) NOT NULL,
user_id BIGINT NOT NULL,
user_nickname VARCHAR(500) NULL,
payment_voucher VARCHAR(500) NULL,
delivery_voucher VARCHAR(500) NULL,
delivery_type INTEGER DEFAULT 1 NOT NULL,
region_code VARCHAR(10) NULL,
region_name VARCHAR(100) NULL,
receiver_address VARCHAR(100) NULL,
contact VARCHAR(100) NULL,
contact_number VARCHAR(100) NULL,
counterparty_order_id BIGINT DEFAULT 0 NOT NULL,
is_virtual INTEGER DEFAULT 0 NOT NULL,
supplier_order_sn VARCHAR(100) NULL,
expire_time TIMESTAMP(6) NULL,
create_user int8 NULL,
create_dept int8 NULL,
create_time TIMESTAMP(6) NULL,
update_user int8 NULL,
update_time TIMESTAMP(6) NULL,
status INTEGER NULL,
is_deleted INTEGER DEFAULT 0 NULL
);
CREATE TABLE transaction_order
(
id BIGINT NOT NULL PRIMARY KEY,
registration_id BIGINT NOT NULL,
sku_id BIGINT NULL,
title VARCHAR(100) NOT NULL,
transaction_type INTEGER NOT NULL,
thumbnail VARCHAR(500) NOT NULL,
price DECIMAL(10, 2) NOT NULL,
points DECIMAL(10, 2) NOT NULL,
quantity INTEGER NOT NULL,
total_amount DECIMAL(10, 2) NOT NULL,
total_points DECIMAL(10, 2) NOT NULL,
user_id BIGINT NOT NULL,
user_nickname VARCHAR(500) NULL,
payment_voucher VARCHAR(500) NULL,
delivery_voucher VARCHAR(500) NULL,
delivery_type INTEGER DEFAULT 1 NOT NULL,
region_code VARCHAR(10) NULL,
region_name VARCHAR(100) NULL,
receiver_address VARCHAR(100) NULL,
contact VARCHAR(100) NULL,
contact_number VARCHAR(100) NULL,
counterparty_order_id BIGINT DEFAULT 0 NOT NULL,
is_virtual INTEGER DEFAULT 0 NOT NULL,
supplier_order_sn VARCHAR(100) NULL,
expire_time TIMESTAMP NULL,
create_user int8 NULL,
create_dept int8 NULL,
create_time TIMESTAMP(6) NULL,
update_user int8 NULL,
update_time TIMESTAMP(6) NULL,
status INTEGER NULL,
is_deleted INTEGER DEFAULT 0 NULL
);
COMMENT ON TABLE transaction_order IS '交易单表';
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.is_deleted IS '是否已删除';
CREATE TABLE IF NOT EXISTS user_inventory (
id BIGINT NOT NULL PRIMARY KEY,
user_id BIGINT NOT NULL,
sku_id BIGINT NOT NULL,
title VARCHAR(100) NOT NULL,
thumbnail VARCHAR(500) NOT NULL,
price DECIMAL(10, 2) NOT NULL,
quantity INTEGER NOT NULL,
is_virtual INTEGER DEFAULT 0 NOT NULL,
attribute JSON NULL,
version integer DEFAULT 0 NOT NULL,
create_user int8 NULL,
create_dept int8 NULL,
create_time TIMESTAMP(6) NULL,
update_user int8 NULL,
update_time TIMESTAMP(6) NULL,
status INTEGER NULL,
is_deleted INTEGER DEFAULT 0 NULL
);
CREATE TABLE user_inventory
(
id BIGINT NOT NULL PRIMARY KEY,
user_id BIGINT NOT NULL,
sku_id BIGINT NOT NULL,
title VARCHAR(100) NOT NULL,
thumbnail VARCHAR(500) NOT NULL,
price DECIMAL(10, 2) NOT NULL,
quantity INTEGER NOT NULL,
is_virtual INTEGER DEFAULT 0 NOT NULL,
attribute JSON NULL,
version BIGINT DEFAULT 0 NOT NULL,
create_user int8 NULL,
create_dept int8 NULL,
create_time TIMESTAMP(6) NULL,
update_user int8 NULL,
update_time TIMESTAMP(6) NULL,
status INTEGER NULL,
is_deleted INTEGER DEFAULT 0 NULL
);
COMMENT ON TABLE user_inventory IS '用户库存';
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 '是否已删除';
CREATE TABLE IF NOT EXISTS calendar_non_working (
id BIGINT NOT NULL PRIMARY KEY,
off_date DATE NOT NULL,
remark VARCHAR(200) NULL,
create_user int8 NULL,
create_dept int8 NULL,
create_time TIMESTAMP(6) NULL,
update_user int8 NULL,
update_time TIMESTAMP(6) NULL,
status INTEGER NULL,
is_deleted INTEGER DEFAULT 0 NULL
);
CREATE TABLE calendar_non_working
(
id BIGINT NOT NULL PRIMARY KEY,
off_date DATE NOT NULL,
remark VARCHAR(200) NULL,
create_user int8 NULL,
create_dept int8 NULL,
create_time TIMESTAMP(6) NULL,
update_user int8 NULL,
update_time TIMESTAMP(6) NULL,
status INTEGER NULL,
is_deleted INTEGER DEFAULT 0 NULL
);
COMMENT ON TABLE calendar_non_working 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 (
id BIGINT NOT NULL PRIMARY KEY,
user_id BIGINT NOT NULL,
alipay_account VARCHAR(200) NULL,
wechat_account VARCHAR(200) NULL,
alipay_qr_code VARCHAR(200) NULL,
wechat_qr_code VARCHAR(200) NULL,
bank_account VARCHAR(200) NULL,
branch_info VARCHAR(200) NULL,
create_user int8 NULL,
create_dept int8 NULL,
create_time TIMESTAMP(6) NULL,
update_user int8 NULL,
update_time TIMESTAMP(6) NULL,
status INTEGER NULL,
is_deleted INTEGER DEFAULT 0 NULL
);
CREATE TABLE user_otc_info
(
id BIGINT NOT NULL PRIMARY KEY,
user_id BIGINT NOT NULL,
alipay_account VARCHAR(200) NULL,
wechat_account VARCHAR(200) NULL,
alipay_qr_code VARCHAR(200) NULL,
wechat_qr_code VARCHAR(200) NULL,
bank_account VARCHAR(200) NULL,
branch_info VARCHAR(200) NULL,
create_user int8 NULL,
create_dept int8 NULL,
create_time TIMESTAMP(6) NULL,
update_user int8 NULL,
update_time TIMESTAMP(6) NULL,
status INTEGER NULL,
is_deleted INTEGER DEFAULT 0 NULL
);
COMMENT ON TABLE user_otc_info IS 'OTC收款信息';
COMMENT ON COLUMN user_otc_info.id IS 'ID';

View File

@@ -1,19 +1,20 @@
CREATE TABLE IF NOT EXISTS regions_info (
id SERIAL PRIMARY KEY,
name VARCHAR(50) NULL,
level INTEGER NULL,
pid INTEGER DEFAULT 0 NULL,
lon DECIMAL(10, 6) NULL,
lat DECIMAL(10, 6) NULL,
region_code VARCHAR(128) NULL,
full_name VARCHAR(200) NULL,
vendor_region_id BIGINT NULL,
store_city_id BIGINT NULL,
hotel_city_code VARCHAR(128) NULL,
hotel_city_pinyin VARCHAR(128) NULL,
hotel_city_initials VARCHAR(4) NULL,
sight_city_name VARCHAR(32) NULL
);
CREATE TABLE regions_info
(
id SERIAL PRIMARY KEY,
name VARCHAR(50) NULL,
level INTEGER NULL,
pid INTEGER DEFAULT 0 NULL,
lon DECIMAL(10, 6) NULL,
lat DECIMAL(10, 6) NULL,
region_code VARCHAR(128) NULL,
full_name VARCHAR(200) NULL,
vendor_region_id BIGINT NULL,
store_city_id BIGINT NULL,
hotel_city_code VARCHAR(128) NULL,
hotel_city_pinyin VARCHAR(128) NULL,
hotel_city_initials VARCHAR(4) NULL,
sight_city_name VARCHAR(32) NULL
);
COMMENT ON TABLE regions_info IS '地区详情表';
COMMENT ON COLUMN regions_info.id IS '主键';

View File

@@ -1,19 +1,20 @@
CREATE TABLE IF NOT EXISTS user_daily_sign (
id BIGINT NOT NULL PRIMARY KEY,
user_id BIGINT NULL,
user_phone bigint,
user_name varchar(128),
statistics_date DATE NULL,
sign_count INTEGER NULL,
type INTEGER DEFAULT 1 NULL,
remarks TEXT NULL,
is_deleted INTEGER DEFAULT 0 NULL,
create_time TIMESTAMP(6) NULL,
create_user int8 NULL,
update_time TIMESTAMP(6) NULL,
update_user int8 NULL,
status INTEGER NULL,
create_dept BIGINT NULL
CREATE TABLE user_daily_sign
(
id BIGINT NOT NULL PRIMARY KEY,
user_id BIGINT NULL,
user_phone bigint,
user_name varchar(128),
statistics_date DATE NULL,
sign_count INTEGER NULL,
type INTEGER DEFAULT 1 NULL,
remarks TEXT NULL,
is_deleted INTEGER DEFAULT 0 NULL,
create_time TIMESTAMP(6) NULL,
create_user int8 NULL,
update_time TIMESTAMP(6) NULL,
update_user int8 NULL,
status INTEGER NULL,
create_dept BIGINT NULL
);
COMMENT ON TABLE user_daily_sign IS '用户看广告记录表';
@@ -40,20 +41,21 @@ CREATE INDEX uds_uid_index
CREATE TABLE ads (
id BIGINT NOT NULL PRIMARY KEY,
name VARCHAR(255) NULL,
url VARCHAR(255) NULL,
sort INTEGER DEFAULT 1,
type INTEGER DEFAULT 1,
ads_time INTEGER NULL,
is_deleted INTEGER DEFAULT 0,
create_time TIMESTAMP(6) NULL,
create_user int8 NULL,
update_time TIMESTAMP(6) NULL,
update_user int8 NULL,
create_dept int8 NULL,
status INTEGER NULL
CREATE TABLE ads
(
id BIGINT NOT NULL PRIMARY KEY,
name VARCHAR(255) NULL,
url VARCHAR(255) NULL,
sort INTEGER DEFAULT 1,
type INTEGER DEFAULT 1,
ads_time INTEGER NULL,
is_deleted INTEGER DEFAULT 0,
create_time TIMESTAMP(6) NULL,
create_user int8 NULL,
update_time TIMESTAMP(6) NULL,
update_user int8 NULL,
create_dept int8 NULL,
status INTEGER NULL
);
COMMENT ON TABLE ads IS '广告表';

View File

@@ -1,23 +1,23 @@
create table user_genealogy
(
id bigint not null primary key,
name varchar(128),
phone bigint,
level integer default 1, --当前层数
pid bigint,
root_id bigint, --遍历当前树
group_id bigint, --树内最近团队长的id
genealogy_list bigint[] , -- 往上所有父级
user_child_number int, --用户下线总人数
user_direct_number int, --用户直推总人数
user_direct_list bigint[], --直推列表
create_user int8,
create_dept int8,
create_time timestamp(6),
update_user int8,
update_time timestamp(6),
status integer default 1,
is_deleted integer default 0
id bigint not null primary key,
name varchar(128),
phone bigint,
level integer default 1, --当前层数
pid bigint,
root_id bigint, --遍历当前树
group_id bigint, --树内最近团队长的id
genealogy_list bigint[], -- 往上所有父级
user_child_number int, --用户下线总人数
user_direct_number int, --用户直推总人数
user_direct_list bigint[], --直推列表
create_user int8,
create_dept int8,
create_time timestamp(6),
update_user int8,
update_time timestamp(6),
status integer default 1,
is_deleted integer default 0
);
CREATE INDEX user_genealogy_list_gin_idx
@@ -54,14 +54,14 @@ alter table user_genealogy
create table user_tree
(
id bigint not null primary key,
name varchar(128),
phone bigint,
level integer default 1,
pid bigint,
p_name varchar(128),
p_phone bigint,
p_level integer default 1,
id bigint not null primary key,
name varchar(128),
phone bigint,
level integer default 1,
pid bigint,
p_name varchar(128),
p_phone bigint,
p_level integer default 1,
create_user int8,
create_dept int8,
create_time timestamp(6),
@@ -96,25 +96,25 @@ alter table user_tree
create table user_increase_day
(
id bigint not null primary key,
name varchar(128),
phone bigint,
number integer default 1, -- 新增人数
direct_number integer default 1, -- 新增人数
user_benefit decimal(14,4) default 0, --福利值
order_amount decimal(14,4) default 0, --订单金额(整个团队)
current_level_id int , --用户当前等级
current_level_name varchar(12) , --用户当前等级
p_name varchar(128),
p_phone bigint,
p_level integer default 1,
create_user int8,
create_dept int8,
create_time timestamp(6),
update_user int8,
update_time timestamp(6),
status integer default 1,
is_deleted integer default 0
id bigint not null primary key,
name varchar(128),
phone bigint,
number integer default 1, -- 新增人数
direct_number integer default 1, -- 新增人数
user_benefit decimal(14, 4) default 0, --福利值
order_amount decimal(14, 4) default 0, --订单金额(整个团队)
current_level_id int, --用户当前等级
current_level_name varchar(12), --用户当前等级
p_name varchar(128),
p_phone bigint,
p_level integer default 1,
create_user int8,
create_dept int8,
create_time timestamp(6),
update_user int8,
update_time timestamp(6),
status integer default 1,
is_deleted integer default 0
);
create index user_increase_day_phone_index
on user_increase_day (is_deleted, phone);
@@ -140,26 +140,27 @@ alter table user_increase_day
CREATE TABLE level_info (
id BIGINT NOT NULL PRIMARY KEY,
name VARCHAR(128) NULL,
child_qty INTEGER NULL,
performance DECIMAL(16, 4) NULL,
CREATE TABLE level_info
(
id BIGINT NOT NULL PRIMARY KEY,
name VARCHAR(128) NULL,
child_qty INTEGER NULL,
performance DECIMAL(16, 4) NULL,
performance_benefit DECIMAL(16, 4) NULL,
next_level_id BIGINT , --晋升等级id
is_lowest int DEFAULT 0, --是否最低等级
is_highest int DEFAULT 0, --是否最高等级
bonus_cash_day DECIMAL(16, 4) NULL,
bonus_cash_all DECIMAL(16, 4) NULL,
bonus_benefit DECIMAL(16, 4) NULL,
version integer DEFAULT 1,
create_user int8,
create_dept int8,
create_time timestamp(6),
update_user int8,
update_time timestamp(6),
status integer default 1,
is_deleted integer default 0
next_level_id BIGINT, --晋升等级id
is_lowest int DEFAULT 0, --是否最低等级
is_highest int DEFAULT 0, --是否最高等级
bonus_cash_day DECIMAL(16, 4) NULL,
bonus_cash_all DECIMAL(16, 4) NULL,
bonus_benefit DECIMAL(16, 4) NULL,
version integer DEFAULT 1,
create_user int8,
create_dept int8,
create_time timestamp(6),
update_user int8,
update_time timestamp(6),
status integer default 1,
is_deleted integer default 0
);
COMMENT ON TABLE level_info IS '等级信息表';
@@ -187,20 +188,20 @@ alter table level_info
create table user_level_log
(
id bigint not null primary key,
statistical_date timestamp(6),
user_id bigint,
id bigint not null primary key,
statistical_date timestamp(6),
user_id bigint,
user_phone bigint,
user_name varchar(128),
level_id bigint,
level_name varchar(128),
is_lowest int , --是否最低等级
is_highest int, --是否最高等级
bonus_cash_day DECIMAL(16, 4) NULL,
bonus_cash_all DECIMAL(16, 4) NULL,
bonus_benefit DECIMAL(16, 4) NULL,
bonus_detail text,
remark text,
user_name varchar(128),
level_id bigint,
level_name varchar(128),
is_lowest int, --是否最低等级
is_highest int, --是否最高等级
bonus_cash_day DECIMAL(16, 4) NULL,
bonus_cash_all DECIMAL(16, 4) NULL,
bonus_benefit DECIMAL(16, 4) NULL,
bonus_detail text,
remark text,
create_user int8,
create_dept int8,
create_time timestamp(6),
@@ -241,29 +242,29 @@ alter table user_level_log
CREATE TABLE package_info (
id BIGINT NOT NULL PRIMARY KEY,
name VARCHAR(128) NULL,
buy_qty INTEGER default 0, -- 最大购买数量
day_total decimal(16,4) default 0, -- 产出总天数
amount_total decimal(14,4) default 0, -- 总产出福利积分
give_amount decimal(14,4) default 0, -- 购买赠与福利值
bonus decimal(16,4) default 0, -- 激活比率
user_benefit decimal(14,4) default 0, --兑换包需要的福利积分
user_cash decimal(14,4) default 0, --兑换包需要的现金券
is_need_benefit int DEFAULT 0, --是否需要福利积分
is_need_cash int DEFAULT 0, --是否需要现金券
max_exchange_qty integer default 0, -- 全网最大兑换数量
exchanged_qty integer default 0, -- 已兑换数量
version integer default 1,
create_user int8,
create_dept int8,
create_time timestamp(6),
update_user int8,
update_time timestamp(6),
status integer default 1,
is_deleted integer default 0
CREATE TABLE package_info
(
id BIGINT NOT NULL PRIMARY KEY,
name VARCHAR(128) NULL,
buy_qty INTEGER default 0, -- 最大购买数量
day_total decimal(16, 4) default 0, -- 产出总天数
amount_total decimal(14, 4) default 0, -- 总产出福利积分
give_amount decimal(14, 4) default 0, -- 购买赠与福利值
bonus decimal(16, 4) default 0, -- 激活比率
user_benefit decimal(14, 4) default 0, --兑换包需要的福利积分
user_cash decimal(14, 4) default 0, --兑换包需要的现金券
is_need_benefit int DEFAULT 0, --是否需要福利积分
is_need_cash int DEFAULT 0, --是否需要现金券
max_exchange_qty integer default 0, -- 全网最大兑换数量
exchanged_qty integer default 0, -- 已兑换数量
version integer default 1,
create_user int8,
create_dept int8,
create_time timestamp(6),
update_user int8,
update_time timestamp(6),
status integer default 1,
is_deleted integer default 0
);
@@ -294,35 +295,34 @@ alter table package_info
create table user_package_info
(
id bigint not null primary key,
statistical_date timestamp(6),
user_id bigint,
phone bigint,
user_name varchar(128),
package_id bigint,
package_name varchar(128),
user_benefit decimal(14,4) default 0, --兑换包需要的福利积分
user_cash decimal(14,4) default 0, --兑换包需要的现金券
give_amount decimal(14,4) default 0, -- 购买赠与福利值
day_total decimal(16,4) default 0, -- 产出总天数
amount_total decimal(14,4) default 0, -- 总产出福利积分
amount_day decimal(14,4) default 0, -- 每日产出福利积分 = 总产出 / 总产出
amount_out decimal(16,4) default 0, -- 已产出福利积分
out_day decimal(16,4) default 0, -- 已产出天数
is_complete integer default 0, -- 是否完成 0未完成 1完成
expired_date timestamp(6),
is_expired integer default 0,
remark text,
id bigint not null primary key,
statistical_date timestamp(6),
user_id bigint,
phone bigint,
user_name varchar(128),
package_id bigint,
package_name varchar(128),
user_benefit decimal(14, 4) default 0, --兑换包需要的福利积分
user_cash decimal(14, 4) default 0, --兑换包需要的现金券
give_amount decimal(14, 4) default 0, -- 购买赠与福利值
day_total decimal(16, 4) default 0, -- 产出总天数
amount_total decimal(14, 4) default 0, -- 总产出福利积分
amount_day decimal(14, 4) default 0, -- 每日产出福利积分 = 总产出 / 总产出
amount_out decimal(16, 4) default 0, -- 已产出福利积分
out_day decimal(16, 4) default 0, -- 已产出天数
is_complete integer default 0, -- 是否完成 0未完成 1完成
expired_date timestamp(6),
is_expired integer default 0,
remark text,
create_user int8,
create_dept int8,
create_time timestamp(6),
update_user int8,
update_time timestamp(6),
status integer default 1,
is_deleted integer default 0
status integer default 1,
is_deleted integer default 0
);
create index upi_complete_index
@@ -366,42 +366,42 @@ alter table user_package_info
create table user_package_info_copy
(
id bigint not null primary key,
statistical_date timestamp(6),
user_id bigint,
phone bigint,
user_name varchar(128),
user_package_info bigint, --user_package_info id
package_id bigint,
package_name varchar(128),
user_benefit decimal(14,4) default 0, --兑换包需要的福利积分
user_cash decimal(14,4) default 0, --兑换包需要的现金券
give_amount decimal(14,4) default 0, -- 购买赠与福利值
day_total decimal(16,4) default 0, -- 产出总天数
amount_total decimal(14,4) default 0, -- 总产出福利积分
amount_day decimal(14,4) default 0, -- 每日产出福利积分 = 总产出 / 总产出
amount_out decimal(16,4) default 0, -- 已产出多少福利积分
remaining_amount decimal(16,4) default 0, -- 剩余可产出福利积分 (总计 - 已经经历多少天 * 每天产出 - 加速积分)
accelerated_amount decimal(16,4) default 0, -- 已加速多少福利积分
parent_id bigint, -- 给到谁10%积分,到用户id
parent_amount decimal(16,4) default 0, -- 给到谁10%积分,到积分账户(福利积分)
out_day decimal(16,4) default 0, -- 产出天数 当前包已经产出天数
experience_day decimal(16,4) default 0, -- 当前包已经经历的天数
not_sign_list bigint[], -- 未签到日期详情 (数组)
is_complete integer default 0, -- 是否完成 0未完成 1完成
start_time timestamp(6), -- 当前包生效时间
sign_bitmap bigint default 0, -- 位图将包的签到时间360天二进制转成十进制
expired_date timestamp(6),
is_expired integer default 0,
version integer default 1,
remark text,
create_user int8,
create_dept int8,
create_time timestamp(6),
update_user int8,
update_time timestamp(6),
status integer default 1,
is_deleted integer default 0
id bigint not null primary key,
statistical_date timestamp(6),
user_id bigint,
phone bigint,
user_name varchar(128),
user_package_info bigint, --user_package_info id
package_id bigint,
package_name varchar(128),
user_benefit decimal(14, 4) default 0, --兑换包需要的福利积分
user_cash decimal(14, 4) default 0, --兑换包需要的现金券
give_amount decimal(14, 4) default 0, -- 购买赠与福利值
day_total decimal(16, 4) default 0, -- 产出总天数
amount_total decimal(14, 4) default 0, -- 总产出福利积分
amount_day decimal(14, 4) default 0, -- 每日产出福利积分 = 总产出 / 总产出
amount_out decimal(16, 4) default 0, -- 已产出多少福利积分
remaining_amount decimal(16, 4) default 0, -- 剩余可产出福利积分 (总计 - 已经经历多少天 * 每天产出 - 加速积分)
accelerated_amount decimal(16, 4) default 0, -- 已加速多少福利积分
parent_id bigint, -- 给到谁10%积分,到用户id
parent_amount decimal(16, 4) default 0, -- 给到谁10%积分,到积分账户(福利积分)
out_day decimal(16, 4) default 0, -- 产出天数 当前包已经产出天数
experience_day decimal(16, 4) default 0, -- 当前包已经经历的天数
not_sign_list bigint[], -- 未签到日期详情 (数组)
is_complete integer default 0, -- 是否完成 0未完成 1完成
start_time timestamp(6), -- 当前包生效时间
sign_bitmap bigint default 0, -- 位图将包的签到时间360天二进制转成十进制
expired_date timestamp(6),
is_expired integer default 0,
version integer default 1,
remark text,
create_user int8,
create_dept int8,
create_time timestamp(6),
update_user int8,
update_time timestamp(6),
status integer default 1,
is_deleted integer default 0
);
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
(
id bigint not null primary key,
account_name varchar(128), -- 账户名称
account_number varchar(64), -- 账户编号
account_code varchar(64), -- 账户代码
amount decimal(14,4) default 0, -- 账户总余额
version int default 1,
create_user int8,
create_dept int8,
create_time timestamp(6),
update_user int8,
update_time timestamp(6),
status integer default 1,
is_deleted integer default 0
id bigint not null primary key,
account_name varchar(128), -- 账户名称
account_number varchar(64), -- 账户编号
account_code varchar(64), -- 账户代码
amount decimal(14, 4) default 0, -- 账户总余额
version int default 1,
create_user int8,
create_dept int8,
create_time timestamp(6),
update_user int8,
update_time timestamp(6),
status integer default 1,
is_deleted integer default 0
);
create index user_commission_account_index
@@ -492,31 +492,31 @@ alter table user_commission_account
-- 25%商品成本佣金流水表
create table user_commission_goods_cost_log
(
id bigint not null primary key,
account_id bigint, -- 账户id
account_name varchar(128), -- 账户名称
account_number varchar(64), -- 账户编号
account_code varchar(64), -- 账户代码
user_id bigint,
user_phone bigint,
user_name varchar(128),
amount decimal(14,4) default 0, -- 变动金额
source_id bigint, -- 来源id
source_detail text, -- 来源详情
order_id bigint, -- 订单id
order_detail text, -- 订单详情
type int default 1, -- 类型 1-收入 2-支出
statistical_date timestamp(6), -- 统计时间
channel varchar(64), -- 渠道
channel_detail text, -- 渠道详情
remark text, -- 备注
create_user int8,
create_dept int8,
create_time timestamp(6),
update_user int8,
update_time timestamp(6),
status integer default 1,
is_deleted integer default 0
id bigint not null primary key,
account_id bigint, -- 账户id
account_name varchar(128), -- 账户名称
account_number varchar(64), -- 账户编号
account_code varchar(64), -- 账户代码
user_id bigint,
user_phone bigint,
user_name varchar(128),
amount decimal(14, 4) default 0, -- 变动金额
source_id bigint, -- 来源id
source_detail text, -- 来源详情
order_id bigint, -- 订单id
order_detail text, -- 订单详情
type int default 1, -- 类型 1-收入 2-支出
statistical_date timestamp(6), -- 统计时间
channel varchar(64), -- 渠道
channel_detail text, -- 渠道详情
remark text, -- 备注
create_user int8,
create_dept int8,
create_time timestamp(6),
update_user int8,
update_time timestamp(6),
status integer default 1,
is_deleted integer default 0
);
create index ucc_log_date_index
@@ -555,31 +555,31 @@ alter table user_commission_goods_cost_log
-- 30%购买人获取用户积分佣金流水表
create table user_commission_user_point_log
(
id bigint not null primary key,
account_id bigint, -- 账户id
account_name varchar(128), -- 账户名称
account_number varchar(64), -- 账户编号
account_code varchar(64), -- 账户代码
user_id bigint,
user_phone bigint,
user_name varchar(128),
amount decimal(14,4) default 0, -- 变动金额
source_id bigint, -- 来源id
source_detail text, -- 来源详情
order_id bigint, -- 订单id
order_detail text, -- 订单详情
type int default 1, -- 类型 1-收入 2-支出
statistical_date timestamp(6), -- 统计时间
channel varchar(64), -- 渠道
channel_detail text, -- 渠道详情
remark text, -- 备注
create_user int8,
create_dept int8,
create_time timestamp(6),
update_user int8,
update_time timestamp(6),
status integer default 1,
is_deleted integer default 0
id bigint not null primary key,
account_id bigint, -- 账户id
account_name varchar(128), -- 账户名称
account_number varchar(64), -- 账户编号
account_code varchar(64), -- 账户代码
user_id bigint,
user_phone bigint,
user_name varchar(128),
amount decimal(14, 4) default 0, -- 变动金额
source_id bigint, -- 来源id
source_detail text, -- 来源详情
order_id bigint, -- 订单id
order_detail text, -- 订单详情
type int default 1, -- 类型 1-收入 2-支出
statistical_date timestamp(6), -- 统计时间
channel varchar(64), -- 渠道
channel_detail text, -- 渠道详情
remark text, -- 备注
create_user int8,
create_dept int8,
create_time timestamp(6),
update_user int8,
update_time timestamp(6),
status integer default 1,
is_deleted integer default 0
);
create index ucup_log_date_index
@@ -618,31 +618,31 @@ alter table user_commission_user_point_log
-- 10%直推人佣金流水表
create table user_commission_direct_push_log
(
id bigint not null primary key,
account_id bigint, -- 账户id
account_name varchar(128), -- 账户名称
account_number varchar(64), -- 账户编号
account_code varchar(64), -- 账户代码
user_id bigint,
user_phone bigint,
user_name varchar(128),
amount decimal(14,4) default 0, -- 变动金额
source_id bigint, -- 来源id
source_detail text, -- 来源详情
order_id bigint, -- 订单id
order_detail text, -- 订单详情
type int default 1, -- 类型 1-收入 2-支出
statistical_date timestamp(6), -- 统计时间
channel varchar(64), -- 渠道
channel_detail text, -- 渠道详情
remark text, -- 备注
create_user int8,
create_dept int8,
create_time timestamp(6),
update_user int8,
update_time timestamp(6),
status integer default 1,
is_deleted integer default 0
id bigint not null primary key,
account_id bigint, -- 账户id
account_name varchar(128), -- 账户名称
account_number varchar(64), -- 账户编号
account_code varchar(64), -- 账户代码
user_id bigint,
user_phone bigint,
user_name varchar(128),
amount decimal(14, 4) default 0, -- 变动金额
source_id bigint, -- 来源id
source_detail text, -- 来源详情
order_id bigint, -- 订单id
order_detail text, -- 订单详情
type int default 1, -- 类型 1-收入 2-支出
statistical_date timestamp(6), -- 统计时间
channel varchar(64), -- 渠道
channel_detail text, -- 渠道详情
remark text, -- 备注
create_user int8,
create_dept int8,
create_time timestamp(6),
update_user int8,
update_time timestamp(6),
status integer default 1,
is_deleted integer default 0
);
create index ucdp_log_date_index
@@ -681,33 +681,33 @@ alter table user_commission_direct_push_log
-- 5%运营佣金流水表
create table user_commission_operation_log
(
id bigint not null primary key,
account_id bigint, -- 账户id
account_name varchar(128), -- 账户名称
account_number varchar(64), -- 账户编号
account_code varchar(64), -- 账户代码
user_id bigint,
user_phone bigint,
user_name varchar(128),
amount decimal(14,4) default 0, -- 变动金额
source_id bigint, -- 来源id
source_detail text, -- 来源详情
order_id bigint, -- 订单id
order_detail text, -- 订单详情
type int default 1, -- 类型 1-收入 2-支出
statistical_date timestamp(6), -- 统计时间
channel varchar(64), -- 渠道
channel_detail text, -- 渠道详情
remark text, -- 备注
random_deduction decimal(14,4) default 0, -- 随机立减金额
random_deduction_desc text, -- 随机立减说明
create_user int8,
create_dept int8,
create_time timestamp(6),
update_user int8,
update_time timestamp(6),
status integer default 1,
is_deleted integer default 0
id bigint not null primary key,
account_id bigint, -- 账户id
account_name varchar(128), -- 账户名称
account_number varchar(64), -- 账户编号
account_code varchar(64), -- 账户代码
user_id bigint,
user_phone bigint,
user_name varchar(128),
amount decimal(14, 4) default 0, -- 变动金额
source_id bigint, -- 来源id
source_detail text, -- 来源详情
order_id bigint, -- 订单id
order_detail text, -- 订单详情
type int default 1, -- 类型 1-收入 2-支出
statistical_date timestamp(6), -- 统计时间
channel varchar(64), -- 渠道
channel_detail text, -- 渠道详情
remark text, -- 备注
random_deduction decimal(14, 4) default 0, -- 随机立减金额
random_deduction_desc text, -- 随机立减说明
create_user int8,
create_dept int8,
create_time timestamp(6),
update_user int8,
update_time timestamp(6),
status integer default 1,
is_deleted integer default 0
);
create index ucop_log_date_index
@@ -748,30 +748,30 @@ alter table user_commission_operation_log
-- 5%广告补贴佣金流水表
create table user_commission_advertising_log
(
id bigint not null primary key,
account_id bigint, -- 账户id
account_name varchar(128), -- 账户名称
account_number varchar(64), -- 账户编号
account_code varchar(64), -- 账户代码
amount decimal(14,4) default 0, -- 变动金额
source_id bigint, -- 来源id
source_detail text, -- 来源详情
order_id bigint, -- 订单id
order_detail text, -- 订单详情
type int default 1, -- 类型 1-收入 2-支出
statistical_date timestamp(6), -- 统计时间
channel varchar(64), -- 渠道
channel_detail text, -- 渠道详情
remark text, -- 备注
daily_statistics_date timestamp(6), -- 每日统计日期
statistics_cycle varchar(32), -- 统计周期
create_user int8,
create_dept int8,
create_time timestamp(6),
update_user int8,
update_time timestamp(6),
status integer default 1,
is_deleted integer default 0
id bigint not null primary key,
account_id bigint, -- 账户id
account_name varchar(128), -- 账户名称
account_number varchar(64), -- 账户编号
account_code varchar(64), -- 账户代码
amount decimal(14, 4) default 0, -- 变动金额
source_id bigint, -- 来源id
source_detail text, -- 来源详情
order_id bigint, -- 订单id
order_detail text, -- 订单详情
type int default 1, -- 类型 1-收入 2-支出
statistical_date timestamp(6), -- 统计时间
channel varchar(64), -- 渠道
channel_detail text, -- 渠道详情
remark text, -- 备注
daily_statistics_date timestamp(6), -- 每日统计日期
statistics_cycle varchar(32), -- 统计周期
create_user int8,
create_dept int8,
create_time timestamp(6),
update_user int8,
update_time timestamp(6),
status integer default 1,
is_deleted integer default 0
);
create index uca_log_date_index
@@ -810,32 +810,32 @@ alter table user_commission_advertising_log
create table user_commission_service_provider_log
(
id bigint not null primary key,
account_id bigint, -- 账户id
account_name varchar(128), -- 账户名称
account_number varchar(64), -- 账户编号
account_code varchar(64), -- 账户代码
account_id bigint, -- 账户id
account_name varchar(128), -- 账户名称
account_number varchar(64), -- 账户编号
account_code varchar(64), -- 账户代码
user_id bigint,
user_phone bigint,
user_name varchar(128),
amount decimal(14,4) default 0, -- 变动金额
source_id bigint, -- 来源id
source_detail text, -- 来源详情
order_id bigint, -- 订单id
order_detail text, -- 订单详情
type int default 1, -- 类型 1-收入 2-支出
statistical_date timestamp(6), -- 统计时间
channel varchar(64), -- 渠道
channel_detail text, -- 渠道详情
remark text, -- 备注
service_type varchar(64), -- 服务类型
service_provider_id bigint, -- 服务商ID
amount decimal(14, 4) default 0, -- 变动金额
source_id bigint, -- 来源id
source_detail text, -- 来源详情
order_id bigint, -- 订单id
order_detail text, -- 订单详情
type int default 1, -- 类型 1-收入 2-支出
statistical_date timestamp(6), -- 统计时间
channel varchar(64), -- 渠道
channel_detail text, -- 渠道详情
remark text, -- 备注
service_type varchar(64), -- 服务类型
service_provider_id bigint, -- 服务商ID
create_user int8,
create_dept int8,
create_time timestamp(6),
update_user int8,
update_time timestamp(6),
status integer default 1,
is_deleted integer default 0
status integer default 1,
is_deleted integer default 0
);
create index ucsp_log_date_index
@@ -873,33 +873,33 @@ alter table user_commission_service_provider_log
-- 15%极差代理佣金流水表
create table user_commission_agency_log
(
id bigint not null primary key,
account_id bigint, -- 账户id
account_name varchar(128), -- 账户名称
account_number varchar(64), -- 账户编号
account_code varchar(64), -- 账户代码
user_id bigint,
user_phone bigint,
user_name varchar(128),
amount decimal(14,4) default 0, -- 变动金额
source_id bigint, -- 来源id
source_detail text, -- 来源详情
order_id bigint, -- 订单id
order_detail text, -- 订单详情
type int default 1, -- 类型 1-收入 2-支出
statistical_date timestamp(6), -- 统计时间
channel varchar(64), -- 渠道
channel_detail text, -- 渠道详情
remark text, -- 备注
agency_level varchar(32), -- 代理级别
agency_parent_id bigint, -- 上级代理ID
create_user int8,
create_dept int8,
create_time timestamp(6),
update_user int8,
update_time timestamp(6),
status integer default 1,
is_deleted integer default 0
id bigint not null primary key,
account_id bigint, -- 账户id
account_name varchar(128), -- 账户名称
account_number varchar(64), -- 账户编号
account_code varchar(64), -- 账户代码
user_id bigint,
user_phone bigint,
user_name varchar(128),
amount decimal(14, 4) default 0, -- 变动金额
source_id bigint, -- 来源id
source_detail text, -- 来源详情
order_id bigint, -- 订单id
order_detail text, -- 订单详情
type int default 1, -- 类型 1-收入 2-支出
statistical_date timestamp(6), -- 统计时间
channel varchar(64), -- 渠道
channel_detail text, -- 渠道详情
remark text, -- 备注
agency_level varchar(32), -- 代理级别
agency_parent_id bigint, -- 上级代理ID
create_user int8,
create_dept int8,
create_time timestamp(6),
update_user int8,
update_time timestamp(6),
status integer default 1,
is_deleted integer default 0
);
create index ucal_log_date_index
@@ -940,33 +940,33 @@ alter table user_commission_agency_log
-- 5%联创佣金流水表
create table user_commission_co_creator_log
(
id bigint not null primary key,
account_id bigint, -- 账户id
account_name varchar(128), -- 账户名称
account_number varchar(64), -- 账户编号
account_code varchar(64), -- 账户代码
user_id bigint,
user_phone bigint,
user_name varchar(128),
amount decimal(14,4) default 0, -- 变动金额
source_id bigint, -- 来源id
source_detail text, -- 来源详情
order_id bigint, -- 订单id
order_detail text, -- 订单详情
type int default 1, -- 类型 1-收入 2-支出
statistical_date timestamp(6), -- 统计时间
channel varchar(64), -- 渠道
channel_detail text, -- 渠道详情
remark text, -- 备注
co_creator_type varchar(64), -- 联创类型
co_creator_rank varchar(32), -- 联创等级
create_user int8,
create_dept int8,
create_time timestamp(6),
update_user int8,
update_time timestamp(6),
status integer default 1,
is_deleted integer default 0
id bigint not null primary key,
account_id bigint, -- 账户id
account_name varchar(128), -- 账户名称
account_number varchar(64), -- 账户编号
account_code varchar(64), -- 账户代码
user_id bigint,
user_phone bigint,
user_name varchar(128),
amount decimal(14, 4) default 0, -- 变动金额
source_id bigint, -- 来源id
source_detail text, -- 来源详情
order_id bigint, -- 订单id
order_detail text, -- 订单详情
type int default 1, -- 类型 1-收入 2-支出
statistical_date timestamp(6), -- 统计时间
channel varchar(64), -- 渠道
channel_detail text, -- 渠道详情
remark text, -- 备注
co_creator_type varchar(64), -- 联创类型
co_creator_rank varchar(32), -- 联创等级
create_user int8,
create_dept int8,
create_time timestamp(6),
update_user int8,
update_time timestamp(6),
status integer default 1,
is_deleted integer default 0
);
create index uccc_log_date_index

View File

@@ -1,20 +1,19 @@
create table user_performance
(
id bigint not null primary key,
user_id bigint,
user_phone bigint,
user_name varchar(128),
performance decimal(16,4) default 0,
own_performance decimal(16,4) default 0,
version int default 1,
create_user int8,
create_dept int8,
create_time timestamp(6),
update_user int8,
update_time timestamp(6),
status integer default 1,
is_deleted integer default 0
id bigint not null primary key,
user_id bigint,
user_phone bigint,
user_name varchar(128),
performance decimal(16, 4) default 0,
own_performance decimal(16, 4) default 0,
version int default 1,
create_user int8,
create_dept int8,
create_time timestamp(6),
update_user int8,
update_time timestamp(6),
status integer default 1,
is_deleted integer default 0
);
create index up_index
on user_performance (is_deleted, user_id);
@@ -39,26 +38,26 @@ alter table user_performance
create table user_performance_log
(
id bigint not null primary key,
user_id bigint,
id bigint not null primary key,
user_id bigint,
user_phone bigint,
user_name varchar(128),
amount decimal(14,4) default 0,
source_id bigint,
source_detail text,
order_id bigint,
type int default 1,
statistical_date timestamp(6),
channel varchar(64),
channel_detail text,
remark text,
user_name varchar(128),
amount decimal(14, 4) default 0,
source_id bigint,
source_detail text,
order_id bigint,
type int default 1,
statistical_date timestamp(6),
channel varchar(64),
channel_detail text,
remark text,
create_user int8,
create_dept int8,
create_time timestamp(6),
update_user int8,
update_time timestamp(6),
status integer default 1,
is_deleted integer default 0
status integer default 1,
is_deleted integer default 0
);
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.channel is '渠道';
comment on column user_performance_log.channel_detail 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_dept is '创建部门';
@@ -93,20 +91,20 @@ alter table user_performance_log
create table user_performance_benefit
(
id bigint not null primary key,
user_id bigint,
user_phone bigint,
user_name varchar(128),
performance decimal(16,4) default 0,
own_performance decimal(16,4) default 0,
version int default 1,
create_user int8,
create_dept int8,
create_time timestamp(6),
update_user int8,
update_time timestamp(6),
status integer default 1,
is_deleted integer default 0
id bigint not null primary key,
user_id bigint,
user_phone bigint,
user_name varchar(128),
performance decimal(16, 4) default 0,
own_performance decimal(16, 4) default 0,
version int default 1,
create_user int8,
create_dept int8,
create_time timestamp(6),
update_user int8,
update_time timestamp(6),
status integer default 1,
is_deleted integer default 0
);
create index upb_index
on user_performance_benefit (is_deleted, user_id);
@@ -131,26 +129,26 @@ alter table user_performance_benefit
create table user_performance_benefit_log
(
id bigint not null primary key,
user_id bigint,
id bigint not null primary key,
user_id bigint,
user_phone bigint,
user_name varchar(128),
amount decimal(14,4) default 0,
source_id bigint,
source_detail text,
order_id bigint,
type int default 1,
statistical_date timestamp(6),
channel varchar(64),
channel_detail text,
remark text,
user_name varchar(128),
amount decimal(14, 4) default 0,
source_id bigint,
source_detail text,
order_id bigint,
type int default 1,
statistical_date timestamp(6),
channel varchar(64),
channel_detail text,
remark text,
create_user int8,
create_dept int8,
create_time timestamp(6),
update_user int8,
update_time timestamp(6),
status integer default 1,
is_deleted integer default 0
status integer default 1,
is_deleted integer default 0
);
create index upbl_index

View File

@@ -1,16 +1,16 @@
create table user_benefit
(
id bigint not null primary key,
id bigint not null primary key,
user_id bigint,
amount decimal(14,4) default 0,
version int default 1,
amount decimal(14, 4) default 0,
version int default 1,
create_user int8,
create_dept int8,
create_time timestamp(6),
update_user int8,
update_time timestamp(6),
status integer default 1,
is_deleted integer default 0
status integer default 1,
is_deleted integer default 0
);
create index user_benefit_index
@@ -34,27 +34,27 @@ alter table user_benefit
create table user_benefit_log
(
id bigint not null primary key,
user_id bigint,
id bigint not null primary key,
user_id bigint,
user_phone bigint,
user_name varchar(128),
amount decimal(14,4) default 0,
source_id bigint,
user_pack_id bigint,
source_detail text,
order_id bigint,
type int default 1,
statistical_date timestamp(6),
channel varchar(64),
channel_detail text,
remark text,
create_user int8,
create_dept int8,
create_time timestamp(6),
update_user int8,
update_time timestamp(6),
status integer default 1,
is_deleted integer default 0
user_name varchar(128),
amount decimal(14, 4) default 0,
source_id bigint,
user_pack_id bigint,
source_detail text,
order_id bigint,
type int default 1,
statistical_date timestamp(6),
channel varchar(64),
channel_detail text,
remark text,
create_user int8,
create_dept int8,
create_time timestamp(6),
update_user int8,
update_time timestamp(6),
status integer default 1,
is_deleted integer default 0
);
create index ub_log_date_index
@@ -89,17 +89,17 @@ alter table user_benefit_log
create table user_commission
(
id bigint not null primary key,
user_id bigint,
amount decimal(14,4) default 0,
version int default 1,
create_user int8,
create_dept int8,
create_time timestamp(6),
update_user int8,
update_time timestamp(6),
status integer default 1,
is_deleted integer default 0
id bigint not null primary key,
user_id bigint,
amount decimal(14, 4) default 0,
version int default 1,
create_user int8,
create_dept int8,
create_time timestamp(6),
update_user int8,
update_time timestamp(6),
status integer default 1,
is_deleted integer default 0
);
create index user_commission_index
@@ -124,26 +124,26 @@ alter table user_commission
create table user_commission_log
(
id bigint not null primary key,
user_id bigint,
id bigint not null primary key,
user_id bigint,
user_phone bigint,
user_name varchar(128),
amount decimal(14,4) default 0,
source_id bigint,
source_detail text,
order_id bigint,
type int default 1,
statistical_date timestamp(6),
channel varchar(64),
channel_detail text,
remark text,
create_user int8,
create_dept int8,
create_time timestamp(6),
update_user int8,
update_time timestamp(6),
status integer default 1,
is_deleted integer default 0
user_name varchar(128),
amount decimal(14, 4) default 0,
source_id bigint,
source_detail text,
order_id bigint,
type int default 1,
statistical_date timestamp(6),
channel varchar(64),
channel_detail text,
remark text,
create_user int8,
create_dept int8,
create_time timestamp(6),
update_user int8,
update_time timestamp(6),
status integer default 1,
is_deleted integer default 0
);
create index user_commission_log_index
@@ -177,16 +177,16 @@ alter table user_commission_log
create table user_cash
(
id bigint not null primary key,
user_id bigint,
amount decimal(14,4) default 0,
version int default 1,
create_user int8,
create_dept int8,
create_time timestamp(6),
update_user int8,
update_time timestamp(6),
is_deleted integer default 0
id bigint not null primary key,
user_id bigint,
amount decimal(14, 4) default 0,
version int default 1,
create_user int8,
create_dept int8,
create_time timestamp(6),
update_user int8,
update_time timestamp(6),
is_deleted integer default 0
);
create index user_cash_index
@@ -210,26 +210,26 @@ alter table user_cash
create table user_cash_log
(
id bigint not null primary key,
user_id bigint,
id bigint not null primary key,
user_id bigint,
user_phone bigint,
user_name varchar(128),
amount decimal(14,4) default 0,
source_id bigint,
source_detail text,
order_id bigint,
type int default 1,
statistical_date timestamp(6),
channel varchar(64),
channel_detail text,
remark text,
user_name varchar(128),
amount decimal(14, 4) default 0,
source_id bigint,
source_detail text,
order_id bigint,
type int default 1,
statistical_date timestamp(6),
channel varchar(64),
channel_detail text,
remark text,
create_user int8,
create_dept int8,
create_time timestamp(6),
update_user int8,
update_time timestamp(6),
status integer default 1,
is_deleted integer default 0
status integer default 1,
is_deleted integer default 0
);
create index user_cash_log_index
@@ -263,16 +263,16 @@ alter table user_cash_log
create table user_mall_integral
(
id bigint not null primary key,
user_id bigint,
amount decimal(14,4) default 0,
version int default 1,
create_user int8,
create_dept int8,
create_time timestamp(6),
update_user int8,
update_time timestamp(6),
is_deleted integer default 0
id bigint not null primary key,
user_id bigint,
amount decimal(14, 4) default 0,
version int default 1,
create_user int8,
create_dept int8,
create_time timestamp(6),
update_user int8,
update_time timestamp(6),
is_deleted integer default 0
);
create index user_mall_integral_index
@@ -296,26 +296,26 @@ alter table user_mall_integral
create table user_mall_integral_log
(
id bigint not null primary key,
user_id bigint,
id bigint not null primary key,
user_id bigint,
user_phone bigint,
user_name varchar(128),
amount decimal(14,4) default 0,
source_id bigint,
source_detail text,
order_id bigint,
type int default 1,
statistical_date timestamp(6),
channel varchar(64),
channel_detail text,
remark text,
user_name varchar(128),
amount decimal(14, 4) default 0,
source_id bigint,
source_detail text,
order_id bigint,
type int default 1,
statistical_date timestamp(6),
channel varchar(64),
channel_detail text,
remark text,
create_user int8,
create_dept int8,
create_time timestamp(6),
update_user int8,
update_time timestamp(6),
status integer default 1,
is_deleted integer default 0
status integer default 1,
is_deleted integer default 0
);
create index user_mall_integral_log_index
@@ -348,23 +348,22 @@ alter table user_mall_integral_log
create table user_gains_day
(
id bigint not null primary key,
statistical_date timestamp(6),
user_id bigint,
amount decimal(14,4) default 0,
gains_details text,
is_credited integer default 0,
version int default 1,
create_user int8,
create_dept int8,
create_time timestamp(6),
update_user int8,
update_time timestamp(6),
status integer default 1,
is_deleted integer default 0
id bigint not null primary key,
statistical_date timestamp(6),
user_id bigint,
amount decimal(14, 4) default 0,
gains_details text,
is_credited integer default 0,
version int default 1,
create_user int8,
create_dept int8,
create_time timestamp(6),
update_user int8,
update_time timestamp(6),
status integer default 1,
is_deleted integer default 0
);
create index ugd_date_index
@@ -391,25 +390,25 @@ alter table user_gains_day
create table user_gains_day_log
(
id bigint not null primary key,
user_id bigint,
id bigint not null primary key,
user_id bigint,
user_phone bigint,
user_name varchar(128),
amount decimal(14,4) default 0,
source_id bigint,
source_detail text,
gains_details text,
order_id bigint,
statistical_date timestamp(6),
is_summary integer default 0,
remark text,
create_user int8,
create_dept int8,
create_time timestamp(6),
update_user int8,
update_time timestamp(6),
status integer default 1,
is_deleted integer default 0
user_name varchar(128),
amount decimal(14, 4) default 0,
source_id bigint,
source_detail text,
gains_details text,
order_id bigint,
statistical_date timestamp(6),
is_summary integer default 0,
remark text,
create_user int8,
create_dept int8,
create_time timestamp(6),
update_user int8,
update_time timestamp(6),
status integer default 1,
is_deleted integer default 0
);
create index ugd_log_date_index

View File

@@ -1,19 +1,20 @@
CREATE TABLE vendor_daily_activity (
id BIGINT NOT NULL PRIMARY KEY,
settle_date DATE NOT NULL,
region_id BIGINT NOT NULL,
region_level INTEGER DEFAULT 0 NOT NULL,
total_amount INTEGER DEFAULT 0 NOT NULL,
activity_amount INTEGER DEFAULT 0 NOT NULL,
activity_value_amount DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
increase_activity_value_amount DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
create_user int8 NULL,
create_dept int8 NULL,
create_time TIMESTAMP(6) NULL,
update_user int8 NULL,
update_time TIMESTAMP(6) NULL,
status INTEGER NULL,
is_deleted INTEGER DEFAULT 0 NULL
CREATE TABLE vendor_daily_activity
(
id BIGINT NOT NULL PRIMARY KEY,
settle_date DATE NOT NULL,
region_id BIGINT NOT NULL,
region_level INTEGER DEFAULT 0 NOT NULL,
total_amount INTEGER DEFAULT 0 NOT NULL,
activity_amount INTEGER DEFAULT 0 NOT NULL,
activity_value_amount DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
increase_activity_value_amount DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
create_user int8 NULL,
create_dept int8 NULL,
create_time TIMESTAMP(6) NULL,
update_user int8 NULL,
update_time TIMESTAMP(6) NULL,
status INTEGER NULL,
is_deleted INTEGER DEFAULT 0 NULL
);
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 '是否已删除';
CREATE TABLE vendor_daily_profit (
id BIGINT NOT NULL PRIMARY KEY,
settle_date DATE NOT NULL,
region_id BIGINT NOT NULL,
region_level INTEGER DEFAULT 0 NOT NULL,
profit_type INTEGER DEFAULT 0 NOT NULL,
order_type INTEGER NOT NULL,
total_amount DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
profit_amount DECIMAL(10, 1) DEFAULT 0.0 NOT NULL,
quantity INTEGER DEFAULT 0 NOT NULL,
create_user int8 NULL,
create_dept int8 NULL,
create_time TIMESTAMP(6) NULL,
update_user int8 NULL,
update_time TIMESTAMP(6) NULL,
status INTEGER NULL,
is_deleted INTEGER DEFAULT 0 NULL
CREATE TABLE vendor_daily_profit
(
id BIGINT NOT NULL PRIMARY KEY,
settle_date DATE NOT NULL,
region_id BIGINT NOT NULL,
region_level INTEGER DEFAULT 0 NOT NULL,
profit_type INTEGER DEFAULT 0 NOT NULL,
order_type INTEGER NOT NULL,
total_amount DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
profit_amount DECIMAL(10, 1) DEFAULT 0.0 NOT NULL,
quantity INTEGER DEFAULT 0 NOT NULL,
create_user int8 NULL,
create_dept int8 NULL,
create_time TIMESTAMP(6) NULL,
update_user int8 NULL,
update_time TIMESTAMP(6) NULL,
status INTEGER NULL,
is_deleted INTEGER DEFAULT 0 NULL
);
COMMENT ON TABLE vendor_daily_profit IS '服务商营收收益';
@@ -73,30 +75,30 @@ COMMENT ON COLUMN vendor_daily_profit.is_deleted IS '是否已删除';
CREATE TABLE vendor_info (
id BIGINT NOT NULL PRIMARY KEY,
region_id BIGINT NOT NULL,
user_id BIGINT NOT NULL,
company_name VARCHAR(200) DEFAULT '' NOT NULL,
legal_person_name VARCHAR(200) DEFAULT '' NOT NULL,
id_card VARCHAR(50) DEFAULT '' NOT NULL,
contact_no VARCHAR(50) DEFAULT '' NOT NULL,
id_card_front VARCHAR(200) DEFAULT '' NOT NULL,
id_card_back VARCHAR(200) DEFAULT '' NOT NULL,
id_card_handheld VARCHAR(200) DEFAULT '' NOT NULL,
business_license VARCHAR(200) DEFAULT '' NOT NULL,
audit_status INTEGER DEFAULT 1 NOT NULL,
auditor BIGINT NULL,
reject_reason VARCHAR(200) DEFAULT '' NOT NULL,
create_user int8 NULL,
create_dept int8 NULL,
create_time TIMESTAMP(6) NULL,
update_user int8 NULL,
update_time TIMESTAMP(6) NULL,
status INTEGER NULL,
is_deleted INTEGER DEFAULT 0 NULL,
apply_time TIMESTAMP(6) NULL
CREATE TABLE vendor_info
(
id BIGINT NOT NULL PRIMARY KEY,
region_id BIGINT NOT NULL,
user_id BIGINT NOT NULL,
company_name VARCHAR(200) DEFAULT '' NOT NULL,
legal_person_name VARCHAR(200) DEFAULT '' NOT NULL,
id_card VARCHAR(50) DEFAULT '' NOT NULL,
contact_no VARCHAR(50) DEFAULT '' NOT NULL,
id_card_front VARCHAR(200) DEFAULT '' NOT NULL,
id_card_back VARCHAR(200) DEFAULT '' NOT NULL,
id_card_handheld VARCHAR(200) DEFAULT '' NOT NULL,
business_license VARCHAR(200) DEFAULT '' NOT NULL,
audit_status INTEGER DEFAULT 1 NOT NULL,
auditor BIGINT NULL,
reject_reason VARCHAR(200) DEFAULT '' NOT NULL,
create_user int8 NULL,
create_dept int8 NULL,
create_time TIMESTAMP(6) NULL,
update_user int8 NULL,
update_time TIMESTAMP(6) NULL,
status INTEGER NULL,
is_deleted INTEGER DEFAULT 0 NULL,
apply_time TIMESTAMP(6) NULL
);
COMMENT ON TABLE vendor_info IS '服务商';
@@ -125,26 +127,27 @@ COMMENT ON COLUMN vendor_info.apply_time IS '申请时间';
CREATE TABLE vendor_payout_apply (
id BIGINT NOT NULL PRIMARY KEY,
user_id BIGINT DEFAULT 0 NOT NULL,
apply_amount DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
company_fully_name VARCHAR(255) NULL,
bank_account VARCHAR(255) NULL,
branch_info VARCHAR(255) NULL,
transfer_description VARCHAR(255) NULL,
invoice_url TEXT NULL,
invoice_number VARCHAR(255) NULL,
transfer_voucher TEXT NULL,
apply_status INTEGER DEFAULT 1 NOT NULL,
remark VARCHAR(255) NULL,
create_user int8 NULL,
create_dept int8 NULL,
create_time TIMESTAMP(6) NULL,
update_user int8 NULL,
update_time TIMESTAMP(6) NULL,
status INTEGER NULL,
is_deleted INTEGER NULL
CREATE TABLE vendor_payout_apply
(
id BIGINT NOT NULL PRIMARY KEY,
user_id BIGINT DEFAULT 0 NOT NULL,
apply_amount DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
company_fully_name VARCHAR(255) NULL,
bank_account VARCHAR(255) NULL,
branch_info VARCHAR(255) NULL,
transfer_description VARCHAR(255) NULL,
invoice_url TEXT NULL,
invoice_number VARCHAR(255) NULL,
transfer_voucher TEXT NULL,
apply_status INTEGER DEFAULT 1 NOT NULL,
remark VARCHAR(255) NULL,
create_user int8 NULL,
create_dept int8 NULL,
create_time TIMESTAMP(6) NULL,
update_user int8 NULL,
update_time TIMESTAMP(6) NULL,
status INTEGER NULL,
is_deleted INTEGER NULL
);
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 (
id BIGINT NOT NULL PRIMARY KEY,
order_id BIGINT DEFAULT 0 NOT NULL,
user_id BIGINT DEFAULT 0 NOT NULL,
district_id BIGINT DEFAULT 0 NOT NULL,
city_id BIGINT DEFAULT 0 NOT NULL,
province_id BIGINT DEFAULT 0 NOT NULL,
order_type INTEGER DEFAULT 0 NOT NULL,
payment_type INTEGER DEFAULT 0 NOT NULL,
actual_amount DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
cost_amount DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
profit_amount DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
order_settle_date TIMESTAMP NULL,
create_user int8 NULL,
create_dept int8 NULL,
create_time TIMESTAMP(6) NULL,
update_user int8 NULL,
update_time TIMESTAMP(6) NULL,
status INTEGER NULL,
is_deleted INTEGER NULL
CREATE TABLE vendor_profit_detail
(
id BIGINT NOT NULL PRIMARY KEY,
order_id BIGINT DEFAULT 0 NOT NULL,
user_id BIGINT DEFAULT 0 NOT NULL,
district_id BIGINT DEFAULT 0 NOT NULL,
city_id BIGINT DEFAULT 0 NOT NULL,
province_id BIGINT DEFAULT 0 NOT NULL,
order_type INTEGER DEFAULT 0 NOT NULL,
payment_type INTEGER DEFAULT 0 NOT NULL,
actual_amount DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
cost_amount DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
profit_amount DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
order_settle_date TIMESTAMP NULL,
create_user int8 NULL,
create_dept int8 NULL,
create_time TIMESTAMP(6) NULL,
update_user int8 NULL,
update_time TIMESTAMP(6) NULL,
status INTEGER NULL,
is_deleted INTEGER NULL
);
COMMENT ON TABLE vendor_profit_detail IS '服务商分润详情';
@@ -215,20 +219,20 @@ COMMENT ON COLUMN vendor_profit_detail.is_deleted IS '是否已删除';
CREATE TABLE vendor_regions (
id BIGINT NOT NULL PRIMARY KEY,
name VARCHAR(50) NULL,
level INTEGER NULL,
pid INTEGER DEFAULT 0 NULL,
CREATE TABLE vendor_regions
(
id BIGINT NOT NULL PRIMARY KEY,
name VARCHAR(50) NULL,
level INTEGER NULL,
pid INTEGER DEFAULT 0 NULL,
lon 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,
points_amount DECIMAL(10, 2) DEFAULT 0.00 NULL,
apply_amount DECIMAL(10, 2) DEFAULT 0.00 NULL,
apply_status INTEGER DEFAULT 1 NULL,
region_code VARCHAR(10) NULL
apply_status INTEGER DEFAULT 1 NULL,
region_code VARCHAR(10) NULL
);
COMMENT ON TABLE vendor_regions IS '服务商地区';
@@ -247,23 +251,23 @@ COMMENT ON COLUMN vendor_regions.region_code IS '区划编号';
CREATE TABLE vendor_virtual_data_activity (
id BIGINT NOT NULL PRIMARY KEY,
region_id INTEGER NOT NULL,
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_quantity INTEGER DEFAULT 0 NOT NULL,
activity_value DECIMAL(10, 2) DEFAULT 0.00 NULL,
increase_activity_value DECIMAL(10, 2) DEFAULT 0.00 NULL,
create_user int8 NULL,
create_dept int8 NULL,
create_time TIMESTAMP(6) NULL,
update_user int8 NULL,
update_time TIMESTAMP(6) NULL,
status INTEGER NULL,
is_deleted INTEGER DEFAULT 0 NULL
CREATE TABLE vendor_virtual_data_activity
(
id BIGINT NOT NULL PRIMARY KEY,
region_id INTEGER NOT NULL,
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_quantity INTEGER DEFAULT 0 NOT NULL,
activity_value DECIMAL(10, 2) DEFAULT 0.00 NULL,
increase_activity_value DECIMAL(10, 2) DEFAULT 0.00 NULL,
create_user int8 NULL,
create_dept int8 NULL,
create_time TIMESTAMP(6) NULL,
update_user int8 NULL,
update_time TIMESTAMP(6) NULL,
status INTEGER NULL,
is_deleted INTEGER DEFAULT 0 NULL
);
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 (
id BIGINT NOT NULL PRIMARY KEY,
region_id INTEGER NOT NULL,
settle_date DATE NOT NULL,
CREATE TABLE vendor_virtual_data_profit
(
id BIGINT NOT NULL PRIMARY KEY,
region_id INTEGER NOT NULL,
settle_date DATE NOT NULL,
online_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,
create_user int8 NULL,
create_dept int8 NULL,
create_time TIMESTAMP(6) NULL,
update_user int8 NULL,
update_time TIMESTAMP(6) NULL,
status INTEGER NULL,
is_deleted INTEGER DEFAULT 0 NULL
create_user int8 NULL,
create_dept int8 NULL,
create_time TIMESTAMP(6) NULL,
update_user int8 NULL,
update_time TIMESTAMP(6) NULL,
status INTEGER NULL,
is_deleted INTEGER DEFAULT 0 NULL
);
COMMENT ON TABLE vendor_virtual_data_profit IS '服务商营收虚拟增益';

View File

@@ -1,18 +1,19 @@
CREATE TABLE prize_spu (
id BIGINT NOT NULL PRIMARY KEY,
spu_name VARCHAR(255) DEFAULT '' NOT NULL,
main_img VARCHAR(255) DEFAULT '' NOT NULL,
detail_img text NULL,
cost_price DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
original_price DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
spu_qty INTEGER DEFAULT 0 NOT NULL,
status INTEGER DEFAULT 0 NULL,
create_user int8 NULL,
create_dept int8 NULL,
create_time TIMESTAMP(6) NULL,
update_user int8 NULL,
update_time TIMESTAMP(6) NULL,
is_deleted INTEGER DEFAULT 0 NULL
CREATE TABLE prize_spu
(
id BIGINT NOT NULL PRIMARY KEY,
spu_name VARCHAR(255) DEFAULT '' NOT NULL,
main_img VARCHAR(255) DEFAULT '' NOT NULL,
detail_img text NULL,
cost_price DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
original_price DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
spu_qty INTEGER DEFAULT 0 NOT NULL,
status INTEGER DEFAULT 0 NULL,
create_user int8 NULL,
create_dept int8 NULL,
create_time TIMESTAMP(6) NULL,
update_user int8 NULL,
update_time TIMESTAMP(6) NULL,
is_deleted INTEGER DEFAULT 0 NULL
);
COMMENT ON TABLE prize_spu IS '奖池商品';
@@ -33,26 +34,27 @@ COMMENT ON COLUMN prize_spu.is_deleted IS '是否已删除';
CREATE TABLE prize_spu_order (
id bigint NOT NULL PRIMARY KEY,
user_id bigint DEFAULT 0 NOT NULL,
CREATE TABLE prize_spu_order
(
id BIGINT NOT NULL PRIMARY KEY,
user_id BIGINT DEFAULT 0 NOT NULL,
user_name VARCHAR(128) NULL,
user_phone bigint NULL,
spu_id bigint NULL,
spu_name VARCHAR(255) NULL,
main_img VARCHAR(255) NULL,
detail_img text NULL,
quantity INTEGER DEFAULT 0 NOT NULL,
order_status INTEGER DEFAULT 0 NOT NULL,
version BIGINT DEFAULT 0 NULL,
create_user int8 NULL,
create_dept int8 NULL,
create_time TIMESTAMP(6) NULL,
update_user int8 NULL,
update_time TIMESTAMP(6) NULL,
status INTEGER DEFAULT -1 NULL,
is_deleted INTEGER DEFAULT 0 NULL
);
user_phone bigint NULL,
spu_id bigint NULL,
spu_name VARCHAR(255) NULL,
main_img VARCHAR(255) NULL,
detail_img text NULL,
quantity INTEGER DEFAULT 0 NOT NULL,
order_status INTEGER DEFAULT 0 NOT NULL,
version BIGINT DEFAULT 0 NULL,
create_user int8 NULL,
create_dept int8 NULL,
create_time TIMESTAMP(6) NULL,
update_user int8 NULL,
update_time TIMESTAMP(6) NULL,
status INTEGER DEFAULT -1 NULL,
is_deleted INTEGER DEFAULT 0 NULL
);
create index prize_spu_order_index on prize_spu_order (user_id);