优化sql脚本执行顺序

This commit is contained in:
2026-02-03 19:58:34 +08:00
parent 849cf4c03e
commit e4dfe062d5
23 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,46 @@
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
);
comment on table aliyun_certify is '阿里云实名记录表';
comment on column aliyun_certify.id is 'ID';
comment on column aliyun_certify.user_id is '用户ID';
comment on column aliyun_certify.user_phone is '用户手机号';
comment on column aliyun_certify.name is '实名用户名';
comment on column aliyun_certify.id_card is '实名身份证';
comment on column aliyun_certify.certify_id is '阿里云实名身份标识';
comment on column aliyun_certify.image is '实名照片';
comment on column aliyun_certify.message is '阿里云认证消息';
comment on column aliyun_certify.is_success is '是否成功';
comment on column aliyun_certify.is_deleted is '是否删除';
comment on column aliyun_certify.create_time is '创建时间';
comment on column aliyun_certify.create_user is '创建人ID';
comment on column aliyun_certify.update_time is '修改时间';
comment on column aliyun_certify.update_user is '修改人ID';
comment on column aliyun_certify.create_dept is '创建部门';
comment on column aliyun_certify.status is '状态';
create index certify_id_index
on aliyun_certify (is_deleted, certify_id);
create index user_certify_id_index
on aliyun_certify (is_deleted, user_id, certify_id);
create index user_id_index
on aliyun_certify (is_deleted, user_id, is_success);

View File

@@ -0,0 +1,42 @@
-- 创建表
CREATE TABLE app_banner
(
id BIGINT NOT NULL PRIMARY KEY,
cover_url VARCHAR(300) NULL,
route VARCHAR(255) NULL,
outside_url VARCHAR(300) NULL,
sort INTEGER DEFAULT 1 NOT NULL,
banner_type INTEGER NULL,
remark VARCHAR(100) NULL,
is_show INTEGER DEFAULT 0 NOT NULL,
tag_name VARCHAR(255) NULL,
create_user BIGINT NULL,
create_dept BIGINT NULL,
create_time TIMESTAMP NULL,
update_user BIGINT NULL,
update_time TIMESTAMP NULL,
status INTEGER NULL,
is_deleted INTEGER DEFAULT 0 NULL
);
-- 添加表注释
COMMENT ON TABLE app_banner IS '首页轮播图';
-- 添加列注释
COMMENT ON COLUMN app_banner.id IS 'ID';
COMMENT ON COLUMN app_banner.cover_url IS '轮播图地址';
COMMENT ON COLUMN app_banner.route IS '路由';
COMMENT ON COLUMN app_banner.outside_url IS '外链地址';
COMMENT ON COLUMN app_banner.sort IS '排序';
COMMENT ON COLUMN app_banner.banner_type IS '轮播图类型 1-主banner 2-商城banner';
COMMENT ON COLUMN app_banner.remark IS '备注';
COMMENT ON COLUMN app_banner.is_show IS '是否显示';
COMMENT ON COLUMN app_banner.tag_name IS '标签名';
COMMENT ON COLUMN app_banner.create_user IS '创建人';
COMMENT ON COLUMN app_banner.create_dept IS '创建部门';
COMMENT ON COLUMN app_banner.create_time IS '创建时间';
COMMENT ON COLUMN app_banner.update_user IS '修改人';
COMMENT ON COLUMN app_banner.update_time IS '修改时间';
COMMENT ON COLUMN app_banner.status IS '状态';
COMMENT ON COLUMN app_banner.is_deleted IS '是否已删除';

View File

@@ -0,0 +1,15 @@
alter table blade_user
add register_date timestamp;
alter table blade_user
add invitation_code varchar(32);
alter table blade_user
add pid bigint;
create index blade_user_register_date_index
on blade_user (is_deleted, register_date);
create index bur_invitation_code_index
on blade_user (is_deleted, invitation_code);

View File

@@ -0,0 +1,168 @@
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 '商品编码';
COMMENT ON COLUMN mall_spu.spu_name IS '商品名称';
COMMENT ON COLUMN mall_spu.main_img IS '主图';
COMMENT ON COLUMN mall_spu.detail_img IS '详情图(多图,逗号分割)';
COMMENT ON COLUMN mall_spu.top_img IS '顶图(多图,逗号分割)';
COMMENT ON COLUMN mall_spu.cate_id IS 'cate_id分类';
COMMENT ON COLUMN mall_spu.cate_ids IS 'cate_id分类';
COMMENT ON COLUMN mall_spu.cost_price IS '成本价';
COMMENT ON COLUMN mall_spu.original_price IS '原价';
COMMENT ON COLUMN mall_spu.retail_price IS '销售价';
COMMENT ON COLUMN mall_spu.profit IS '利润';
COMMENT ON COLUMN mall_spu.sales IS '销量';
COMMENT ON COLUMN mall_spu.spu_qty IS '库存';
COMMENT ON COLUMN mall_spu.tags IS '标签(多标签,逗号分割 )';
COMMENT ON COLUMN mall_spu.status IS '状态(0=下架,1=上架,3=删除)';
COMMENT ON COLUMN mall_spu.create_user IS '创建人';
COMMENT ON COLUMN mall_spu.create_dept IS '创建部门';
COMMENT ON COLUMN mall_spu.create_time IS '创建时间';
COMMENT ON COLUMN mall_spu.update_user IS '修改人';
COMMENT ON COLUMN mall_spu.update_time IS '修改时间';
COMMENT ON COLUMN mall_spu.is_deleted IS '是否已删除';
CREATE TABLE ys_category
(
id INTEGER NOT NULL PRIMARY KEY,
cname VARCHAR(100) DEFAULT '' NOT NULL,
pid BIGINT DEFAULT 0 NOT NULL,
level INTEGER DEFAULT 0 NOT 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 SEQUENCE ys_category_id_seq START 1;
ALTER TABLE ys_category ALTER COLUMN id SET DEFAULT nextval('ys_category_id_seq');
ALTER SEQUENCE ys_category_id_seq OWNED BY ys_category.id;
COMMENT ON TABLE ys_category IS '商品分类';
COMMENT ON COLUMN ys_category.id IS '主键';
COMMENT ON COLUMN ys_category.cname IS '分类名称';
COMMENT ON COLUMN ys_category.pid IS 'pid';
COMMENT ON COLUMN ys_category.level IS 'level';
COMMENT ON COLUMN ys_category.is_deleted IS '是否已删除';
COMMENT ON COLUMN ys_category.create_time IS '创建时间';
COMMENT ON COLUMN ys_category.create_user IS '创建人';
COMMENT ON COLUMN ys_category.update_time IS '修改时间';
COMMENT ON COLUMN ys_category.update_user IS '修改人';
COMMENT ON COLUMN ys_category.status IS '状态';
COMMENT ON COLUMN ys_category.create_dept IS '创建部门';
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 BIGINT DEFAULT 0 NOT NULL,
quantity INTEGER DEFAULT 0 NOT NULL,
original_price DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
main_img VARCHAR(255) DEFAULT '' NOT NULL,
retail_price DECIMAL(10, 2) DEFAULT 0.00 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
);
COMMENT ON TABLE mall_cart IS '商城购物车';
COMMENT ON COLUMN mall_cart.id IS '主键';
COMMENT ON COLUMN mall_cart.user_id IS '用户id';
COMMENT ON COLUMN mall_cart.title IS '商品名称';
COMMENT ON COLUMN mall_cart.spu_id IS 'spuId';
COMMENT ON COLUMN mall_cart.quantity IS '数量';
COMMENT ON COLUMN mall_cart.original_price IS '原价';
COMMENT ON COLUMN mall_cart.main_img IS '主图';
COMMENT ON COLUMN mall_cart.retail_price IS '销售价';
COMMENT ON COLUMN mall_cart.create_user IS '创建人';
COMMENT ON COLUMN mall_cart.create_dept IS '创建部门';
COMMENT ON COLUMN mall_cart.create_time IS '创建时间';
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
);
COMMENT ON TABLE user_address IS '用户地址表';
COMMENT ON COLUMN user_address.id IS '主键';
COMMENT ON COLUMN user_address.user_id IS '用户id';
COMMENT ON COLUMN user_address.regions_info_id IS '地区信息id';
COMMENT ON COLUMN user_address.province IS '省份';
COMMENT ON COLUMN user_address.city IS '城市';
COMMENT ON COLUMN user_address.district IS '区县';
COMMENT ON COLUMN user_address.street IS '街道';
COMMENT ON COLUMN user_address.detail IS '详细地址';
COMMENT ON COLUMN user_address.consignee IS '收货人';
COMMENT ON COLUMN user_address.phone IS '联系电话';
COMMENT ON COLUMN user_address.is_default IS '是否默认地址(0=否,1=是)';
COMMENT ON COLUMN user_address.create_user IS '创建人';
COMMENT ON COLUMN user_address.create_dept IS '创建部门';
COMMENT ON COLUMN user_address.create_time IS '创建时间';
COMMENT ON COLUMN user_address.update_user IS '修改人';
COMMENT ON COLUMN user_address.update_time IS '修改时间';
COMMENT ON COLUMN user_address.status IS '状态';
COMMENT ON COLUMN user_address.is_deleted IS '是否已删除';

View File

@@ -0,0 +1,299 @@
CREATE TABLE user_order
(
id BIGINT DEFAULT 0 NOT NULL PRIMARY KEY,
user_id BIGINT DEFAULT 0 NOT NULL,
user_phone bigint,
user_name varchar(128),
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,
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_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
);
COMMENT ON TABLE user_order IS '用户订单';
COMMENT ON COLUMN user_order.id IS '主键';
COMMENT ON COLUMN user_order.user_id IS '用户id';
COMMENT ON COLUMN user_order.user_phone IS '用户手机号';
COMMENT ON COLUMN user_order.user_name IS '用户名称';
COMMENT ON COLUMN user_order.order_type IS '订单类型';
COMMENT ON COLUMN user_order.order_id IS '订单id';
COMMENT ON COLUMN user_order.title IS '订单名称';
COMMENT ON COLUMN user_order.images IS '图片';
COMMENT ON COLUMN user_order.quantity IS '数量';
COMMENT ON COLUMN user_order.description IS '订单描述';
COMMENT ON COLUMN user_order.order_status IS '订单状态';
COMMENT ON COLUMN user_order.total_amount IS '订单金额';
COMMENT ON COLUMN user_order.actual_amount IS '实际支付金额';
COMMENT ON COLUMN user_order.payment_type 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.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,
user_id BIGINT DEFAULT 0 NOT NULL,
user_phone bigint,
user_name varchar(128),
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,
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,
total_amount DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
actual_amount DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
refund_amount DECIMAL(10, 2) DEFAULT 0.00 NULL,
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,
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,
is_recorded INTEGER DEFAULT 0 NULL,
is_statistics 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
);
COMMENT ON TABLE mall_summary_order IS '商城汇总订单';
COMMENT ON COLUMN mall_summary_order.id IS '主键';
COMMENT ON COLUMN mall_summary_order.user_id IS '用户id';
COMMENT ON COLUMN mall_summary_order.user_phone IS '用户手机号';
COMMENT ON COLUMN mall_summary_order.user_name IS '用户名称';
COMMENT ON COLUMN mall_summary_order.products_info IS '商品信息';
COMMENT ON COLUMN mall_summary_order.order_info IS '订单信息';
COMMENT ON COLUMN mall_summary_order.confirm_info IS '订单确认信息';
COMMENT ON COLUMN mall_summary_order.vendor_regions_id IS '地区id';
COMMENT ON COLUMN mall_summary_order.address_id IS '地址id';
COMMENT ON COLUMN mall_summary_order.delivery_info IS '快递信息';
COMMENT ON COLUMN mall_summary_order.freight_amount IS '运费';
COMMENT ON COLUMN mall_summary_order.cost_amount IS '订单成本';
COMMENT ON COLUMN mall_summary_order.order_amount IS '订单金额';
COMMENT ON COLUMN mall_summary_order.total_amount IS '总金额';
COMMENT ON COLUMN mall_summary_order.actual_amount IS '实际支付';
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 '支付凭证';
COMMENT ON COLUMN mall_summary_order.expire_time IS '超时时间';
COMMENT ON COLUMN mall_summary_order.give_token IS '赠送积分';
COMMENT ON COLUMN mall_summary_order.actual_give_token IS '实际赠送扣分';
COMMENT ON COLUMN mall_summary_order.is_royalty IS '是否已经给上级分红 0=否,1=是';
COMMENT ON COLUMN mall_summary_order.is_recorded IS '是否记录资金账户里 0=否,1=是';
COMMENT ON COLUMN mall_summary_order.is_statistics IS '是否统计到用户现金业绩里 0=否,1=是';
COMMENT ON COLUMN mall_summary_order.remarks IS '备注';
COMMENT ON COLUMN mall_summary_order.status IS '状态';
COMMENT ON COLUMN mall_summary_order.is_deleted IS '是否已删除';
CREATE INDEX mso_index ON mall_summary_order (user_id);
CREATE INDEX mso_status_index ON mall_summary_order (payment_status, status);
CREATE INDEX mso_recorded_index ON mall_summary_order (payment_status, is_recorded);
CREATE INDEX mso_statistics_index ON mall_summary_order (payment_status, is_statistics);
CREATE TABLE mall_detail_order
(
id BIGINT NOT NULL PRIMARY KEY,
user_id BIGINT DEFAULT 0 NOT NULL,
user_phone bigint,
user_name varchar(128),
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,
freight VARCHAR(200) DEFAULT 0.00 NOT NULL,
logistics VARCHAR(200) DEFAULT 0.00 NOT NULL,
delivery_time timestamp(6),
products_info text 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 '商城详情订单';
COMMENT ON COLUMN mall_detail_order.id IS '主键';
COMMENT ON COLUMN mall_detail_order.user_id IS '用户id';
COMMENT ON COLUMN mall_detail_order.user_phone IS '用户手机号';
COMMENT ON COLUMN mall_detail_order.user_name 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.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.logistics IS '物流';
COMMENT ON COLUMN mall_detail_order.products_info IS '商品信息';
COMMENT ON COLUMN mall_detail_order.freight 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,
user_phone bigint,
user_name varchar(128),
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 '商品售后订单表';
COMMENT ON COLUMN mall_summary_order_after.id IS '售后订单号';
COMMENT ON COLUMN mall_summary_order_after.user_id IS '用户id';
COMMENT ON COLUMN mall_summary_order_after.user_phone IS '用户手机号';
COMMENT ON COLUMN mall_summary_order_after.user_name IS '用户名称';
COMMENT ON COLUMN mall_summary_order_after.summary_order_id IS '总订单id';
COMMENT ON COLUMN mall_summary_order_after.goods_id IS '商品ID';
COMMENT ON COLUMN mall_summary_order_after.sku_id IS '商品订单号';
COMMENT ON COLUMN mall_summary_order_after.goods_name IS '商品名称';
COMMENT ON COLUMN mall_summary_order_after.third_plat_order_no IS '第三方订单单号';
COMMENT ON COLUMN mall_summary_order_after.third_plat_after_no IS '第三方售后单号';
COMMENT ON COLUMN mall_summary_order_after.quantity IS '商品数量';
COMMENT ON COLUMN mall_summary_order_after.apply_type IS '申请售后类型,1=未收货退款,2=退货退款,3=换货补发,4=不退货仅退款';
COMMENT ON COLUMN mall_summary_order_after.apply_reason IS '申请售后原因';
COMMENT ON COLUMN mall_summary_order_after.apply_pic_urls 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.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

@@ -0,0 +1,250 @@
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';
COMMENT ON COLUMN registration_order.spu_id IS 'spuId';
COMMENT ON COLUMN registration_order.sku_id IS 'skuId';
COMMENT ON COLUMN registration_order.title IS '规格名称';
COMMENT ON COLUMN registration_order.transaction_type IS '交易类型 1-买 2-卖';
COMMENT ON COLUMN registration_order.thumbnail IS '商品缩略图';
COMMENT ON COLUMN registration_order.thumbnail_height IS '缩略图高度';
COMMENT ON COLUMN registration_order.detail IS '详情图';
COMMENT ON COLUMN registration_order.price IS '单价';
COMMENT ON COLUMN registration_order.points IS '单个赠送积分';
COMMENT ON COLUMN registration_order.quantity IS '数量';
COMMENT ON COLUMN registration_order.remaining IS '剩余数量';
COMMENT ON COLUMN registration_order.user_id IS '用户id';
COMMENT ON COLUMN registration_order.user_nickname IS '用户昵称';
COMMENT ON COLUMN registration_order.in_transaction IS '是否交易中 1-交易中 0-空闲中';
COMMENT ON COLUMN registration_order.is_full_package IS '是否全量交易 1-是 0-否';
COMMENT ON COLUMN registration_order.delivery_type IS '配送方式 1-物流快递 2-同城配送 3-上门自提';
COMMENT ON COLUMN registration_order.region_code IS '收货地址区域编码';
COMMENT ON COLUMN registration_order.region_name IS '行政区域名称';
COMMENT ON COLUMN registration_order.receiver_address IS '收货地址';
COMMENT ON COLUMN registration_order.contact IS '收货人';
COMMENT ON COLUMN registration_order.contact_number IS '收货人联系方式';
COMMENT ON COLUMN registration_order.is_virtual IS '是否虚拟商品 1-是 0-否';
COMMENT ON COLUMN registration_order.is_closed IS '是否交易完成 1-是 0-否';
COMMENT ON COLUMN registration_order.version IS '乐观锁版本号';
COMMENT ON COLUMN registration_order.create_user IS '创建人';
COMMENT ON COLUMN registration_order.create_dept IS '创建部门';
COMMENT ON COLUMN registration_order.create_time IS '创建时间';
COMMENT ON COLUMN registration_order.update_user IS '修改人';
COMMENT ON COLUMN registration_order.update_time IS '修改时间';
COMMENT ON COLUMN registration_order.status IS '状态';
COMMENT ON COLUMN registration_order.is_deleted IS '是否已删除';
COMMENT ON COLUMN registration_order.is_vendor IS '是否服务商订单';
COMMENT ON COLUMN registration_order.is_priority IS '是否优先';
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';
COMMENT ON COLUMN transaction_order.registration_id IS '挂单Id';
COMMENT ON COLUMN transaction_order.sku_id IS 'skuId';
COMMENT ON COLUMN transaction_order.title IS '规格名称';
COMMENT ON COLUMN transaction_order.transaction_type IS '交易类型 1-买 2-卖';
COMMENT ON COLUMN transaction_order.thumbnail IS '商品缩略图';
COMMENT ON COLUMN transaction_order.price IS '单价';
COMMENT ON COLUMN transaction_order.points IS '单个赠送积分';
COMMENT ON COLUMN transaction_order.quantity IS '数量';
COMMENT ON COLUMN transaction_order.total_amount IS '总金额';
COMMENT ON COLUMN transaction_order.total_points IS '总赠送积分';
COMMENT ON COLUMN transaction_order.user_id IS '用户id';
COMMENT ON COLUMN transaction_order.user_nickname IS '用户昵称';
COMMENT ON COLUMN transaction_order.payment_voucher IS '付款凭证';
COMMENT ON COLUMN transaction_order.delivery_voucher IS '物流凭证';
COMMENT ON COLUMN transaction_order.delivery_type IS '收货方式 1-物流快递 2-同城配送 3-上门自提';
COMMENT ON COLUMN transaction_order.region_code IS '收货地址区域编码';
COMMENT ON COLUMN transaction_order.region_name IS '行政区域名称';
COMMENT ON COLUMN transaction_order.receiver_address IS '收货地址';
COMMENT ON COLUMN transaction_order.contact IS '收货联系人';
COMMENT ON COLUMN transaction_order.contact_number IS '收货人联系方式';
COMMENT ON COLUMN transaction_order.counterparty_order_id IS '对手单单号';
COMMENT ON COLUMN transaction_order.is_virtual IS '是否虚拟商品 1-是 0-否';
COMMENT ON COLUMN transaction_order.supplier_order_sn IS '三方供应商订单号';
COMMENT ON COLUMN transaction_order.expire_time IS '待支付超时时间';
COMMENT ON COLUMN transaction_order.create_user IS '创建人';
COMMENT ON COLUMN transaction_order.create_dept IS '创建部门';
COMMENT ON COLUMN transaction_order.create_time IS '创建时间';
COMMENT ON COLUMN transaction_order.update_user IS '修改人';
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 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';
COMMENT ON COLUMN user_inventory.user_id IS '用户Id';
COMMENT ON COLUMN user_inventory.sku_id IS 'skuId';
COMMENT ON COLUMN user_inventory.title IS '规格名称';
COMMENT ON COLUMN user_inventory.thumbnail IS '商品缩略图';
COMMENT ON COLUMN user_inventory.price IS '单价';
COMMENT ON COLUMN user_inventory.quantity IS '数量';
COMMENT ON COLUMN user_inventory.is_virtual IS '是否虚拟商品 1-是 0-否';
COMMENT ON COLUMN user_inventory.attribute IS '规格';
COMMENT ON COLUMN user_inventory.version IS '乐观锁版本号';
COMMENT ON COLUMN user_inventory.create_user IS '创建人';
COMMENT ON COLUMN user_inventory.create_dept IS '创建部门';
COMMENT ON COLUMN user_inventory.create_time IS '创建时间';
COMMENT ON COLUMN user_inventory.update_user IS '修改人';
COMMENT ON COLUMN user_inventory.update_time IS '修改时间';
COMMENT ON COLUMN user_inventory.status IS '状态';
COMMENT ON COLUMN user_inventory.is_deleted IS '是否已删除';
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 '主键';
COMMENT ON COLUMN calendar_non_working.off_date IS '休息日期';
COMMENT ON COLUMN calendar_non_working.remark IS '备忘';
COMMENT ON COLUMN calendar_non_working.create_user IS '创建人';
COMMENT ON COLUMN calendar_non_working.create_dept IS '创建部门';
COMMENT ON COLUMN calendar_non_working.create_time IS '创建时间';
COMMENT ON COLUMN calendar_non_working.update_user IS '修改人';
COMMENT ON COLUMN calendar_non_working.update_time IS '修改时间';
COMMENT ON COLUMN calendar_non_working.status IS '状态';
COMMENT ON COLUMN calendar_non_working.is_deleted IS '是否已删除';
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';
COMMENT ON COLUMN user_otc_info.user_id IS '用户ID';
COMMENT ON COLUMN user_otc_info.alipay_account IS '支付宝账号';
COMMENT ON COLUMN user_otc_info.wechat_account IS '微信账号';
COMMENT ON COLUMN user_otc_info.alipay_qr_code IS '支付宝收款码';
COMMENT ON COLUMN user_otc_info.wechat_qr_code IS '微信收款码';
COMMENT ON COLUMN user_otc_info.bank_account IS '银行账号';
COMMENT ON COLUMN user_otc_info.branch_info IS '银行信息';
COMMENT ON COLUMN user_otc_info.create_user IS '创建人';
COMMENT ON COLUMN user_otc_info.create_dept IS '创建部门';
COMMENT ON COLUMN user_otc_info.create_time IS '创建时间';
COMMENT ON COLUMN user_otc_info.update_user IS '修改人';
COMMENT ON COLUMN user_otc_info.update_time IS '修改时间';
COMMENT ON COLUMN user_otc_info.status IS '状态';
COMMENT ON COLUMN user_otc_info.is_deleted IS '是否已删除';

View File

@@ -0,0 +1,48 @@
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,
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 regions_info IS '地区详情表';
COMMENT ON COLUMN regions_info.id IS '主键';
COMMENT ON COLUMN regions_info.name IS '名称';
COMMENT ON COLUMN regions_info.level IS '层级';
COMMENT ON COLUMN regions_info.pid IS '父主键';
COMMENT ON COLUMN regions_info.lon IS '经度';
COMMENT ON COLUMN regions_info.lat IS '纬度';
COMMENT ON COLUMN regions_info.region_code IS '地区编码';
COMMENT ON COLUMN regions_info.full_name IS '全称';
COMMENT ON COLUMN regions_info.vendor_region_id IS '服务商地区表id';
COMMENT ON COLUMN regions_info.store_city_id IS '城市店铺id';
COMMENT ON COLUMN regions_info.hotel_city_code IS '酒店地区编码';
COMMENT ON COLUMN regions_info.hotel_city_pinyin IS '酒店地区拼音';
COMMENT ON COLUMN regions_info.hotel_city_initials IS '酒店地区拼音首字母';
COMMENT ON COLUMN regions_info.sight_city_name IS '景点城市名';
COMMENT ON COLUMN regions_info.is_deleted IS '是否删除';
COMMENT ON COLUMN regions_info.create_user IS '创建人';
COMMENT ON COLUMN regions_info.create_dept IS '创建部门';
COMMENT ON COLUMN regions_info.create_time IS '创建时间';
COMMENT ON COLUMN regions_info.update_user IS '修改人';
COMMENT ON COLUMN regions_info.update_time IS '修改时间';
COMMENT ON COLUMN regions_info.status IS '状态';

View File

@@ -0,0 +1,73 @@
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_complete INTEGER DEFAULT 0 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 '用户看广告记录表';
COMMENT ON COLUMN user_daily_sign.user_id IS '用户id';
COMMENT ON COLUMN user_daily_sign.user_phone IS '用户手机号';
COMMENT ON COLUMN user_daily_sign.user_name IS '用户名称';
COMMENT ON COLUMN user_daily_sign.statistics_date IS '统计日期';
COMMENT ON COLUMN user_daily_sign.sign_count IS '看广告统计';
COMMENT ON COLUMN user_daily_sign.type IS '广告类型 1-积分分产出';
COMMENT on column user_daily_sign.is_complete is '是否完成 0-未完成 1-完成';
COMMENT ON COLUMN user_daily_sign.remarks IS '备注';
comment on column user_daily_sign.create_user is '创建人';
comment on column user_daily_sign.create_dept is '创建部门';
comment on column user_daily_sign.create_time is '创建时间';
comment on column user_daily_sign.update_user is '修改人';
comment on column user_daily_sign.update_time is '修改时间';
comment on column user_daily_sign.status is '状态';
comment on column user_daily_sign.is_deleted is '是否已删除';
CREATE INDEX uds_date_index
ON user_daily_sign (is_deleted, type, statistics_date);
CREATE INDEX uds_complete_index
ON user_daily_sign (is_deleted, statistics_date ,type, is_complete);
CREATE INDEX uds_uid_index
ON user_daily_sign (is_deleted, type, user_id, statistics_date);
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 '广告表';
COMMENT ON COLUMN ads.name IS '视频名称';
COMMENT ON COLUMN ads.url IS '视频链接';
COMMENT ON COLUMN ads.sort IS '广告序号';
COMMENT ON COLUMN ads.type IS '广告类型 1-积分分产出';
COMMENT ON COLUMN ads.ads_time IS '视频观看时长';
COMMENT ON COLUMN ads.create_dept IS '创建部门';
COMMENT ON COLUMN ads.status IS '状态';

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,44 @@
-- 创建表
CREATE TABLE user_notice
(
id BIGINT NOT NULL PRIMARY KEY,
user_id BIGINT DEFAULT 0 NOT NULL,
notice_type INTEGER DEFAULT 0 NOT NULL,
has_read INTEGER DEFAULT 0 NOT NULL,
release_time TIMESTAMP NULL,
title VARCHAR(100) NULL,
content TEXT NULL,
remarks VARCHAR(200) NULL,
create_user BIGINT NULL,
create_dept BIGINT NULL,
create_time TIMESTAMP NULL,
update_user BIGINT NULL,
update_time TIMESTAMP NULL,
status INTEGER NULL,
is_deleted INTEGER DEFAULT 0 NULL
);
create index user_notice_user_index
on user_notice (is_deleted, user_id);
-- 添加表注释
COMMENT ON TABLE user_notice IS '用户通知';
-- 添加列注释
COMMENT ON COLUMN user_notice.id IS '主键';
COMMENT ON COLUMN user_notice.user_id IS '用户id';
COMMENT ON COLUMN user_notice.notice_type IS '通知类型0-系统通知';
COMMENT ON COLUMN user_notice.has_read IS '是否已读 0-否 1-是';
COMMENT ON COLUMN user_notice.release_time IS '阅读时间';
COMMENT ON COLUMN user_notice.title IS '标题';
COMMENT ON COLUMN user_notice.content IS '内容';
COMMENT ON COLUMN user_notice.remarks IS '备注';
COMMENT ON COLUMN user_notice.create_user IS '创建人';
COMMENT ON COLUMN user_notice.create_dept IS '创建部门';
COMMENT ON COLUMN user_notice.create_time IS '创建时间';
COMMENT ON COLUMN user_notice.update_user IS '修改人';
COMMENT ON COLUMN user_notice.update_time IS '修改时间';
COMMENT ON COLUMN user_notice.status IS '状态';
COMMENT ON COLUMN user_notice.is_deleted IS '是否已删除';

View File

@@ -0,0 +1,180 @@
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
);
create index up_index
on user_performance (is_deleted, user_id);
COMMENT ON TABLE user_performance IS '用户现金业绩表';
COMMENT ON COLUMN user_performance.id IS '主键';
COMMENT ON COLUMN user_performance.user_id IS '用户ID';
COMMENT ON COLUMN user_performance.user_phone IS '用户手机号';
COMMENT ON COLUMN user_performance.user_name IS '用户名称';
COMMENT ON COLUMN user_performance.performance IS '总业绩';
COMMENT ON COLUMN user_performance.own_performance IS '自身业绩';
COMMENT ON COLUMN user_performance.version IS '版本号';
comment on column user_performance.create_user is '创建人';
comment on column user_performance.create_dept is '创建部门';
comment on column user_performance.create_time is '创建时间';
comment on column user_performance.update_user is '修改人';
comment on column user_performance.update_time is '修改时间';
comment on column user_performance.status is '状态';
comment on column user_performance.is_deleted is '是否已删除';
alter table user_performance
owner to postgres;
create table user_performance_log
(
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
);
create index user_performance_log_index
on user_performance_log (is_deleted, user_id, statistical_date , type);
comment on table user_performance_log is '用户现金业绩日志表';
comment on column user_performance_log.id is '主键';
comment on column user_performance_log.user_id is '用户ID';
comment on column user_performance_log.user_phone is '用户手机号';
comment on column user_performance_log.user_name is '用户名称';
comment on column user_performance_log.amount is '业绩变动金额';
comment on column user_performance_log.source_id is '来源ID';
comment on column user_performance_log.source_detail is '来源详情';
comment on column user_performance_log.order_id is '订单ID';
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 '创建部门';
comment on column user_performance_log.create_time is '创建时间';
comment on column user_performance_log.update_user is '修改人';
comment on column user_performance_log.update_time is '修改时间';
comment on column user_performance_log.status is '状态';
comment on column user_performance_log.is_deleted is '是否已删除';
alter table user_performance_log
owner to postgres;
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
);
create index upb_index
on user_performance_benefit (is_deleted, user_id);
COMMENT ON TABLE user_performance_benefit IS '用户福利值业绩表';
COMMENT ON COLUMN user_performance_benefit.id IS '主键';
COMMENT ON COLUMN user_performance_benefit.user_id IS '用户ID';
COMMENT ON COLUMN user_performance_benefit.user_phone IS '用户手机号';
COMMENT ON COLUMN user_performance_benefit.user_name IS '用户名称';
COMMENT ON COLUMN user_performance_benefit.performance IS '总业绩';
COMMENT ON COLUMN user_performance_benefit.own_performance IS '自身业绩';
COMMENT ON COLUMN user_performance_benefit.version IS '版本号';
comment on column user_performance_benefit.create_user is '创建人';
comment on column user_performance_benefit.create_dept is '创建部门';
comment on column user_performance_benefit.create_time is '创建时间';
comment on column user_performance_benefit.update_user is '修改人';
comment on column user_performance_benefit.update_time is '修改时间';
comment on column user_performance_benefit.status is '状态';
comment on column user_performance_benefit.is_deleted is '是否已删除';
alter table user_performance_benefit
owner to postgres;
create table user_performance_benefit_log
(
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
);
create index upbl_index
on user_performance_benefit_log (is_deleted, user_id, statistical_date , type);
comment on table user_performance_benefit_log is '用户福利值业绩日志表';
comment on column user_performance_benefit_log.id is '主键';
comment on column user_performance_benefit_log.user_id is '用户ID';
comment on column user_performance_benefit_log.user_phone is '用户手机号';
comment on column user_performance_benefit_log.user_name is '用户名称';
comment on column user_performance_benefit_log.amount is '业绩变动金额';
comment on column user_performance_benefit_log.source_id is '来源ID';
comment on column user_performance_benefit_log.source_detail is '来源详情';
comment on column user_performance_benefit_log.order_id is '订单ID';
comment on column user_performance_benefit_log.type is '类型 1增加 2减少';
comment on column user_performance_benefit_log.statistical_date is '统计日期';
comment on column user_performance_benefit_log.channel is '渠道';
comment on column user_performance_benefit_log.channel_detail is '渠道详情';
comment on column user_performance_benefit_log.remark is '备注';
comment on column user_performance_benefit_log.create_user is '创建人';
comment on column user_performance_benefit_log.create_dept is '创建部门';
comment on column user_performance_benefit_log.create_time is '创建时间';
comment on column user_performance_benefit_log.update_user is '修改人';
comment on column user_performance_benefit_log.update_time is '修改时间';
comment on column user_performance_benefit_log.status is '状态';
comment on column user_performance_benefit_log.is_deleted is '是否已删除';
alter table user_performance_benefit_log
owner to postgres;

View File

@@ -0,0 +1,424 @@
create table user_benefit
(
id bigint not null primary key,
amount decimal(14, 2) 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
);
comment on table user_benefit is '用户福利值表';
comment on column user_benefit.id is '主键';
comment on column user_benefit.amount is '金额';
comment on column user_benefit.version is '版本号';
comment on column user_benefit.create_user is '创建人';
comment on column user_benefit.create_dept is '创建部门';
comment on column user_benefit.create_time is '创建时间';
comment on column user_benefit.update_user is '修改人';
comment on column user_benefit.update_time is '修改时间';
comment on column user_benefit.status is '状态';
comment on column user_benefit.is_deleted is '是否已删除';
alter table user_benefit
owner to postgres;
create table user_benefit_log
(
id bigint not null primary key,
user_id bigint,
user_phone bigint,
user_name varchar(128),
amount decimal(14, 2) 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
on user_benefit_log (is_deleted, user_id , statistical_date , type);
comment on table user_benefit_log is '用户福利值流水表';
comment on column user_benefit_log.id is '主键';
comment on column user_benefit_log.user_id is '用户id';
comment on column user_benefit_log.user_phone is '用户手机号';
comment on column user_benefit_log.user_name is '用户名称';
comment on column user_benefit_log.amount is '金额';
comment on column user_benefit_log.source_id is '来源id';
comment on column user_benefit_log.user_pack_id is '用户积分包id';
comment on column user_benefit_log.source_detail is '来源详情';
comment on column user_benefit_log.order_id is '订单id';
comment on column user_benefit_log.type is '消费类型 1-收入 2-支出';
comment on column user_benefit_log.statistical_date is '统计时间';
comment on column user_benefit_log.channel is '消费渠道';
comment on column user_benefit_log.channel_detail is '消费渠道详情';
comment on column user_benefit_log.remark is '备注';
comment on column user_benefit_log.create_user is '创建人';
comment on column user_benefit_log.create_dept is '创建部门';
comment on column user_benefit_log.create_time is '创建时间';
comment on column user_benefit_log.update_user is '修改人';
comment on column user_benefit_log.update_time is '修改时间';
comment on column user_benefit_log.status is '状态';
comment on column user_benefit_log.is_deleted is '是否已删除';
alter table user_benefit_log
owner to postgres;
create table user_commission
(
id bigint not null primary key,
amount decimal(14, 2) 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
);
comment on table user_commission is '用户佣金表';
comment on column user_commission.id is '主键';
comment on column user_commission.amount is '佣金金额';
comment on column user_commission.version is '版本号';
comment on column user_commission.create_user is '创建人';
comment on column user_commission.create_dept is '创建部门';
comment on column user_commission.create_time is '创建时间';
comment on column user_commission.update_user is '修改人';
comment on column user_commission.update_time is '修改时间';
comment on column user_commission.status is '状态';
comment on column user_commission.is_deleted is '是否已删除';
alter table user_commission
owner to postgres;
create table user_commission_log
(
id bigint not null primary key,
user_id bigint,
user_phone bigint,
user_name varchar(128),
amount decimal(14, 2) 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
on user_commission_log (is_deleted, user_id, statistical_date, type);
comment on table user_commission_log is '用户佣金流水表';
comment on column user_commission_log.id is '主键';
comment on column user_commission_log.user_id is '用户id';
comment on column user_commission_log.user_phone is '用户手机号';
comment on column user_commission_log.user_name is '用户名称';
comment on column user_commission_log.amount is '金额';
comment on column user_commission_log.source_id is '来源id';
comment on column user_commission_log.source_detail is '来源详情';
comment on column user_commission_log.order_id is '订单id';
comment on column user_commission_log.type is '消费类型 1-收入 2-支出';
comment on column user_commission_log.statistical_date is '统计时间';
comment on column user_commission_log.channel is '消费渠道';
comment on column user_commission_log.channel_detail is '消费渠道详情';
comment on column user_commission_log.remark is '备注';
comment on column user_commission_log.create_user is '创建人';
comment on column user_commission_log.create_dept is '创建部门';
comment on column user_commission_log.create_time is '创建时间';
comment on column user_commission_log.update_user is '修改人';
comment on column user_commission_log.update_time is '修改时间';
comment on column user_commission_log.status is '状态';
comment on column user_commission_log.is_deleted is '是否已删除';
alter table user_commission_log
owner to postgres;
create table user_cash
(
id bigint not null primary key,
amount decimal(14, 2) 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
);
comment on table user_cash is '用户现金券表';
comment on column user_cash.id is '主键';
comment on column user_cash.amount is '面额';
comment on column user_cash.version is '版本号';
comment on column user_cash.create_user is '创建人';
comment on column user_cash.create_dept is '创建部门';
comment on column user_cash.create_time is '创建时间';
comment on column user_cash.update_user is '修改人';
comment on column user_cash.update_time is '修改时间';
comment on column user_cash.status is '状态';
comment on column user_cash.is_deleted is '是否已删除';
alter table user_cash
owner to postgres;
create table user_cash_log
(
id bigint not null primary key,
user_id bigint,
user_phone bigint,
user_name varchar(128),
amount decimal(14, 2) 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_cash_log_index
on user_cash_log (is_deleted, user_id, statistical_date , type);
comment on table user_cash_log is '用户现金券流水表';
comment on column user_cash_log.id is '主键';
comment on column user_cash_log.user_id is '用户id';
comment on column user_cash_log.user_phone is '用户手机号';
comment on column user_cash_log.user_name is '用户名称';
comment on column user_cash_log.amount is '金额';
comment on column user_cash_log.source_id is '来源id';
comment on column user_cash_log.source_detail is '来源详情';
comment on column user_cash_log.order_id is '订单id';
comment on column user_cash_log.type is '消费类型 1-收入 2-支出';
comment on column user_cash_log.statistical_date is '统计时间';
comment on column user_cash_log.channel is '消费渠道';
comment on column user_cash_log.channel_detail is '消费渠道详情';
comment on column user_cash_log.remark is '备注';
comment on column user_cash_log.create_user is '创建人';
comment on column user_cash_log.create_dept is '创建部门';
comment on column user_cash_log.create_time is '创建时间';
comment on column user_cash_log.update_user is '修改人';
comment on column user_cash_log.update_time is '修改时间';
comment on column user_cash_log.status is '状态';
comment on column user_cash_log.is_deleted is '是否已删除';
alter table user_cash_log
owner to postgres;
create table user_mall_integral
(
id bigint not null primary key,
amount decimal(14, 2) 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
);
comment on table user_mall_integral is '用户商城积分表';
comment on column user_mall_integral.amount is '面额';
comment on column user_mall_integral.version is '版本号';
comment on column user_mall_integral.create_user is '创建人';
comment on column user_mall_integral.create_dept is '创建部门';
comment on column user_mall_integral.create_time is '创建时间';
comment on column user_mall_integral.update_user is '修改人';
comment on column user_mall_integral.update_time is '修改时间';
comment on column user_mall_integral.is_deleted is '是否已删除';
alter table user_mall_integral
owner to postgres;
create table user_mall_integral_log
(
id bigint not null primary key,
user_id bigint,
user_phone bigint,
user_name varchar(128),
amount decimal(14, 2) 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_mall_integral_log_index
on user_mall_integral_log (is_deleted, user_id, statistical_date , type);
comment on table user_mall_integral_log is '用户商城积分流水表';
comment on column user_mall_integral_log.id is '主键';
comment on column user_mall_integral_log.user_id is '用户id';
comment on column user_mall_integral_log.user_phone is '用户手机号';
comment on column user_mall_integral_log.user_name is '用户名称';
comment on column user_mall_integral_log.amount is '金额';
comment on column user_mall_integral_log.source_id is '来源id';
comment on column user_mall_integral_log.source_detail is '来源详情';
comment on column user_mall_integral_log.order_id is '订单id';
comment on column user_mall_integral_log.type is '消费类型 1-收入 2-支出';
comment on column user_mall_integral_log.statistical_date is '统计时间';
comment on column user_mall_integral_log.channel is '消费渠道';
comment on column user_mall_integral_log.channel_detail is '消费渠道详情';
comment on column user_mall_integral_log.remark is '备注';
comment on column user_mall_integral_log.create_user is '创建人';
comment on column user_mall_integral_log.create_dept is '创建部门';
comment on column user_mall_integral_log.create_time is '创建时间';
comment on column user_mall_integral_log.update_user is '修改人';
comment on column user_mall_integral_log.update_time is '修改时间';
comment on column user_mall_integral_log.status is '状态';
comment on column user_mall_integral_log.is_deleted is '是否已删除';
alter table user_mall_integral_log
owner to postgres;
create table user_gains_day
(
id bigint not null primary key,
statistical_date timestamp(6),
user_id bigint,
amount decimal(14, 2) 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
on user_gains_day (is_deleted, statistical_date , is_credited);
comment on table user_gains_day is '用户每日加速福利值汇总表';
comment on column user_gains_day.id is '主键';
comment on column user_gains_day.statistical_date is '统计时间';
comment on column user_gains_day.user_id is '用户id';
comment on column user_gains_day.amount is '金额';
comment on column user_gains_day.gains_details is '福利值汇总详情';
comment on column user_gains_day.is_credited is '是否已入账 0-未入账 1-已入账';
comment on column user_gains_day.version is '版本号';
comment on column user_gains_day.create_user is '创建人';
comment on column user_gains_day.create_dept is '创建部门';
comment on column user_gains_day.create_time is '创建时间';
comment on column user_gains_day.update_user is '修改人';
comment on column user_gains_day.update_time is '修改时间';
comment on column user_gains_day.status is '状态';
comment on column user_gains_day.is_deleted is '是否已删除';
alter table user_gains_day
owner to postgres;
create table user_gains_day_log
(
id bigint not null primary key,
user_id bigint,
user_phone bigint,
user_name varchar(128),
amount decimal(14, 2) 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
on user_gains_day_log (is_deleted, statistical_date , is_summary );
comment on table user_gains_day_log is '用户每日加速福利值流水表';
comment on column user_gains_day_log.id is '主键';
comment on column user_gains_day_log.user_id is '用户id';
comment on column user_gains_day_log.user_phone is '用户手机号';
comment on column user_gains_day_log.user_name is '用户名称';
comment on column user_gains_day_log.amount is '金额';
comment on column user_gains_day_log.source_id is '来源id';
comment on column user_gains_day_log.source_detail is '来源详情';
comment on column user_gains_day_log.gains_details is '加速福利详情';
comment on column user_gains_day_log.order_id is '订单id';
comment on column user_gains_day_log.statistical_date is '统计时间';
comment on column user_gains_day_log.is_summary is '是否汇总 0-否 1-是';
comment on column user_gains_day_log.remark is '备注';
comment on column user_gains_day_log.create_user is '创建人';
comment on column user_gains_day_log.create_dept is '创建部门';
comment on column user_gains_day_log.create_time is '创建时间';
comment on column user_gains_day_log.update_user is '修改人';
comment on column user_gains_day_log.update_time is '修改时间';
comment on column user_gains_day_log.status is '状态';
comment on column user_gains_day_log.is_deleted is '是否已删除';
alter table user_gains_day_log
owner to postgres;

View File

@@ -0,0 +1,322 @@
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 '服务商用户收益';
COMMENT ON COLUMN vendor_daily_activity.id IS '主键';
COMMENT ON COLUMN vendor_daily_activity.settle_date IS '结算日期';
COMMENT ON COLUMN vendor_daily_activity.region_id IS '地域id';
COMMENT ON COLUMN vendor_daily_activity.region_level IS '地域等级 1-省 2-市 3-区';
COMMENT ON COLUMN vendor_daily_activity.total_amount IS '用户总量';
COMMENT ON COLUMN vendor_daily_activity.activity_amount IS '活跃数量';
COMMENT ON COLUMN vendor_daily_activity.activity_value_amount IS '活跃值总数';
COMMENT ON COLUMN vendor_daily_activity.increase_activity_value_amount IS '活跃值增量';
COMMENT ON COLUMN vendor_daily_activity.create_user IS '创建人';
COMMENT ON COLUMN vendor_daily_activity.create_dept IS '创建部门';
COMMENT ON COLUMN vendor_daily_activity.create_time IS '创建时间';
COMMENT ON COLUMN vendor_daily_activity.update_user IS '修改人';
COMMENT ON COLUMN vendor_daily_activity.update_time IS '修改时间';
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
);
COMMENT ON TABLE vendor_daily_profit IS '服务商营收收益';
COMMENT ON COLUMN vendor_daily_profit.id IS '主键';
COMMENT ON COLUMN vendor_daily_profit.settle_date IS '结算日期';
COMMENT ON COLUMN vendor_daily_profit.region_id IS '地域id';
COMMENT ON COLUMN vendor_daily_profit.region_level IS '地域等级 1-省 2-市 3-区';
COMMENT ON COLUMN vendor_daily_profit.profit_type IS '收益类型: 1.线上商城 2.线下点餐';
COMMENT ON COLUMN vendor_daily_profit.order_type IS '订单类型 1-商城订单 8-活动订单 9-店铺订单 10-旅行订单 11-门票订单 12-酒店订单';
COMMENT ON COLUMN vendor_daily_profit.total_amount IS '总金额';
COMMENT ON COLUMN vendor_daily_profit.profit_amount IS '总利润';
COMMENT ON COLUMN vendor_daily_profit.quantity IS '总单数';
COMMENT ON COLUMN vendor_daily_profit.create_user IS '创建人';
COMMENT ON COLUMN vendor_daily_profit.create_dept IS '创建部门';
COMMENT ON COLUMN vendor_daily_profit.create_time IS '创建时间';
COMMENT ON COLUMN vendor_daily_profit.update_user IS '修改人';
COMMENT ON COLUMN vendor_daily_profit.update_time IS '修改时间';
COMMENT ON COLUMN vendor_daily_profit.status IS '状态';
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
);
COMMENT ON TABLE vendor_info IS '服务商';
COMMENT ON COLUMN vendor_info.id IS '主键';
COMMENT ON COLUMN vendor_info.region_id IS '区域id';
COMMENT ON COLUMN vendor_info.user_id IS '用户id';
COMMENT ON COLUMN vendor_info.company_name IS '企业名称';
COMMENT ON COLUMN vendor_info.legal_person_name IS '法人';
COMMENT ON COLUMN vendor_info.id_card IS '身份证';
COMMENT ON COLUMN vendor_info.contact_no IS '联系电话';
COMMENT ON COLUMN vendor_info.id_card_front IS '身份证正面';
COMMENT ON COLUMN vendor_info.id_card_back IS '身份证反面';
COMMENT ON COLUMN vendor_info.id_card_handheld IS '手持身份证照片';
COMMENT ON COLUMN vendor_info.business_license IS '营业执照';
COMMENT ON COLUMN vendor_info.audit_status IS '审核状态 1-待审核 2-审核通过 3-审核失败';
COMMENT ON COLUMN vendor_info.auditor IS '审核人';
COMMENT ON COLUMN vendor_info.reject_reason IS '拒绝原因';
COMMENT ON COLUMN vendor_info.create_user IS '创建人';
COMMENT ON COLUMN vendor_info.create_dept IS '创建部门';
COMMENT ON COLUMN vendor_info.create_time IS '创建时间';
COMMENT ON COLUMN vendor_info.update_user IS '修改人';
COMMENT ON COLUMN vendor_info.update_time IS '修改时间';
COMMENT ON COLUMN vendor_info.status IS '状态';
COMMENT ON COLUMN vendor_info.is_deleted IS '是否已删除';
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
);
COMMENT ON TABLE vendor_payout_apply IS '服务商提现申请';
COMMENT ON COLUMN vendor_payout_apply.id IS '主键';
COMMENT ON COLUMN vendor_payout_apply.user_id IS '用户主键';
COMMENT ON COLUMN vendor_payout_apply.apply_amount IS '申请提现金额';
COMMENT ON COLUMN vendor_payout_apply.company_fully_name IS '公司全称';
COMMENT ON COLUMN vendor_payout_apply.bank_account IS '银行账号';
COMMENT ON COLUMN vendor_payout_apply.branch_info IS '开户行信息';
COMMENT ON COLUMN vendor_payout_apply.transfer_description IS '转账内容描述';
COMMENT ON COLUMN vendor_payout_apply.invoice_url IS '发票截图地址';
COMMENT ON COLUMN vendor_payout_apply.invoice_number IS '发票号';
COMMENT ON COLUMN vendor_payout_apply.transfer_voucher IS '转账凭证';
COMMENT ON COLUMN vendor_payout_apply.apply_status IS '申请提现状态 1:待审核 2:审核通过 3:审核不通过';
COMMENT ON COLUMN vendor_payout_apply.remark IS '备注';
COMMENT ON COLUMN vendor_payout_apply.create_user IS '创建人';
COMMENT ON COLUMN vendor_payout_apply.create_dept IS '创建部门';
COMMENT ON COLUMN vendor_payout_apply.create_time IS '创建时间';
COMMENT ON COLUMN vendor_payout_apply.update_user IS '修改人';
COMMENT ON COLUMN vendor_payout_apply.update_time IS '修改时间';
COMMENT ON COLUMN vendor_payout_apply.status IS '状态';
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
);
COMMENT ON TABLE vendor_profit_detail IS '服务商分润详情';
COMMENT ON COLUMN vendor_profit_detail.id IS '主键';
COMMENT ON COLUMN vendor_profit_detail.order_id IS '订单主键';
COMMENT ON COLUMN vendor_profit_detail.user_id IS '用户主键';
COMMENT ON COLUMN vendor_profit_detail.district_id IS '区主键';
COMMENT ON COLUMN vendor_profit_detail.city_id IS '市主键';
COMMENT ON COLUMN vendor_profit_detail.province_id IS '省主键';
COMMENT ON COLUMN vendor_profit_detail.order_type IS '订单类型';
COMMENT ON COLUMN vendor_profit_detail.payment_type IS '支付类型';
COMMENT ON COLUMN vendor_profit_detail.actual_amount IS '实际支付金额';
COMMENT ON COLUMN vendor_profit_detail.cost_amount IS '成本金额';
COMMENT ON COLUMN vendor_profit_detail.profit_amount IS '利润金额';
COMMENT ON COLUMN vendor_profit_detail.order_settle_date IS '订单结算日期';
COMMENT ON COLUMN vendor_profit_detail.create_user IS '创建人';
COMMENT ON COLUMN vendor_profit_detail.create_dept IS '创建部门';
COMMENT ON COLUMN vendor_profit_detail.create_time IS '创建时间';
COMMENT ON COLUMN vendor_profit_detail.update_user IS '修改人';
COMMENT ON COLUMN vendor_profit_detail.update_time IS '修改时间';
COMMENT ON COLUMN vendor_profit_detail.status IS '状态';
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,
lon DECIMAL(10, 6) NULL,
lat DECIMAL(10, 6) 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
);
COMMENT ON TABLE vendor_regions IS '服务商地区';
COMMENT ON COLUMN vendor_regions.id IS '主键';
COMMENT ON COLUMN vendor_regions.name IS '名称';
COMMENT ON COLUMN vendor_regions.level IS '层级';
COMMENT ON COLUMN vendor_regions.pid IS '父主键';
COMMENT ON COLUMN vendor_regions.lon IS '经度';
COMMENT ON COLUMN vendor_regions.lat IS '纬度';
COMMENT ON COLUMN vendor_regions.vendor_id IS '服务商id';
COMMENT ON COLUMN vendor_regions.token_amount IS '消费金数量';
COMMENT ON COLUMN vendor_regions.points_amount IS '抵扣券数量';
COMMENT ON COLUMN vendor_regions.apply_amount IS '申请金额';
COMMENT ON COLUMN vendor_regions.apply_status IS '1-未申请 2-申请中 3-已申请';
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
);
COMMENT ON TABLE vendor_virtual_data_activity IS '服务商活跃度虚拟增益';
COMMENT ON COLUMN vendor_virtual_data_activity.id IS '主键';
COMMENT ON COLUMN vendor_virtual_data_activity.region_id IS '地区id';
COMMENT ON COLUMN vendor_virtual_data_activity.user_amount IS '用户数量';
COMMENT ON COLUMN vendor_virtual_data_activity.active_user_amount IS '活跃用户数量';
COMMENT ON COLUMN vendor_virtual_data_activity.order_amount IS '订单总额';
COMMENT ON COLUMN vendor_virtual_data_activity.order_quantity IS '订单量';
COMMENT ON COLUMN vendor_virtual_data_activity.activity_value IS '活跃值';
COMMENT ON COLUMN vendor_virtual_data_activity.increase_activity_value IS '新增活跃值';
COMMENT ON COLUMN vendor_virtual_data_activity.create_user IS '创建人';
COMMENT ON COLUMN vendor_virtual_data_activity.create_dept IS '创建部门';
COMMENT ON COLUMN vendor_virtual_data_activity.create_time IS '创建时间';
COMMENT ON COLUMN vendor_virtual_data_activity.update_user IS '修改人';
COMMENT ON COLUMN vendor_virtual_data_activity.update_time IS '修改时间';
COMMENT ON COLUMN vendor_virtual_data_activity.status IS '状态';
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,
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
);
COMMENT ON TABLE vendor_virtual_data_profit IS '服务商营收虚拟增益';
COMMENT ON COLUMN vendor_virtual_data_profit.id IS '主键';
COMMENT ON COLUMN vendor_virtual_data_profit.region_id IS '地区id';
COMMENT ON COLUMN vendor_virtual_data_profit.settle_date IS '日期';
COMMENT ON COLUMN vendor_virtual_data_profit.online_amount IS '线上收益';
COMMENT ON COLUMN vendor_virtual_data_profit.offline_amount IS '线下收益';
COMMENT ON COLUMN vendor_virtual_data_profit.activity_amount IS '活跃值收益';
COMMENT ON COLUMN vendor_virtual_data_profit.create_user IS '创建人';
COMMENT ON COLUMN vendor_virtual_data_profit.create_dept IS '创建部门';
COMMENT ON COLUMN vendor_virtual_data_profit.create_time IS '创建时间';
COMMENT ON COLUMN vendor_virtual_data_profit.update_user IS '修改人';
COMMENT ON COLUMN vendor_virtual_data_profit.update_time IS '修改时间';
COMMENT ON COLUMN vendor_virtual_data_profit.status IS '状态';
COMMENT ON COLUMN vendor_virtual_data_profit.is_deleted IS '是否已删除';

View File

@@ -0,0 +1,79 @@
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 '奖池商品';
COMMENT ON COLUMN prize_spu.id IS '主键';
COMMENT ON COLUMN prize_spu.spu_name IS '商品名称';
COMMENT ON COLUMN prize_spu.main_img IS '主图';
COMMENT ON COLUMN prize_spu.detail_img IS '详情图(多图,逗号分割)';
COMMENT ON COLUMN prize_spu.cost_price IS '成本价';
COMMENT ON COLUMN prize_spu.original_price IS '原价';
COMMENT ON COLUMN prize_spu.spu_qty IS '库存';
COMMENT ON COLUMN prize_spu.status IS '状态(0=下架,1=上架,3=删除)';
COMMENT ON COLUMN prize_spu.create_user IS '创建人';
COMMENT ON COLUMN prize_spu.create_dept IS '创建部门';
COMMENT ON COLUMN prize_spu.create_time IS '创建时间';
COMMENT ON COLUMN prize_spu.update_user IS '修改人';
COMMENT ON COLUMN prize_spu.update_time IS '修改时间';
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,
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
);
create index prize_spu_order_index on prize_spu_order (user_id);
COMMENT ON TABLE prize_spu_order IS '奖池商品订单';
comment on column prize_spu_order.id is '主键';
comment on column prize_spu_order.user_id is '用户ID';
comment on column prize_spu_order.user_name is '用户名称';
comment on column prize_spu_order.user_phone is '用户手机号';
comment on column prize_spu_order.spu_id is '商品ID';
comment on column prize_spu_order.spu_name is '商品名称';
comment on column prize_spu_order.main_img is '商品主图';
comment on column prize_spu_order.detail_img is '商品详情图(多图,逗号分割)';
comment on column prize_spu_order.quantity is '商品数量';
comment on column prize_spu_order.order_status is '订单状态(0=待发货,1=已发货,2=已完成,3=已取消)';
comment on column prize_spu_order.version is '版本号';
comment on column prize_spu_order.create_user is '创建人';
comment on column prize_spu_order.create_dept is '创建部门';
comment on column prize_spu_order.create_time is '创建时间';
comment on column prize_spu_order.update_user is '修改人';
comment on column prize_spu_order.update_time is '修改时间';
comment on column prize_spu_order.status is '状态(-1=无效,0=有效)';
comment on column prize_spu_order.is_deleted is '是否已删除';