整理执行sql文件
This commit is contained in:
5
doc/sql/executed/blade_menu_userAddress.sql
Normal file
5
doc/sql/executed/blade_menu_userAddress.sql
Normal file
@@ -0,0 +1,5 @@
|
||||
--INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, component, remark, is_deleted) VALUES (2019341062694285314, 2019338015981219841, 'userAddress', '用户收货地址', 'menu', '/common/commonUserAddress', null, 1, 1, 0, 1, null, null, 0);
|
||||
--INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, component, remark, is_deleted) VALUES (2019341062694285315, 2019341062694285314, 'userAddress_add', '新增', 'add', '/common/commonUserAddress/add', 'plus', 1, 2, 1, 1, null, null, 0);
|
||||
--INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, component, remark, is_deleted) VALUES (2019341062694285316, 2019341062694285314, 'userAddress_edit', '修改', 'edit', '/common/commonUserAddress/edit', 'form', 2, 2, 2, 1, null, null, 0);
|
||||
--INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, component, remark, is_deleted) VALUES (2019341062694285317, 2019341062694285314, 'userAddress_delete', '删除', 'delete', '/common/address/remove', 'delete', 3, 2, 3, 1, null, null, 0);
|
||||
--INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, component, remark, is_deleted) VALUES (2019341062694285318, 2019341062694285314, 'userAddress_view', '查看', 'view', '/common/commonUserAddress/view', 'file-text', 4, 2, 2, 1, null, null, 0);
|
||||
5
doc/sql/executed/blade_menu_userNotice.sql
Normal file
5
doc/sql/executed/blade_menu_userNotice.sql
Normal file
@@ -0,0 +1,5 @@
|
||||
--INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, component, remark, is_deleted) VALUES (2020763647899787265, 2019338015981219841, 'userNotice', '用户通知', 'menu', '/common/commonUserNotice', 'iconfont iconicon_voipphone', 1, 1, 0, 1, '', '', 0);
|
||||
--INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, component, remark, is_deleted) VALUES (2020763647899787266, 2020763647899787265, 'userNotice_add', '新增', 'add', '/common/commonUserNotice/add', 'plus', 1, 2, 1, 1, null, null, 0);
|
||||
--INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, component, remark, is_deleted) VALUES (2020763647899787267, 2020763647899787265, 'userNotice_edit', '修改', 'edit', '/common/commonUserNotice/edit', 'form', 2, 2, 2, 1, null, null, 0);
|
||||
--INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, component, remark, is_deleted) VALUES (2020763647899787268, 2020763647899787265, 'userNotice_delete', '删除', 'delete', '/common/notice/remove', 'delete', 3, 2, 3, 1, null, null, 0);
|
||||
--INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, component, remark, is_deleted) VALUES (2020763647899787269, 2020763647899787265, 'userNotice_view', '查看', 'view', '/common/commonUserNotice/view', 'file-text', 4, 2, 2, 1, null, null, 0);
|
||||
@@ -1,3 +1,745 @@
|
||||
--- 福利积分 benefit_point
|
||||
DROP TABLE IF EXISTS benefit_point;
|
||||
create table benefit_point
|
||||
(
|
||||
id int8 not null primary key,
|
||||
amount decimal(14, 2) default 0,
|
||||
version int4 default 1,
|
||||
create_user int8,
|
||||
create_dept int8,
|
||||
create_time timestamp(6),
|
||||
update_user int8,
|
||||
update_time timestamp(6),
|
||||
status int4 default 1,
|
||||
is_deleted int4 default 0
|
||||
);
|
||||
|
||||
|
||||
comment on table benefit_point is '用户福利值表';
|
||||
comment on column benefit_point.id is '主键(用户id)';
|
||||
comment on column benefit_point.amount is '金额';
|
||||
comment on column benefit_point.version is '版本号';
|
||||
comment on column benefit_point.create_user is '创建人';
|
||||
comment on column benefit_point.create_dept is '创建部门';
|
||||
comment on column benefit_point.create_time is '创建时间';
|
||||
comment on column benefit_point.update_user is '修改人';
|
||||
comment on column benefit_point.update_time is '修改时间';
|
||||
comment on column benefit_point.status is '状态';
|
||||
comment on column benefit_point.is_deleted is '是否已删除';
|
||||
|
||||
alter table benefit_point
|
||||
owner to yicha1lu;
|
||||
|
||||
DROP TABLE IF EXISTS benefit_point_log;
|
||||
create table benefit_point_log
|
||||
(
|
||||
id int8 not null primary key,
|
||||
user_id int8,
|
||||
amount decimal(14, 2) default 0,
|
||||
last_amount decimal(14, 2) default 0, -- 上一笔金额
|
||||
fee decimal(14, 2) default 0,
|
||||
source_type int4, -- 来源类型 0-福利包产出 1-福利包兑换 2-用户直推 3-otc交易
|
||||
source_id int8,
|
||||
source_detail text,
|
||||
type int4 default 1,
|
||||
is_complete int4 default 0, -- 0-未完成 1-已完成
|
||||
statistical_date timestamp(6),
|
||||
remark text,
|
||||
create_user int8,
|
||||
create_dept int8,
|
||||
create_time timestamp(6),
|
||||
update_user int8,
|
||||
update_time timestamp(6),
|
||||
status int4 default 1,
|
||||
is_deleted int4 default 0
|
||||
);
|
||||
create index idx_umbl_uid
|
||||
on benefit_point_log (is_complete, user_id, type, statistical_date, create_time DESC);
|
||||
|
||||
comment on table benefit_point_log is '用户福利值流水表';
|
||||
comment on column benefit_point_log.id is '主键';
|
||||
comment on column benefit_point_log.user_id is '用户id';
|
||||
comment on column benefit_point_log.amount is '金额';
|
||||
comment on column benefit_point_log.last_amount is '上一笔金额';
|
||||
comment on column benefit_point_log.fee is '手续费';
|
||||
comment on column benefit_point_log.source_type is '来源类型 0-福利包产出 1-福利包兑换 2-用户直推 3-otc交易';
|
||||
comment on column benefit_point_log.source_id is '来源id';
|
||||
comment on column benefit_point_log.source_detail is '来源详情';
|
||||
comment on column benefit_point_log.type is '消费类型 1-收入 2-支出';
|
||||
comment on column benefit_point_log.is_complete is '是否完成 0-未完成 1-已完成';
|
||||
comment on column benefit_point_log.statistical_date is '统计时间';
|
||||
comment on column benefit_point_log.remark is '备注';
|
||||
comment on column benefit_point_log.create_user is '创建人';
|
||||
comment on column benefit_point_log.create_dept is '创建部门';
|
||||
comment on column benefit_point_log.create_time is '创建时间';
|
||||
comment on column benefit_point_log.update_user is '修改人';
|
||||
comment on column benefit_point_log.update_time is '修改时间';
|
||||
comment on column benefit_point_log.status is '状态';
|
||||
comment on column benefit_point_log.is_deleted is '是否已删除';
|
||||
alter table benefit_point_log
|
||||
owner to yicha1lu;
|
||||
|
||||
|
||||
--- 现金券 cash_coupon
|
||||
DROP TABLE IF EXISTS cash_coupon;
|
||||
create table cash_coupon
|
||||
(
|
||||
id int8 not null primary key,
|
||||
amount decimal(14, 2) default 0,
|
||||
version int4 default 1,
|
||||
create_user int8,
|
||||
create_dept int8,
|
||||
create_time timestamp(6),
|
||||
update_user int8,
|
||||
update_time timestamp(6),
|
||||
status int4 default 1,
|
||||
is_deleted int4 default 0
|
||||
);
|
||||
|
||||
|
||||
comment on table cash_coupon is '用户现金券表';
|
||||
comment on column cash_coupon.id is '主键(用户id)';
|
||||
comment on column cash_coupon.amount is '面额';
|
||||
comment on column cash_coupon.version is '版本号';
|
||||
comment on column cash_coupon.create_user is '创建人';
|
||||
comment on column cash_coupon.create_dept is '创建部门';
|
||||
comment on column cash_coupon.create_time is '创建时间';
|
||||
comment on column cash_coupon.update_user is '修改人';
|
||||
comment on column cash_coupon.update_time is '修改时间';
|
||||
comment on column cash_coupon.status is '状态';
|
||||
comment on column cash_coupon.is_deleted is '是否已删除';
|
||||
|
||||
alter table cash_coupon
|
||||
owner to yicha1lu;
|
||||
|
||||
DROP TABLE IF EXISTS cash_coupon_log;
|
||||
create table cash_coupon_log
|
||||
(
|
||||
id int8 not null primary key,
|
||||
user_id int8,
|
||||
amount decimal(14, 2) default 0,
|
||||
last_amount decimal(14, 2) default 0, -- 上一笔金额
|
||||
source_type int4, -- 来源类型 0-商城抽奖 1-福利包兑换
|
||||
source_id int8,
|
||||
source_detail text,
|
||||
type int4 default 1,
|
||||
is_complete int4 default 0, -- 0-未完成 1-已完成
|
||||
statistical_date timestamp(6),
|
||||
remark text,
|
||||
create_user int8,
|
||||
create_dept int8,
|
||||
create_time timestamp(6),
|
||||
update_user int8,
|
||||
update_time timestamp(6),
|
||||
status int4 default 1,
|
||||
is_deleted int4 default 0
|
||||
);
|
||||
|
||||
create index idx_umcl_uid
|
||||
on cash_coupon_log (is_complete, user_id, type, statistical_date, create_time DESC);
|
||||
|
||||
comment on table cash_coupon_log is '用户现金券流水表';
|
||||
comment on column cash_coupon_log.id is '主键';
|
||||
comment on column cash_coupon_log.user_id is '用户id';
|
||||
comment on column cash_coupon_log.amount is '金额';
|
||||
comment on column cash_coupon_log.last_amount is '上一笔金额';
|
||||
comment on column cash_coupon_log.source_type is '来源类型 0-商城抽奖 1-福利包兑换';
|
||||
comment on column cash_coupon_log.source_id is '来源id';
|
||||
comment on column cash_coupon_log.source_detail is '来源详情';
|
||||
comment on column cash_coupon_log.type is '消费类型 1-收入 2-支出';
|
||||
comment on column cash_coupon_log.statistical_date is '统计时间';
|
||||
comment on column cash_coupon_log.is_complete is '是否完成 0-未完成 1-已完成';
|
||||
comment on column cash_coupon_log.remark is '备注';
|
||||
comment on column cash_coupon_log.create_user is '创建人';
|
||||
comment on column cash_coupon_log.create_dept is '创建部门';
|
||||
comment on column cash_coupon_log.create_time is '创建时间';
|
||||
comment on column cash_coupon_log.update_user is '修改人';
|
||||
comment on column cash_coupon_log.update_time is '修改时间';
|
||||
comment on column cash_coupon_log.status is '状态';
|
||||
comment on column cash_coupon_log.is_deleted is '是否已删除';
|
||||
|
||||
alter table cash_coupon_log
|
||||
owner to yicha1lu;
|
||||
|
||||
|
||||
--- 用户积分 user_point
|
||||
DROP TABLE IF EXISTS user_point;
|
||||
create table user_point
|
||||
(
|
||||
id int8 not null primary key,
|
||||
amount decimal(14, 2) default 0,
|
||||
version int4 default 1,
|
||||
create_user int8,
|
||||
create_dept int8,
|
||||
create_time timestamp(6),
|
||||
update_user int8,
|
||||
update_time timestamp(6),
|
||||
status int4 default 1,
|
||||
is_deleted int4 default 0
|
||||
);
|
||||
|
||||
|
||||
comment on table user_point is '用户商城积分表';
|
||||
comment on column user_point.id is '主键(用户id)';
|
||||
comment on column user_point.amount is '面额';
|
||||
comment on column user_point.version is '版本号';
|
||||
comment on column user_point.create_user is '创建人';
|
||||
comment on column user_point.create_dept is '创建部门';
|
||||
comment on column user_point.create_time is '创建时间';
|
||||
comment on column user_point.update_user is '修改人';
|
||||
comment on column user_point.update_time is '修改时间';
|
||||
comment on column user_point.is_deleted is '是否已删除';
|
||||
|
||||
alter table user_point
|
||||
owner to yicha1lu;
|
||||
|
||||
DROP TABLE IF EXISTS user_point_log;
|
||||
create table user_point_log
|
||||
(
|
||||
id int8 not null primary key,
|
||||
user_id int8,
|
||||
amount decimal(14, 2) default 0,
|
||||
last_amount decimal(14, 2) default 0, -- 上一笔金额
|
||||
source_type int4, -- 来源类型 0-商城订单 1-商城抽奖
|
||||
source_id int8,
|
||||
source_detail text,
|
||||
type int4 default 1,
|
||||
is_complete int4 default 0, -- 0-未完成 1-已完成
|
||||
statistical_date timestamp(6),
|
||||
remark text,
|
||||
create_user int8,
|
||||
create_dept int8,
|
||||
create_time timestamp(6),
|
||||
update_user int8,
|
||||
update_time timestamp(6),
|
||||
status int4 default 1,
|
||||
is_deleted int4 default 0
|
||||
);
|
||||
|
||||
create index idx_uapl_uid
|
||||
on user_point_log (is_complete, user_id, type, statistical_date, create_time DESC);
|
||||
|
||||
comment on table user_point_log is '用户商城积分流水表';
|
||||
comment on column user_point_log.id is '主键';
|
||||
comment on column user_point_log.user_id is '用户id';
|
||||
comment on column user_point_log.amount is '金额';
|
||||
comment on column user_point_log.last_amount is '上一笔金额';
|
||||
comment on column user_point_log.source_type is '0-商城订单 1-商城抽奖';
|
||||
comment on column user_point_log.source_id is '来源id';
|
||||
comment on column user_point_log.source_detail is '来源详情';
|
||||
comment on column user_point_log.type is '消费类型 1-收入 2-支出';
|
||||
comment on column user_point_log.statistical_date is '统计时间';
|
||||
comment on column user_point_log.is_complete is '是否完成 0-未完成 1-已完成';
|
||||
comment on column user_point_log.remark is '备注';
|
||||
comment on column user_point_log.create_user is '创建人';
|
||||
comment on column user_point_log.create_dept is '创建部门';
|
||||
comment on column user_point_log.create_time is '创建时间';
|
||||
comment on column user_point_log.update_user is '修改人';
|
||||
comment on column user_point_log.update_time is '修改时间';
|
||||
comment on column user_point_log.status is '状态';
|
||||
comment on column user_point_log.is_deleted is '是否已删除';
|
||||
|
||||
alter table user_point_log
|
||||
owner to yicha1lu;
|
||||
|
||||
|
||||
|
||||
|
||||
-- 佣金账户表
|
||||
DROP TABLE IF EXISTS market_commission_account;
|
||||
create table market_commission_account
|
||||
(
|
||||
id int8 not null primary key,
|
||||
account_name varchar(128), -- 账户名称
|
||||
account_code varchar(64), -- 账户代码
|
||||
account_type int4, -- 账户类型 0-商品成本 1-购买人获取用户积分 2-直推人佣金 3-运营佣金 4-广告补贴 5-服务商佣金 6-极差代理佣金 7-联创佣金
|
||||
amount decimal(14, 2) default 0, -- 账户总余额
|
||||
version int4 default 1,
|
||||
remark varchar(200),
|
||||
create_user int8,
|
||||
create_dept int8,
|
||||
create_time timestamp(6),
|
||||
update_user int8,
|
||||
update_time timestamp(6),
|
||||
status int4 default 1,
|
||||
is_deleted int4 default 0
|
||||
);
|
||||
|
||||
create index idx_mca_code
|
||||
on market_commission_account (account_code);
|
||||
create index idx_mca_type
|
||||
on market_commission_account (account_type);
|
||||
|
||||
comment on table market_commission_account is '用户佣金账户表';
|
||||
comment on column market_commission_account.id is '主键';
|
||||
comment on column market_commission_account.account_name is '账户名称';
|
||||
comment on column market_commission_account.account_code is '账户代码';
|
||||
comment on column market_commission_account.account_type is '账户类型 0-商品成本 1-购买人获取用户积分 2-直推人佣金 3-运营佣金 4-广告补贴 5-服务商佣金 6-极差代理佣金 7-联创佣金';
|
||||
comment on column market_commission_account.amount is '账户总余额';
|
||||
comment on column market_commission_account.version is '版本号';
|
||||
comment on column market_commission_account.remark is '备注';
|
||||
comment on column market_commission_account.create_user is '创建人';
|
||||
comment on column market_commission_account.create_dept is '创建部门';
|
||||
comment on column market_commission_account.create_time is '创建时间';
|
||||
comment on column market_commission_account.update_user is '修改人';
|
||||
comment on column market_commission_account.update_time is '修改时间';
|
||||
comment on column market_commission_account.status is '状态';
|
||||
comment on column market_commission_account.is_deleted is '是否已删除';
|
||||
|
||||
alter table market_commission_account
|
||||
owner to yicha1lu;
|
||||
---------------------------------------insert start
|
||||
INSERT INTO market_commission_account ("id", "account_name", "account_code", "account_type" , "amount", "version", "remark" , "create_user", "create_dept", "create_time", "update_user", "update_time", "status", "is_deleted") VALUES (2017485441885196290, '商品成本账户', 'COMMISSION_GOODS_COST', '0','0.0000', 1, '商品成本账户',1123598821738675201, 1123598813738675201, '2026-01-31 14:29:47', 1123598821738675201, '2026-01-31 14:30:16.04', 1, 0);
|
||||
INSERT INTO market_commission_account ("id", "account_name", "account_code", "account_type" , "amount", "version", "remark" , "create_user", "create_dept", "create_time", "update_user", "update_time", "status", "is_deleted") VALUES (2017485893100032002, '分发商城积分账户', 'COMMISSION_USER_POINT_LOG', '1', '0.0000', 1, '分发商城积分账户',1123598821738675201, 1123598813738675201, '2026-01-31 14:31:34.663', 1123598821738675201, '2026-01-31 14:31:34.663', 1, 0);
|
||||
INSERT INTO market_commission_account ("id", "account_name", "account_code", "account_type" , "amount", "version", "remark" , "create_user", "create_dept", "create_time", "update_user", "update_time", "status", "is_deleted") VALUES (2017486037128237058, '分发直推人佣金账户', 'COMMISSION_DIRECT_PUSH', '2', '0.0000', 1,'分发直推人佣金账户',1123598821738675201, 1123598813738675201, '2026-01-31 14:32:08.998', 1123598821738675201, '2026-01-31 14:32:08.998', 1, 0);
|
||||
INSERT INTO market_commission_account ("id", "account_name", "account_code", "account_type" , "amount", "version", "remark" , "create_user", "create_dept", "create_time", "update_user", "update_time", "status", "is_deleted") VALUES (2017486179294171138, '运营账户', 'COMMISSION_OPERATION', '3','0.0000', 1, '运营账户',1123598821738675201, 1123598813738675201, '2026-01-31 14:32:42.889', 1123598821738675201, '2026-01-31 14:32:42.889', 1, 0);
|
||||
INSERT INTO market_commission_account ("id", "account_name", "account_code", "account_type" , "amount", "version", "remark" , "create_user", "create_dept", "create_time", "update_user", "update_time", "status", "is_deleted") VALUES (2017486299502923778, '分发广告补贴账户', 'COMMISSION_ADVERTISING', '4','0.0000', 1, '分发广告补贴账户',1123598821738675201, 1123598813738675201, '2026-01-31 14:33:11.552', 1123598821738675201, '2026-01-31 14:33:11.552', 1, 0);
|
||||
INSERT INTO market_commission_account ("id", "account_name", "account_code", "account_type" , "amount", "version", "remark" , "create_user", "create_dept", "create_time", "update_user", "update_time", "status", "is_deleted") VALUES (2017486437340336130, '分发服务商佣金账户', 'COMMISSION_SERVICE_PROVIDER','5', '0.0000', 1, '分发服务商佣金账户',1123598821738675201, 1123598813738675201, '2026-01-31 14:33:44.407', 1123598821738675201, '2026-01-31 14:33:44.407', 1, 0);
|
||||
INSERT INTO market_commission_account ("id", "account_name", "account_code", "account_type" , "amount", "version", "remark" , "create_user", "create_dept", "create_time", "update_user", "update_time", "status", "is_deleted") VALUES (2017486568441696258, '分发极差代理佣金账户', 'COMMISSION_AGENCY', '6','0.0000', 1, '分发极差代理佣金账户',1123598821738675201, 1123598813738675201, '2026-01-31 14:34:15.663', 1123598821738675201, '2026-01-31 14:34:15.663', 1, 0);
|
||||
INSERT INTO market_commission_account ("id", "account_name", "account_code", "account_type" , "amount", "version", "remark" , "create_user", "create_dept", "create_time", "update_user", "update_time", "status", "is_deleted") VALUES (2017486664117964802, '联创佣金账户', 'COMMISSION_CO_CREATOR', '7','0.0000', 1, '联创佣金账户',1123598821738675201, 1123598813738675201, '2026-01-31 14:34:38.479', 1123598821738675201, '2026-01-31 14:34:38.479', 1, 0);
|
||||
|
||||
---------------------------------------insert end
|
||||
|
||||
-- 25%商品成本佣金流水表
|
||||
DROP TABLE IF EXISTS market_commission_goods_cost_log;
|
||||
create table market_commission_goods_cost_log
|
||||
(
|
||||
id int8 not null primary key,
|
||||
account_id int8, -- 佣金账户id
|
||||
user_id int8, -- 用户id
|
||||
amount decimal(14, 2) default 0, -- 金额
|
||||
last_amount decimal(14, 2) default 0, -- 上一笔金额
|
||||
source_type int4, -- 来源类型 0-商城订单
|
||||
source_id int8, -- 来源id
|
||||
source_detail text, -- 来源详情
|
||||
type int4 default 1, -- 类型 1-收入 2-支出
|
||||
is_complete int4 default 0, -- 0-未完成 1-已完成
|
||||
statistical_date timestamp(6), -- 统计时间
|
||||
remark text, -- 备注
|
||||
create_user int8,
|
||||
create_dept int8,
|
||||
create_time timestamp(6),
|
||||
update_user int8,
|
||||
update_time timestamp(6),
|
||||
status int4 default 1,
|
||||
is_deleted int4 default 0
|
||||
);
|
||||
|
||||
create index inx_mcgcl_uid
|
||||
on market_commission_goods_cost_log (is_complete, user_id, type, statistical_date, create_time DESC);
|
||||
create index inx_mcgcl_aid
|
||||
on market_commission_goods_cost_log (is_complete, account_id , type, statistical_date, create_time DESC);
|
||||
|
||||
comment on table market_commission_goods_cost_log is '25%商品成本佣金流水表';
|
||||
comment on column market_commission_goods_cost_log.id is '主键';
|
||||
comment on column market_commission_goods_cost_log.account_id is '账户id';
|
||||
comment on column market_commission_goods_cost_log.user_id is '用户id';
|
||||
comment on column market_commission_goods_cost_log.amount is '金额';
|
||||
comment on column market_commission_goods_cost_log.last_amount is '上笔金额';
|
||||
comment on column market_commission_goods_cost_log.source_type is '来源模块 0-商城订单';
|
||||
comment on column market_commission_goods_cost_log.source_id is '来源id';
|
||||
comment on column market_commission_goods_cost_log.source_detail is '来源详情';
|
||||
comment on column market_commission_goods_cost_log.type is '类型 1-收入 2-支出';
|
||||
comment on column market_commission_goods_cost_log.is_complete is '0-未完成 1-已完成';
|
||||
comment on column market_commission_goods_cost_log.statistical_date is '统计时间';
|
||||
comment on column market_commission_goods_cost_log.remark is '备注';
|
||||
comment on column market_commission_goods_cost_log.create_user is '创建人';
|
||||
comment on column market_commission_goods_cost_log.create_dept is '创建部门';
|
||||
comment on column market_commission_goods_cost_log.create_time is '创建时间';
|
||||
comment on column market_commission_goods_cost_log.update_user is '修改人';
|
||||
comment on column market_commission_goods_cost_log.update_time is '修改时间';
|
||||
comment on column market_commission_goods_cost_log.status is '状态';
|
||||
comment on column market_commission_goods_cost_log.is_deleted is '是否已删除';
|
||||
|
||||
alter table market_commission_goods_cost_log
|
||||
owner to yicha1lu;
|
||||
|
||||
-- 30%购买人获取用户积分佣金流水表
|
||||
DROP TABLE IF EXISTS market_commission_user_point_log;
|
||||
create table market_commission_user_point_log
|
||||
(
|
||||
id int8 not null primary key,
|
||||
account_id int8, -- 佣金账户id
|
||||
user_id int8, -- 用户id
|
||||
amount decimal(14, 2) default 0, -- 变动金额
|
||||
last_amount decimal(14, 2) default 0, -- 上一笔金额
|
||||
source_type int4, -- 来源类型 0-商城订单 1-发放积分
|
||||
source_id int8, -- 来源id
|
||||
source_detail text, -- 来源详情
|
||||
type int4 default 1, -- 类型 1-收入 2-支出
|
||||
is_complete int4 default 0, -- 0-未完成 1-已完成
|
||||
is_salary_paid int4 default 0, -- 金额是否发放到用户 0-否 1-是
|
||||
statistical_date timestamp(6), -- 统计时间
|
||||
remark text, -- 备注
|
||||
create_user int8,
|
||||
create_dept int8,
|
||||
create_time timestamp(6),
|
||||
update_user int8,
|
||||
update_time timestamp(6),
|
||||
status int4 default 1,
|
||||
is_deleted int4 default 0
|
||||
);
|
||||
|
||||
create index idx_mcupl_uid
|
||||
on market_commission_user_point_log (is_complete, user_id, type, statistical_date, create_time DESC);
|
||||
create index idx_mcupl_aid
|
||||
on market_commission_user_point_log (is_complete, account_id , type, statistical_date, create_time DESC);
|
||||
|
||||
comment on table market_commission_user_point_log is '30%购买人获取用户积分佣金流水表';
|
||||
comment on column market_commission_user_point_log.id is '主键';
|
||||
comment on column market_commission_user_point_log.account_id is '账户id';
|
||||
comment on column market_commission_user_point_log.user_id is '用户id';
|
||||
comment on column market_commission_user_point_log.amount is '变动金额';
|
||||
comment on column market_commission_user_point_log.last_amount is '上笔金额';
|
||||
comment on column market_commission_user_point_log.source_type is '来源类型 0-商城订单 1-发放积分';
|
||||
comment on column market_commission_user_point_log.source_id is '来源id';
|
||||
comment on column market_commission_user_point_log.source_detail is '来源详情';
|
||||
comment on column market_commission_user_point_log.type is '类型 1-收入 2-支出';
|
||||
comment on column market_commission_user_point_log.is_complete is '0-未完成 1-已完成';
|
||||
comment on column market_commission_user_point_log.is_salary_paid is '金额是否发放到用户 0-否 1-是';
|
||||
comment on column market_commission_user_point_log.statistical_date is '统计时间';
|
||||
comment on column market_commission_user_point_log.remark is '备注';
|
||||
comment on column market_commission_user_point_log.create_user is '创建人';
|
||||
comment on column market_commission_user_point_log.create_dept is '创建部门';
|
||||
comment on column market_commission_user_point_log.create_time is '创建时间';
|
||||
comment on column market_commission_user_point_log.update_user is '修改人';
|
||||
comment on column market_commission_user_point_log.update_time is '修改时间';
|
||||
comment on column market_commission_user_point_log.status is '状态';
|
||||
comment on column market_commission_user_point_log.is_deleted is '是否已删除';
|
||||
|
||||
alter table market_commission_user_point_log
|
||||
owner to yicha1lu;
|
||||
|
||||
-- 10%直推人佣金流水表
|
||||
DROP TABLE IF EXISTS market_commission_direct_push_log;
|
||||
create table market_commission_direct_push_log
|
||||
(
|
||||
id int8 not null primary key,
|
||||
account_id int8, -- 佣金账户id
|
||||
user_id int8, -- 用户id
|
||||
amount decimal(14, 2) default 0, -- 变动金额
|
||||
last_amount decimal(14, 2) default 0, -- 上一笔金额
|
||||
source_type int4, -- 来源类型 0-商城订单 1-发放直推佣金
|
||||
source_id int8, -- 来源id
|
||||
source_detail text, -- 来源详情
|
||||
type int4 default 1, -- 类型 1-收入 2-支出
|
||||
is_complete int4 default 0, -- 0-未完成 1-已完成
|
||||
is_salary_paid int4 default 0, -- 金额是否发放到用户 0-否 1-是
|
||||
statistical_date timestamp(6), -- 统计时间
|
||||
remark text, -- 备注
|
||||
create_user int8,
|
||||
create_dept int8,
|
||||
create_time timestamp(6),
|
||||
update_user int8,
|
||||
update_time timestamp(6),
|
||||
status int4 default 1,
|
||||
is_deleted int4 default 0
|
||||
);
|
||||
|
||||
create index idx_mcdpl_uid
|
||||
on market_commission_direct_push_log (is_complete, user_id, type, statistical_date, create_time DESC);
|
||||
create index idx_mcdpl_aid
|
||||
on market_commission_direct_push_log (is_complete, account_id , type, statistical_date, create_time DESC);
|
||||
|
||||
comment on table market_commission_direct_push_log is '10%直推人佣金流水表';
|
||||
comment on column market_commission_direct_push_log.id is '主键';
|
||||
comment on column market_commission_direct_push_log.account_id is '账户id';
|
||||
comment on column market_commission_direct_push_log.user_id is '用户id';
|
||||
comment on column market_commission_direct_push_log.amount is '变动金额';
|
||||
comment on column market_commission_direct_push_log.last_amount is '上笔金额';
|
||||
comment on column market_commission_direct_push_log.source_type is '来源类型 0-商城订单 1-发放直推佣金';
|
||||
comment on column market_commission_direct_push_log.source_id is '来源id';
|
||||
comment on column market_commission_direct_push_log.source_detail is '来源详情';
|
||||
comment on column market_commission_direct_push_log.type is '类型 1-收入 2-支出';
|
||||
comment on column market_commission_direct_push_log.is_complete is '0-未完成 1-已完成';
|
||||
comment on column market_commission_direct_push_log.is_salary_paid is '金额是否发放到用户 0-否 1-是';
|
||||
comment on column market_commission_direct_push_log.statistical_date is '统计时间';
|
||||
comment on column market_commission_direct_push_log.remark is '备注';
|
||||
comment on column market_commission_direct_push_log.create_user is '创建人';
|
||||
comment on column market_commission_direct_push_log.create_dept is '创建部门';
|
||||
comment on column market_commission_direct_push_log.create_time is '创建时间';
|
||||
comment on column market_commission_direct_push_log.update_user is '修改人';
|
||||
comment on column market_commission_direct_push_log.update_time is '修改时间';
|
||||
comment on column market_commission_direct_push_log.status is '状态';
|
||||
comment on column market_commission_direct_push_log.is_deleted is '是否已删除';
|
||||
|
||||
alter table market_commission_direct_push_log
|
||||
owner to yicha1lu;
|
||||
|
||||
-- 5%运营佣金流水表
|
||||
DROP TABLE IF EXISTS market_commission_operation_log;
|
||||
create table market_commission_operation_log
|
||||
(
|
||||
id int8 not null primary key,
|
||||
account_id int8, -- 佣金账户id
|
||||
amount decimal(14, 2) default 0, -- 变动金额
|
||||
last_amount decimal(14, 2) default 0, -- 上一笔金额
|
||||
cut_amount decimal(14, 2) default 0, -- 随机立减金额
|
||||
cut_detail text, -- 随机立减说明
|
||||
source_type int4, -- 来源类型 0-商城订单 1-发放运营佣金
|
||||
source_id int8, -- 来源id
|
||||
source_detail text, -- 来源详情
|
||||
type int4 default 1, -- 类型 1-收入 2-支出
|
||||
is_complete int4 default 0, -- 0-未完成 1-已完成
|
||||
statistical_date timestamp(6), -- 统计时间
|
||||
remark text, -- 备注
|
||||
create_user int8,
|
||||
create_dept int8,
|
||||
create_time timestamp(6),
|
||||
update_user int8,
|
||||
update_time timestamp(6),
|
||||
status int4 default 1,
|
||||
is_deleted int4 default 0
|
||||
);
|
||||
|
||||
create index idx_mcol_aid
|
||||
on market_commission_operation_log (is_complete, account_id, type, statistical_date , create_time DESC);
|
||||
|
||||
comment on table market_commission_operation_log is '5%运营佣金流水表';
|
||||
comment on column market_commission_operation_log.id is '主键';
|
||||
comment on column market_commission_operation_log.account_id is '账户id';
|
||||
comment on column market_commission_operation_log.amount is '变动金额';
|
||||
comment on column market_commission_operation_log.last_amount is '上笔金额';
|
||||
comment on column market_commission_operation_log.cut_amount is '随机立减金额';
|
||||
comment on column market_commission_operation_log.cut_detail is '随机立减说明';
|
||||
comment on column market_commission_operation_log.source_type is '来源类型 0-商城订单 1-发放运营佣金';
|
||||
comment on column market_commission_operation_log.source_id is '来源id';
|
||||
comment on column market_commission_operation_log.source_detail is '来源详情';
|
||||
comment on column market_commission_operation_log.type is '类型 1-收入 2-支出';
|
||||
comment on column market_commission_operation_log.is_complete is '0-未完成 1-已完成';
|
||||
comment on column market_commission_operation_log.statistical_date is '统计时间';
|
||||
comment on column market_commission_operation_log.remark is '备注';
|
||||
comment on column market_commission_operation_log.create_user is '创建人';
|
||||
comment on column market_commission_operation_log.create_dept is '创建部门';
|
||||
comment on column market_commission_operation_log.create_time is '创建时间';
|
||||
comment on column market_commission_operation_log.update_user is '修改人';
|
||||
comment on column market_commission_operation_log.update_time is '修改时间';
|
||||
comment on column market_commission_operation_log.status is '状态';
|
||||
comment on column market_commission_operation_log.is_deleted is '是否已删除';
|
||||
|
||||
alter table market_commission_operation_log
|
||||
owner to yicha1lu;
|
||||
|
||||
-- 5%广告补贴佣金流水表
|
||||
DROP TABLE IF EXISTS market_commission_advertising_log;
|
||||
create table market_commission_advertising_log
|
||||
(
|
||||
id int8 not null primary key,
|
||||
account_id int8, -- 佣金账户id
|
||||
amount decimal(14, 2) default 0, -- 变动金额
|
||||
last_amount decimal(14, 2) default 0, -- 上一笔金额
|
||||
source_type int4, -- 来源类型 0-商城订单 1-发放广告佣金
|
||||
source_id int8, -- 来源id
|
||||
source_detail text, -- 来源详情
|
||||
type int4 default 1, -- 类型 1-收入 2-支出
|
||||
is_complete int4 default 0, -- 0-未完成 1-已完成
|
||||
statistical_date timestamp(6), -- 统计时间
|
||||
remark text, -- 备注
|
||||
create_user int8,
|
||||
create_dept int8,
|
||||
create_time timestamp(6),
|
||||
update_user int8,
|
||||
update_time timestamp(6),
|
||||
status int4 default 1,
|
||||
is_deleted int4 default 0
|
||||
);
|
||||
|
||||
create index idx_mcal_aid
|
||||
on market_commission_advertising_log (is_complete, account_id, type, statistical_date , create_time DESC);
|
||||
|
||||
comment on table market_commission_advertising_log is '5%广告补贴佣金流水表';
|
||||
comment on column market_commission_advertising_log.id is '主键';
|
||||
comment on column market_commission_advertising_log.account_id is '账户id';
|
||||
comment on column market_commission_advertising_log.amount is '变动金额';
|
||||
comment on column market_commission_advertising_log.last_amount is '上笔金额';
|
||||
comment on column market_commission_advertising_log.source_type is '来源类型 0-商城订单 1-发放广告佣金';
|
||||
comment on column market_commission_advertising_log.source_id is '来源id';
|
||||
comment on column market_commission_advertising_log.source_detail is '来源详情';
|
||||
comment on column market_commission_advertising_log.type is '类型 1-收入 2-支出';
|
||||
comment on column market_commission_advertising_log.is_complete is '0-未完成 1-已完成';
|
||||
comment on column market_commission_advertising_log.statistical_date is '统计时间';
|
||||
comment on column market_commission_advertising_log.remark is '备注';
|
||||
comment on column market_commission_advertising_log.create_user is '创建人';
|
||||
comment on column market_commission_advertising_log.create_dept is '创建部门';
|
||||
comment on column market_commission_advertising_log.create_time is '创建时间';
|
||||
comment on column market_commission_advertising_log.update_user is '修改人';
|
||||
comment on column market_commission_advertising_log.update_time is '修改时间';
|
||||
comment on column market_commission_advertising_log.status is '状态';
|
||||
comment on column market_commission_advertising_log.is_deleted is '是否已删除';
|
||||
|
||||
alter table market_commission_advertising_log
|
||||
owner to yicha1lu;
|
||||
|
||||
-- 5%服务商佣金流水表
|
||||
DROP TABLE IF EXISTS market_commission_service_provider_log;
|
||||
create table market_commission_service_provider_log
|
||||
(
|
||||
id int8 not null primary key,
|
||||
account_id int8, -- 佣金账户id
|
||||
user_id int8, -- 用户id
|
||||
amount decimal(14, 2) default 0, -- 变动金额
|
||||
last_amount decimal(14, 2) default 0, -- 上一笔金额
|
||||
source_type int4, -- 来源类型 0-商城订单 1-发放服务商佣金
|
||||
source_id int8, -- 来源id
|
||||
source_detail text, -- 来源详情
|
||||
type int4 default 1, -- 类型 1-收入 2-支出
|
||||
is_complete int4 default 0, -- 0-未完成 1-已完成
|
||||
is_salary_paid int4 default 0, -- 金额是否发放到用户 0-否 1-是
|
||||
statistical_date timestamp(6), -- 统计时间
|
||||
address_id int8, -- 收货地址id
|
||||
region_id int4, -- 区域id
|
||||
service_provider_id int8, -- 服务商id
|
||||
service_type int4, -- 服务类型
|
||||
remark text, -- 备注
|
||||
create_user int8,
|
||||
create_dept int8,
|
||||
create_time timestamp(6),
|
||||
update_user int8,
|
||||
update_time timestamp(6),
|
||||
status int4 default 1,
|
||||
is_deleted int4 default 0
|
||||
);
|
||||
|
||||
create index idx_mcspl_uid
|
||||
on market_commission_service_provider_log (is_complete, user_id, type, statistical_date, create_time DESC);
|
||||
create index idx_mcspl_aid
|
||||
on market_commission_service_provider_log (is_complete, account_id , type, statistical_date, create_time DESC);
|
||||
|
||||
comment on table market_commission_service_provider_log is '5%服务商佣金流水表';
|
||||
comment on column market_commission_service_provider_log.id is '主键';
|
||||
comment on column market_commission_service_provider_log.account_id is '账户id';
|
||||
comment on column market_commission_service_provider_log.user_id is '用户id';
|
||||
comment on column market_commission_service_provider_log.amount is '变动金额';
|
||||
comment on column market_commission_service_provider_log.last_amount is '上笔金额';
|
||||
comment on column market_commission_service_provider_log.source_type is '来源类型 0-商城订单 1-发放服务商佣金';
|
||||
comment on column market_commission_service_provider_log.source_id is '来源id';
|
||||
comment on column market_commission_service_provider_log.source_detail is '来源详情';
|
||||
comment on column market_commission_service_provider_log.type is '类型 1-收入 2-支出';
|
||||
comment on column market_commission_service_provider_log.is_complete is '0-未完成 1-已完成';
|
||||
comment on column market_commission_service_provider_log.is_salary_paid is '金额是否发放到用户 0-否 1-是';
|
||||
comment on column market_commission_service_provider_log.statistical_date is '统计时间';
|
||||
comment on column market_commission_service_provider_log.address_id is '收货地址id';
|
||||
comment on column market_commission_service_provider_log.region_id is '省市区id';
|
||||
comment on column market_commission_service_provider_log.service_type is '服务类型';
|
||||
comment on column market_commission_service_provider_log.service_provider_id is '服务商ID';
|
||||
comment on column market_commission_service_provider_log.remark is '备注';
|
||||
comment on column market_commission_service_provider_log.create_user is '创建人';
|
||||
comment on column market_commission_service_provider_log.create_dept is '创建部门';
|
||||
comment on column market_commission_service_provider_log.create_time is '创建时间';
|
||||
comment on column market_commission_service_provider_log.update_user is '修改人';
|
||||
comment on column market_commission_service_provider_log.update_time is '修改时间';
|
||||
comment on column market_commission_service_provider_log.status is '状态';
|
||||
comment on column market_commission_service_provider_log.is_deleted is '是否已删除';
|
||||
|
||||
alter table market_commission_service_provider_log
|
||||
owner to yicha1lu;
|
||||
|
||||
-- 15%极差代理佣金流水表
|
||||
DROP TABLE IF EXISTS market_commission_agency_log;
|
||||
create table market_commission_agency_log
|
||||
(
|
||||
id int8 not null primary key,
|
||||
account_id int8, -- 佣金账户id
|
||||
user_id int8, -- 用户id
|
||||
amount decimal(14, 2) default 0, -- 变动金额
|
||||
last_amount decimal(14, 2) default 0, -- 上一笔金额
|
||||
source_type int4, -- 来源类型 0-商城订单 1-发放极差代理佣金
|
||||
source_id int8, -- 来源id
|
||||
source_detail text, -- 来源详情
|
||||
type int4 default 1, -- 类型 1-收入 2-支出
|
||||
is_complete int4 default 0, -- 0-未完成 1-已完成
|
||||
statistical_date timestamp(6), -- 统计时间
|
||||
remark text, -- 备注
|
||||
create_user int8,
|
||||
create_dept int8,
|
||||
create_time timestamp(6),
|
||||
update_user int8,
|
||||
update_time timestamp(6),
|
||||
status int4 default 1,
|
||||
is_deleted int4 default 0
|
||||
);
|
||||
|
||||
create index idx_mc_agency_uid
|
||||
on market_commission_agency_log (is_complete, user_id, type, statistical_date, create_time DESC);
|
||||
create index idx_mc_agency_aid
|
||||
on market_commission_agency_log (is_complete, account_id , type, statistical_date, create_time DESC);
|
||||
|
||||
comment on table market_commission_agency_log is '15%极差代理佣金流水表';
|
||||
comment on column market_commission_agency_log.id is '主键';
|
||||
comment on column market_commission_agency_log.id is '主键';
|
||||
comment on column market_commission_agency_log.account_id is '账户id';
|
||||
comment on column market_commission_agency_log.user_id is '用户id';
|
||||
comment on column market_commission_agency_log.amount is '变动金额';
|
||||
comment on column market_commission_agency_log.last_amount is '上笔金额';
|
||||
comment on column market_commission_agency_log.source_type is '来源类型 0-商城订单 1-发放极差代理佣金';
|
||||
comment on column market_commission_agency_log.source_id is '来源id';
|
||||
comment on column market_commission_agency_log.source_detail is '来源详情';
|
||||
comment on column market_commission_agency_log.type is '类型 1-收入 2-支出';
|
||||
comment on column market_commission_agency_log.is_complete is '0-未完成 1-已完成';
|
||||
comment on column market_commission_agency_log.statistical_date is '统计时间';
|
||||
comment on column market_commission_agency_log.remark is '备注';
|
||||
comment on column market_commission_agency_log.create_user is '创建人';
|
||||
comment on column market_commission_agency_log.create_dept is '创建部门';
|
||||
comment on column market_commission_agency_log.create_time is '创建时间';
|
||||
comment on column market_commission_agency_log.update_user is '修改人';
|
||||
comment on column market_commission_agency_log.update_time is '修改时间';
|
||||
comment on column market_commission_agency_log.status is '状态';
|
||||
comment on column market_commission_agency_log.is_deleted is '是否已删除';
|
||||
|
||||
alter table market_commission_agency_log
|
||||
owner to yicha1lu;
|
||||
|
||||
-- 5%联创佣金流水表
|
||||
DROP TABLE IF EXISTS market_commission_co_creator_log;
|
||||
create table market_commission_co_creator_log
|
||||
(
|
||||
id int8 not null primary key,
|
||||
account_id int8, -- 佣金账户id
|
||||
amount decimal(14, 2) default 0, -- 变动金额
|
||||
last_amount decimal(14, 2) default 0, -- 上一笔金额
|
||||
source_type int4, -- 来源类型 0-商城订单 1-发放联创佣金
|
||||
source_id int8, -- 来源id
|
||||
source_detail text, -- 来源详情
|
||||
type int4 default 1, -- 类型 1-收入 2-支出
|
||||
is_complete int4 default 0, -- 0-未完成 1-已完成
|
||||
statistical_date timestamp(6), -- 统计时间
|
||||
remark text, -- 备注
|
||||
create_user int8,
|
||||
create_dept int8,
|
||||
create_time timestamp(6),
|
||||
update_user int8,
|
||||
update_time timestamp(6),
|
||||
status int4 default 1,
|
||||
is_deleted int4 default 0
|
||||
);
|
||||
|
||||
create index idx_mcccl_aid
|
||||
on market_commission_co_creator_log (is_complete, account_id, statistical_date, type , create_time DESC);
|
||||
|
||||
comment on table market_commission_co_creator_log is '5%联创佣金流水表';
|
||||
comment on column market_commission_co_creator_log.id is '主键';
|
||||
comment on column market_commission_co_creator_log.account_id is '账户id';
|
||||
comment on column market_commission_co_creator_log.amount is '变动金额';
|
||||
comment on column market_commission_co_creator_log.last_amount is '上笔金额';
|
||||
comment on column market_commission_co_creator_log.source_type is '来源类型 0-商城订单 1-发放联创佣金';
|
||||
comment on column market_commission_co_creator_log.source_id is '来源id';
|
||||
comment on column market_commission_co_creator_log.source_detail is '来源详情';
|
||||
comment on column market_commission_co_creator_log.type is '类型 1-收入 2-支出';
|
||||
comment on column market_commission_co_creator_log.is_complete is '0-未完成 1-已完成';
|
||||
comment on column market_commission_co_creator_log.statistical_date is '统计时间';
|
||||
comment on column market_commission_co_creator_log.remark is '备注';
|
||||
comment on column market_commission_co_creator_log.create_user is '创建人';
|
||||
comment on column market_commission_co_creator_log.create_dept is '创建部门';
|
||||
comment on column market_commission_co_creator_log.create_time is '创建时间';
|
||||
comment on column market_commission_co_creator_log.update_user is '修改人';
|
||||
comment on column market_commission_co_creator_log.update_time is '修改时间';
|
||||
comment on column market_commission_co_creator_log.status is '状态';
|
||||
comment on column market_commission_co_creator_log.is_deleted is '是否已删除';
|
||||
|
||||
alter table market_commission_co_creator_log
|
||||
owner to yicha1lu;
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS user_market_package_daily_settlement;
|
||||
create table user_market_package_daily_settlement --用户福利包每天结算记录
|
||||
(
|
||||
@@ -26,7 +768,7 @@ COMMENT ON COLUMN user_market_package_daily_settlement.id IS '主键';
|
||||
COMMENT ON COLUMN user_market_package_daily_settlement.user_id IS '用户id';
|
||||
COMMENT ON COLUMN user_market_package_daily_settlement.account IS '账户';
|
||||
COMMENT ON COLUMN user_market_package_daily_settlement.user_name IS '用户名';
|
||||
COMMENT ON COLUMN user_market_package_daily_settlement.pack_id IS '用户兑换福利包id(数组), 记录已发的id';
|
||||
COMMENT ON COLUMN user_market_package_daily_settlement.package_id IS '用户兑换福利包id(数组), 记录已发的id';
|
||||
COMMENT ON COLUMN user_market_package_daily_settlement.is_complete IS '是否完成 0-未完成 1-完成';
|
||||
COMMENT ON COLUMN user_market_package_daily_settlement.remark IS '备注';
|
||||
comment on column user_market_package_daily_settlement.create_user is '创建人';
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, component, remark, is_deleted) VALUES (2019341062694285314, 2019338015981219841, 'userAddress', '用户收货地址', 'menu', '/common/commonUserAddress', null, 1, 1, 0, 1, null, null, 0);
|
||||
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, component, remark, is_deleted) VALUES (2019341062694285315, 2019341062694285314, 'userAddress_add', '新增', 'add', '/common/commonUserAddress/add', 'plus', 1, 2, 1, 1, null, null, 0);
|
||||
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, component, remark, is_deleted) VALUES (2019341062694285316, 2019341062694285314, 'userAddress_edit', '修改', 'edit', '/common/commonUserAddress/edit', 'form', 2, 2, 2, 1, null, null, 0);
|
||||
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, component, remark, is_deleted) VALUES (2019341062694285317, 2019341062694285314, 'userAddress_delete', '删除', 'delete', '/common/address/remove', 'delete', 3, 2, 3, 1, null, null, 0);
|
||||
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, component, remark, is_deleted) VALUES (2019341062694285318, 2019341062694285314, 'userAddress_view', '查看', 'view', '/common/commonUserAddress/view', 'file-text', 4, 2, 2, 1, null, null, 0);
|
||||
@@ -1,5 +0,0 @@
|
||||
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, component, remark, is_deleted) VALUES (2020763647899787265, 2019338015981219841, 'userNotice', '用户通知', 'menu', '/common/commonUserNotice', 'iconfont iconicon_voipphone', 1, 1, 0, 1, '', '', 0);
|
||||
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, component, remark, is_deleted) VALUES (2020763647899787266, 2020763647899787265, 'userNotice_add', '新增', 'add', '/common/commonUserNotice/add', 'plus', 1, 2, 1, 1, null, null, 0);
|
||||
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, component, remark, is_deleted) VALUES (2020763647899787267, 2020763647899787265, 'userNotice_edit', '修改', 'edit', '/common/commonUserNotice/edit', 'form', 2, 2, 2, 1, null, null, 0);
|
||||
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, component, remark, is_deleted) VALUES (2020763647899787268, 2020763647899787265, 'userNotice_delete', '删除', 'delete', '/common/notice/remove', 'delete', 3, 2, 3, 1, null, null, 0);
|
||||
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, component, remark, is_deleted) VALUES (2020763647899787269, 2020763647899787265, 'userNotice_view', '查看', 'view', '/common/commonUserNotice/view', 'file-text', 4, 2, 2, 1, null, null, 0);
|
||||
@@ -1,493 +0,0 @@
|
||||
-- 佣金账户表
|
||||
DROP TABLE IF EXISTS market_commission_account;
|
||||
create table market_commission_account
|
||||
(
|
||||
id int8 not null primary key,
|
||||
account_name varchar(128), -- 账户名称
|
||||
account_code varchar(64), -- 账户代码
|
||||
account_type int4, -- 账户类型 0-商品成本 1-购买人获取用户积分 2-直推人佣金 3-运营佣金 4-广告补贴 5-服务商佣金 6-极差代理佣金 7-联创佣金
|
||||
amount decimal(14, 2) default 0, -- 账户总余额
|
||||
version int4 default 1,
|
||||
remark varchar(200),
|
||||
create_user int8,
|
||||
create_dept int8,
|
||||
create_time timestamp(6),
|
||||
update_user int8,
|
||||
update_time timestamp(6),
|
||||
status int4 default 1,
|
||||
is_deleted int4 default 0
|
||||
);
|
||||
|
||||
create index idx_mca_code
|
||||
on market_commission_account (account_code);
|
||||
create index idx_mca_type
|
||||
on market_commission_account (account_type);
|
||||
|
||||
comment on table market_commission_account is '用户佣金账户表';
|
||||
comment on column market_commission_account.id is '主键';
|
||||
comment on column market_commission_account.account_name is '账户名称';
|
||||
comment on column market_commission_account.account_code is '账户代码';
|
||||
comment on column market_commission_account.account_type is '账户类型 0-商品成本 1-购买人获取用户积分 2-直推人佣金 3-运营佣金 4-广告补贴 5-服务商佣金 6-极差代理佣金 7-联创佣金';
|
||||
comment on column market_commission_account.amount is '账户总余额';
|
||||
comment on column market_commission_account.version is '版本号';
|
||||
comment on column market_commission_account.remark is '备注';
|
||||
comment on column market_commission_account.create_user is '创建人';
|
||||
comment on column market_commission_account.create_dept is '创建部门';
|
||||
comment on column market_commission_account.create_time is '创建时间';
|
||||
comment on column market_commission_account.update_user is '修改人';
|
||||
comment on column market_commission_account.update_time is '修改时间';
|
||||
comment on column market_commission_account.status is '状态';
|
||||
comment on column market_commission_account.is_deleted is '是否已删除';
|
||||
|
||||
alter table market_commission_account
|
||||
owner to yicha1lu;
|
||||
---------------------------------------insert start
|
||||
INSERT INTO market_commission_account ("id", "account_name", "account_code", "account_type" , "amount", "version", "remark" , "create_user", "create_dept", "create_time", "update_user", "update_time", "status", "is_deleted") VALUES (2017485441885196290, '商品成本账户', 'COMMISSION_GOODS_COST', '0','0.0000', 1, '商品成本账户',1123598821738675201, 1123598813738675201, '2026-01-31 14:29:47', 1123598821738675201, '2026-01-31 14:30:16.04', 1, 0);
|
||||
INSERT INTO market_commission_account ("id", "account_name", "account_code", "account_type" , "amount", "version", "remark" , "create_user", "create_dept", "create_time", "update_user", "update_time", "status", "is_deleted") VALUES (2017485893100032002, '分发商城积分账户', 'COMMISSION_USER_POINT_LOG', '1', '0.0000', 1, '分发商城积分账户',1123598821738675201, 1123598813738675201, '2026-01-31 14:31:34.663', 1123598821738675201, '2026-01-31 14:31:34.663', 1, 0);
|
||||
INSERT INTO market_commission_account ("id", "account_name", "account_code", "account_type" , "amount", "version", "remark" , "create_user", "create_dept", "create_time", "update_user", "update_time", "status", "is_deleted") VALUES (2017486037128237058, '分发直推人佣金账户', 'COMMISSION_DIRECT_PUSH', '2', '0.0000', 1,'分发直推人佣金账户',1123598821738675201, 1123598813738675201, '2026-01-31 14:32:08.998', 1123598821738675201, '2026-01-31 14:32:08.998', 1, 0);
|
||||
INSERT INTO market_commission_account ("id", "account_name", "account_code", "account_type" , "amount", "version", "remark" , "create_user", "create_dept", "create_time", "update_user", "update_time", "status", "is_deleted") VALUES (2017486179294171138, '运营账户', 'COMMISSION_OPERATION', '3','0.0000', 1, '运营账户',1123598821738675201, 1123598813738675201, '2026-01-31 14:32:42.889', 1123598821738675201, '2026-01-31 14:32:42.889', 1, 0);
|
||||
INSERT INTO market_commission_account ("id", "account_name", "account_code", "account_type" , "amount", "version", "remark" , "create_user", "create_dept", "create_time", "update_user", "update_time", "status", "is_deleted") VALUES (2017486299502923778, '分发广告补贴账户', 'COMMISSION_ADVERTISING', '4','0.0000', 1, '分发广告补贴账户',1123598821738675201, 1123598813738675201, '2026-01-31 14:33:11.552', 1123598821738675201, '2026-01-31 14:33:11.552', 1, 0);
|
||||
INSERT INTO market_commission_account ("id", "account_name", "account_code", "account_type" , "amount", "version", "remark" , "create_user", "create_dept", "create_time", "update_user", "update_time", "status", "is_deleted") VALUES (2017486437340336130, '分发服务商佣金账户', 'COMMISSION_SERVICE_PROVIDER','5', '0.0000', 1, '分发服务商佣金账户',1123598821738675201, 1123598813738675201, '2026-01-31 14:33:44.407', 1123598821738675201, '2026-01-31 14:33:44.407', 1, 0);
|
||||
INSERT INTO market_commission_account ("id", "account_name", "account_code", "account_type" , "amount", "version", "remark" , "create_user", "create_dept", "create_time", "update_user", "update_time", "status", "is_deleted") VALUES (2017486568441696258, '分发极差代理佣金账户', 'COMMISSION_AGENCY', '6','0.0000', 1, '分发极差代理佣金账户',1123598821738675201, 1123598813738675201, '2026-01-31 14:34:15.663', 1123598821738675201, '2026-01-31 14:34:15.663', 1, 0);
|
||||
INSERT INTO market_commission_account ("id", "account_name", "account_code", "account_type" , "amount", "version", "remark" , "create_user", "create_dept", "create_time", "update_user", "update_time", "status", "is_deleted") VALUES (2017486664117964802, '联创佣金账户', 'COMMISSION_CO_CREATOR', '7','0.0000', 1, '联创佣金账户',1123598821738675201, 1123598813738675201, '2026-01-31 14:34:38.479', 1123598821738675201, '2026-01-31 14:34:38.479', 1, 0);
|
||||
|
||||
---------------------------------------insert end
|
||||
|
||||
-- 25%商品成本佣金流水表
|
||||
DROP TABLE IF EXISTS market_commission_goods_cost_log;
|
||||
create table market_commission_goods_cost_log
|
||||
(
|
||||
id int8 not null primary key,
|
||||
account_id int8, -- 佣金账户id
|
||||
user_id int8, -- 用户id
|
||||
amount decimal(14, 2) default 0, -- 金额
|
||||
last_amount decimal(14, 2) default 0, -- 上一笔金额
|
||||
source_type int4, -- 来源类型 0-商城订单
|
||||
source_id int8, -- 来源id
|
||||
source_detail text, -- 来源详情
|
||||
type int4 default 1, -- 类型 1-收入 2-支出
|
||||
is_complete int4 default 0, -- 0-未完成 1-已完成
|
||||
statistical_date timestamp(6), -- 统计时间
|
||||
remark text, -- 备注
|
||||
create_user int8,
|
||||
create_dept int8,
|
||||
create_time timestamp(6),
|
||||
update_user int8,
|
||||
update_time timestamp(6),
|
||||
status int4 default 1,
|
||||
is_deleted int4 default 0
|
||||
);
|
||||
|
||||
create index inx_mcgcl_uid
|
||||
on market_commission_goods_cost_log (is_complete, user_id, type, statistical_date, create_time DESC);
|
||||
create index inx_mcgcl_aid
|
||||
on market_commission_goods_cost_log (is_complete, account_id , type, statistical_date, create_time DESC);
|
||||
|
||||
comment on table market_commission_goods_cost_log is '25%商品成本佣金流水表';
|
||||
comment on column market_commission_goods_cost_log.id is '主键';
|
||||
comment on column market_commission_goods_cost_log.account_id is '账户id';
|
||||
comment on column market_commission_goods_cost_log.user_id is '用户id';
|
||||
comment on column market_commission_goods_cost_log.amount is '金额';
|
||||
comment on column market_commission_goods_cost_log.last_amount is '上笔金额';
|
||||
comment on column market_commission_goods_cost_log.source_type is '来源模块 0-商城订单';
|
||||
comment on column market_commission_goods_cost_log.source_id is '来源id';
|
||||
comment on column market_commission_goods_cost_log.source_detail is '来源详情';
|
||||
comment on column market_commission_goods_cost_log.type is '类型 1-收入 2-支出';
|
||||
comment on column market_commission_goods_cost_log.is_complete is '0-未完成 1-已完成';
|
||||
comment on column market_commission_goods_cost_log.statistical_date is '统计时间';
|
||||
comment on column market_commission_goods_cost_log.remark is '备注';
|
||||
comment on column market_commission_goods_cost_log.create_user is '创建人';
|
||||
comment on column market_commission_goods_cost_log.create_dept is '创建部门';
|
||||
comment on column market_commission_goods_cost_log.create_time is '创建时间';
|
||||
comment on column market_commission_goods_cost_log.update_user is '修改人';
|
||||
comment on column market_commission_goods_cost_log.update_time is '修改时间';
|
||||
comment on column market_commission_goods_cost_log.status is '状态';
|
||||
comment on column market_commission_goods_cost_log.is_deleted is '是否已删除';
|
||||
|
||||
alter table market_commission_goods_cost_log
|
||||
owner to yicha1lu;
|
||||
|
||||
-- 30%购买人获取用户积分佣金流水表
|
||||
DROP TABLE IF EXISTS market_commission_user_point_log;
|
||||
create table market_commission_user_point_log
|
||||
(
|
||||
id int8 not null primary key,
|
||||
account_id int8, -- 佣金账户id
|
||||
user_id int8, -- 用户id
|
||||
amount decimal(14, 2) default 0, -- 变动金额
|
||||
last_amount decimal(14, 2) default 0, -- 上一笔金额
|
||||
source_type int4, -- 来源类型 0-商城订单 1-发放积分
|
||||
source_id int8, -- 来源id
|
||||
source_detail text, -- 来源详情
|
||||
type int4 default 1, -- 类型 1-收入 2-支出
|
||||
is_complete int4 default 0, -- 0-未完成 1-已完成
|
||||
is_salary_paid int4 default 0, -- 金额是否发放到用户 0-否 1-是
|
||||
statistical_date timestamp(6), -- 统计时间
|
||||
remark text, -- 备注
|
||||
create_user int8,
|
||||
create_dept int8,
|
||||
create_time timestamp(6),
|
||||
update_user int8,
|
||||
update_time timestamp(6),
|
||||
status int4 default 1,
|
||||
is_deleted int4 default 0
|
||||
);
|
||||
|
||||
create index idx_mcupl_uid
|
||||
on market_commission_user_point_log (is_complete, user_id, type, statistical_date, create_time DESC);
|
||||
create index idx_mcupl_aid
|
||||
on market_commission_user_point_log (is_complete, account_id , type, statistical_date, create_time DESC);
|
||||
|
||||
comment on table market_commission_user_point_log is '30%购买人获取用户积分佣金流水表';
|
||||
comment on column market_commission_user_point_log.id is '主键';
|
||||
comment on column market_commission_user_point_log.account_id is '账户id';
|
||||
comment on column market_commission_user_point_log.user_id is '用户id';
|
||||
comment on column market_commission_user_point_log.amount is '变动金额';
|
||||
comment on column market_commission_user_point_log.last_amount is '上笔金额';
|
||||
comment on column market_commission_user_point_log.source_type is '来源类型 0-商城订单 1-发放积分';
|
||||
comment on column market_commission_user_point_log.source_id is '来源id';
|
||||
comment on column market_commission_user_point_log.source_detail is '来源详情';
|
||||
comment on column market_commission_user_point_log.type is '类型 1-收入 2-支出';
|
||||
comment on column market_commission_user_point_log.is_complete is '0-未完成 1-已完成';
|
||||
comment on column market_commission_user_point_log.is_salary_paid is '金额是否发放到用户 0-否 1-是';
|
||||
comment on column market_commission_user_point_log.statistical_date is '统计时间';
|
||||
comment on column market_commission_user_point_log.remark is '备注';
|
||||
comment on column market_commission_user_point_log.create_user is '创建人';
|
||||
comment on column market_commission_user_point_log.create_dept is '创建部门';
|
||||
comment on column market_commission_user_point_log.create_time is '创建时间';
|
||||
comment on column market_commission_user_point_log.update_user is '修改人';
|
||||
comment on column market_commission_user_point_log.update_time is '修改时间';
|
||||
comment on column market_commission_user_point_log.status is '状态';
|
||||
comment on column market_commission_user_point_log.is_deleted is '是否已删除';
|
||||
|
||||
alter table market_commission_user_point_log
|
||||
owner to yicha1lu;
|
||||
|
||||
-- 10%直推人佣金流水表
|
||||
DROP TABLE IF EXISTS market_commission_direct_push_log;
|
||||
create table market_commission_direct_push_log
|
||||
(
|
||||
id int8 not null primary key,
|
||||
account_id int8, -- 佣金账户id
|
||||
user_id int8, -- 用户id
|
||||
amount decimal(14, 2) default 0, -- 变动金额
|
||||
last_amount decimal(14, 2) default 0, -- 上一笔金额
|
||||
source_type int4, -- 来源类型 0-商城订单 1-发放直推佣金
|
||||
source_id int8, -- 来源id
|
||||
source_detail text, -- 来源详情
|
||||
type int4 default 1, -- 类型 1-收入 2-支出
|
||||
is_complete int4 default 0, -- 0-未完成 1-已完成
|
||||
is_salary_paid int4 default 0, -- 金额是否发放到用户 0-否 1-是
|
||||
statistical_date timestamp(6), -- 统计时间
|
||||
remark text, -- 备注
|
||||
create_user int8,
|
||||
create_dept int8,
|
||||
create_time timestamp(6),
|
||||
update_user int8,
|
||||
update_time timestamp(6),
|
||||
status int4 default 1,
|
||||
is_deleted int4 default 0
|
||||
);
|
||||
|
||||
create index idx_mcdpl_uid
|
||||
on market_commission_direct_push_log (is_complete, user_id, type, statistical_date, create_time DESC);
|
||||
create index idx_mcdpl_aid
|
||||
on market_commission_direct_push_log (is_complete, account_id , type, statistical_date, create_time DESC);
|
||||
|
||||
comment on table market_commission_direct_push_log is '10%直推人佣金流水表';
|
||||
comment on column market_commission_direct_push_log.id is '主键';
|
||||
comment on column market_commission_direct_push_log.account_id is '账户id';
|
||||
comment on column market_commission_direct_push_log.user_id is '用户id';
|
||||
comment on column market_commission_direct_push_log.amount is '变动金额';
|
||||
comment on column market_commission_direct_push_log.last_amount is '上笔金额';
|
||||
comment on column market_commission_direct_push_log.source_type is '来源类型 0-商城订单 1-发放直推佣金';
|
||||
comment on column market_commission_direct_push_log.source_id is '来源id';
|
||||
comment on column market_commission_direct_push_log.source_detail is '来源详情';
|
||||
comment on column market_commission_direct_push_log.type is '类型 1-收入 2-支出';
|
||||
comment on column market_commission_direct_push_log.is_complete is '0-未完成 1-已完成';
|
||||
comment on column market_commission_direct_push_log.is_salary_paid is '金额是否发放到用户 0-否 1-是';
|
||||
comment on column market_commission_direct_push_log.statistical_date is '统计时间';
|
||||
comment on column market_commission_direct_push_log.remark is '备注';
|
||||
comment on column market_commission_direct_push_log.create_user is '创建人';
|
||||
comment on column market_commission_direct_push_log.create_dept is '创建部门';
|
||||
comment on column market_commission_direct_push_log.create_time is '创建时间';
|
||||
comment on column market_commission_direct_push_log.update_user is '修改人';
|
||||
comment on column market_commission_direct_push_log.update_time is '修改时间';
|
||||
comment on column market_commission_direct_push_log.status is '状态';
|
||||
comment on column market_commission_direct_push_log.is_deleted is '是否已删除';
|
||||
|
||||
alter table market_commission_direct_push_log
|
||||
owner to yicha1lu;
|
||||
|
||||
-- 5%运营佣金流水表
|
||||
DROP TABLE IF EXISTS market_commission_operation_log;
|
||||
create table market_commission_operation_log
|
||||
(
|
||||
id int8 not null primary key,
|
||||
account_id int8, -- 佣金账户id
|
||||
amount decimal(14, 2) default 0, -- 变动金额
|
||||
last_amount decimal(14, 2) default 0, -- 上一笔金额
|
||||
cut_amount decimal(14, 2) default 0, -- 随机立减金额
|
||||
cut_detail text, -- 随机立减说明
|
||||
source_type int4, -- 来源类型 0-商城订单 1-发放运营佣金
|
||||
source_id int8, -- 来源id
|
||||
source_detail text, -- 来源详情
|
||||
type int4 default 1, -- 类型 1-收入 2-支出
|
||||
is_complete int4 default 0, -- 0-未完成 1-已完成
|
||||
statistical_date timestamp(6), -- 统计时间
|
||||
remark text, -- 备注
|
||||
create_user int8,
|
||||
create_dept int8,
|
||||
create_time timestamp(6),
|
||||
update_user int8,
|
||||
update_time timestamp(6),
|
||||
status int4 default 1,
|
||||
is_deleted int4 default 0
|
||||
);
|
||||
|
||||
create index idx_mcol_aid
|
||||
on market_commission_operation_log (is_complete, account_id, type, statistical_date , create_time DESC);
|
||||
|
||||
comment on table market_commission_operation_log is '5%运营佣金流水表';
|
||||
comment on column market_commission_operation_log.id is '主键';
|
||||
comment on column market_commission_operation_log.account_id is '账户id';
|
||||
comment on column market_commission_operation_log.amount is '变动金额';
|
||||
comment on column market_commission_operation_log.last_amount is '上笔金额';
|
||||
comment on column market_commission_operation_log.cut_amount is '随机立减金额';
|
||||
comment on column market_commission_operation_log.cut_detail is '随机立减说明';
|
||||
comment on column market_commission_operation_log.source_type is '来源类型 0-商城订单 1-发放运营佣金';
|
||||
comment on column market_commission_operation_log.source_id is '来源id';
|
||||
comment on column market_commission_operation_log.source_detail is '来源详情';
|
||||
comment on column market_commission_operation_log.type is '类型 1-收入 2-支出';
|
||||
comment on column market_commission_operation_log.is_complete is '0-未完成 1-已完成';
|
||||
comment on column market_commission_operation_log.statistical_date is '统计时间';
|
||||
comment on column market_commission_operation_log.remark is '备注';
|
||||
comment on column market_commission_operation_log.create_user is '创建人';
|
||||
comment on column market_commission_operation_log.create_dept is '创建部门';
|
||||
comment on column market_commission_operation_log.create_time is '创建时间';
|
||||
comment on column market_commission_operation_log.update_user is '修改人';
|
||||
comment on column market_commission_operation_log.update_time is '修改时间';
|
||||
comment on column market_commission_operation_log.status is '状态';
|
||||
comment on column market_commission_operation_log.is_deleted is '是否已删除';
|
||||
|
||||
alter table market_commission_operation_log
|
||||
owner to yicha1lu;
|
||||
|
||||
-- 5%广告补贴佣金流水表
|
||||
DROP TABLE IF EXISTS market_commission_advertising_log;
|
||||
create table market_commission_advertising_log
|
||||
(
|
||||
id int8 not null primary key,
|
||||
account_id int8, -- 佣金账户id
|
||||
amount decimal(14, 2) default 0, -- 变动金额
|
||||
last_amount decimal(14, 2) default 0, -- 上一笔金额
|
||||
source_type int4, -- 来源类型 0-商城订单 1-发放广告佣金
|
||||
source_id int8, -- 来源id
|
||||
source_detail text, -- 来源详情
|
||||
type int4 default 1, -- 类型 1-收入 2-支出
|
||||
is_complete int4 default 0, -- 0-未完成 1-已完成
|
||||
statistical_date timestamp(6), -- 统计时间
|
||||
remark text, -- 备注
|
||||
create_user int8,
|
||||
create_dept int8,
|
||||
create_time timestamp(6),
|
||||
update_user int8,
|
||||
update_time timestamp(6),
|
||||
status int4 default 1,
|
||||
is_deleted int4 default 0
|
||||
);
|
||||
|
||||
create index idx_mcal_aid
|
||||
on market_commission_advertising_log (is_complete, account_id, type, statistical_date , create_time DESC);
|
||||
|
||||
comment on table market_commission_advertising_log is '5%广告补贴佣金流水表';
|
||||
comment on column market_commission_advertising_log.id is '主键';
|
||||
comment on column market_commission_advertising_log.account_id is '账户id';
|
||||
comment on column market_commission_advertising_log.amount is '变动金额';
|
||||
comment on column market_commission_advertising_log.last_amount is '上笔金额';
|
||||
comment on column market_commission_advertising_log.source_type is '来源类型 0-商城订单 1-发放广告佣金';
|
||||
comment on column market_commission_advertising_log.source_id is '来源id';
|
||||
comment on column market_commission_advertising_log.source_detail is '来源详情';
|
||||
comment on column market_commission_advertising_log.type is '类型 1-收入 2-支出';
|
||||
comment on column market_commission_advertising_log.is_complete is '0-未完成 1-已完成';
|
||||
comment on column market_commission_advertising_log.statistical_date is '统计时间';
|
||||
comment on column market_commission_advertising_log.remark is '备注';
|
||||
comment on column market_commission_advertising_log.create_user is '创建人';
|
||||
comment on column market_commission_advertising_log.create_dept is '创建部门';
|
||||
comment on column market_commission_advertising_log.create_time is '创建时间';
|
||||
comment on column market_commission_advertising_log.update_user is '修改人';
|
||||
comment on column market_commission_advertising_log.update_time is '修改时间';
|
||||
comment on column market_commission_advertising_log.status is '状态';
|
||||
comment on column market_commission_advertising_log.is_deleted is '是否已删除';
|
||||
|
||||
alter table market_commission_advertising_log
|
||||
owner to yicha1lu;
|
||||
|
||||
-- 5%服务商佣金流水表
|
||||
DROP TABLE IF EXISTS market_commission_service_provider_log;
|
||||
create table market_commission_service_provider_log
|
||||
(
|
||||
id int8 not null primary key,
|
||||
account_id int8, -- 佣金账户id
|
||||
user_id int8, -- 用户id
|
||||
amount decimal(14, 2) default 0, -- 变动金额
|
||||
last_amount decimal(14, 2) default 0, -- 上一笔金额
|
||||
source_type int4, -- 来源类型 0-商城订单 1-发放服务商佣金
|
||||
source_id int8, -- 来源id
|
||||
source_detail text, -- 来源详情
|
||||
type int4 default 1, -- 类型 1-收入 2-支出
|
||||
is_complete int4 default 0, -- 0-未完成 1-已完成
|
||||
is_salary_paid int4 default 0, -- 金额是否发放到用户 0-否 1-是
|
||||
statistical_date timestamp(6), -- 统计时间
|
||||
address_id int8, -- 收货地址id
|
||||
region_id int4, -- 区域id
|
||||
service_provider_id int8, -- 服务商id
|
||||
service_type int4, -- 服务类型
|
||||
remark text, -- 备注
|
||||
create_user int8,
|
||||
create_dept int8,
|
||||
create_time timestamp(6),
|
||||
update_user int8,
|
||||
update_time timestamp(6),
|
||||
status int4 default 1,
|
||||
is_deleted int4 default 0
|
||||
);
|
||||
|
||||
create index idx_mcspl_uid
|
||||
on market_commission_service_provider_log (is_complete, user_id, type, statistical_date, create_time DESC);
|
||||
create index idx_mcspl_aid
|
||||
on market_commission_service_provider_log (is_complete, account_id , type, statistical_date, create_time DESC);
|
||||
|
||||
comment on table market_commission_service_provider_log is '5%服务商佣金流水表';
|
||||
comment on column market_commission_service_provider_log.id is '主键';
|
||||
comment on column market_commission_service_provider_log.account_id is '账户id';
|
||||
comment on column market_commission_service_provider_log.user_id is '用户id';
|
||||
comment on column market_commission_service_provider_log.amount is '变动金额';
|
||||
comment on column market_commission_service_provider_log.last_amount is '上笔金额';
|
||||
comment on column market_commission_service_provider_log.source_type is '来源类型 0-商城订单 1-发放服务商佣金';
|
||||
comment on column market_commission_service_provider_log.source_id is '来源id';
|
||||
comment on column market_commission_service_provider_log.source_detail is '来源详情';
|
||||
comment on column market_commission_service_provider_log.type is '类型 1-收入 2-支出';
|
||||
comment on column market_commission_service_provider_log.is_complete is '0-未完成 1-已完成';
|
||||
comment on column market_commission_service_provider_log.is_salary_paid is '金额是否发放到用户 0-否 1-是';
|
||||
comment on column market_commission_service_provider_log.statistical_date is '统计时间';
|
||||
comment on column market_commission_service_provider_log.address_id is '收货地址id';
|
||||
comment on column market_commission_service_provider_log.region_id is '省市区id';
|
||||
comment on column market_commission_service_provider_log.service_type is '服务类型';
|
||||
comment on column market_commission_service_provider_log.service_provider_id is '服务商ID';
|
||||
comment on column market_commission_service_provider_log.remark is '备注';
|
||||
comment on column market_commission_service_provider_log.create_user is '创建人';
|
||||
comment on column market_commission_service_provider_log.create_dept is '创建部门';
|
||||
comment on column market_commission_service_provider_log.create_time is '创建时间';
|
||||
comment on column market_commission_service_provider_log.update_user is '修改人';
|
||||
comment on column market_commission_service_provider_log.update_time is '修改时间';
|
||||
comment on column market_commission_service_provider_log.status is '状态';
|
||||
comment on column market_commission_service_provider_log.is_deleted is '是否已删除';
|
||||
|
||||
alter table market_commission_service_provider_log
|
||||
owner to yicha1lu;
|
||||
|
||||
-- 15%极差代理佣金流水表
|
||||
DROP TABLE IF EXISTS market_commission_agency_log;
|
||||
create table market_commission_agency_log
|
||||
(
|
||||
id int8 not null primary key,
|
||||
account_id int8, -- 佣金账户id
|
||||
user_id int8, -- 用户id
|
||||
amount decimal(14, 2) default 0, -- 变动金额
|
||||
last_amount decimal(14, 2) default 0, -- 上一笔金额
|
||||
source_type int4, -- 来源类型 0-商城订单 1-发放极差代理佣金
|
||||
source_id int8, -- 来源id
|
||||
source_detail text, -- 来源详情
|
||||
type int4 default 1, -- 类型 1-收入 2-支出
|
||||
is_complete int4 default 0, -- 0-未完成 1-已完成
|
||||
statistical_date timestamp(6), -- 统计时间
|
||||
remark text, -- 备注
|
||||
create_user int8,
|
||||
create_dept int8,
|
||||
create_time timestamp(6),
|
||||
update_user int8,
|
||||
update_time timestamp(6),
|
||||
status int4 default 1,
|
||||
is_deleted int4 default 0
|
||||
);
|
||||
|
||||
create index idx_mc_agency_uid
|
||||
on market_commission_agency_log (is_complete, user_id, type, statistical_date, create_time DESC);
|
||||
create index idx_mc_agency_aid
|
||||
on market_commission_agency_log (is_complete, account_id , type, statistical_date, create_time DESC);
|
||||
|
||||
comment on table market_commission_agency_log is '15%极差代理佣金流水表';
|
||||
comment on column market_commission_agency_log.id is '主键';
|
||||
comment on column market_commission_agency_log.id is '主键';
|
||||
comment on column market_commission_agency_log.account_id is '账户id';
|
||||
comment on column market_commission_agency_log.user_id is '用户id';
|
||||
comment on column market_commission_agency_log.amount is '变动金额';
|
||||
comment on column market_commission_agency_log.last_amount is '上笔金额';
|
||||
comment on column market_commission_agency_log.source_type is '来源类型 0-商城订单 1-发放极差代理佣金';
|
||||
comment on column market_commission_agency_log.source_id is '来源id';
|
||||
comment on column market_commission_agency_log.source_detail is '来源详情';
|
||||
comment on column market_commission_agency_log.type is '类型 1-收入 2-支出';
|
||||
comment on column market_commission_agency_log.is_complete is '0-未完成 1-已完成';
|
||||
comment on column market_commission_agency_log.statistical_date is '统计时间';
|
||||
comment on column market_commission_agency_log.remark is '备注';
|
||||
comment on column market_commission_agency_log.create_user is '创建人';
|
||||
comment on column market_commission_agency_log.create_dept is '创建部门';
|
||||
comment on column market_commission_agency_log.create_time is '创建时间';
|
||||
comment on column market_commission_agency_log.update_user is '修改人';
|
||||
comment on column market_commission_agency_log.update_time is '修改时间';
|
||||
comment on column market_commission_agency_log.status is '状态';
|
||||
comment on column market_commission_agency_log.is_deleted is '是否已删除';
|
||||
|
||||
alter table market_commission_agency_log
|
||||
owner to yicha1lu;
|
||||
|
||||
-- 5%联创佣金流水表
|
||||
DROP TABLE IF EXISTS market_commission_co_creator_log;
|
||||
create table market_commission_co_creator_log
|
||||
(
|
||||
id int8 not null primary key,
|
||||
account_id int8, -- 佣金账户id
|
||||
amount decimal(14, 2) default 0, -- 变动金额
|
||||
last_amount decimal(14, 2) default 0, -- 上一笔金额
|
||||
source_type int4, -- 来源类型 0-商城订单 1-发放联创佣金
|
||||
source_id int8, -- 来源id
|
||||
source_detail text, -- 来源详情
|
||||
type int4 default 1, -- 类型 1-收入 2-支出
|
||||
is_complete int4 default 0, -- 0-未完成 1-已完成
|
||||
statistical_date timestamp(6), -- 统计时间
|
||||
remark text, -- 备注
|
||||
create_user int8,
|
||||
create_dept int8,
|
||||
create_time timestamp(6),
|
||||
update_user int8,
|
||||
update_time timestamp(6),
|
||||
status int4 default 1,
|
||||
is_deleted int4 default 0
|
||||
);
|
||||
|
||||
create index idx_mcccl_aid
|
||||
on market_commission_co_creator_log (is_complete, account_id, statistical_date, type , create_time DESC);
|
||||
|
||||
comment on table market_commission_co_creator_log is '5%联创佣金流水表';
|
||||
comment on column market_commission_co_creator_log.id is '主键';
|
||||
comment on column market_commission_co_creator_log.account_id is '账户id';
|
||||
comment on column market_commission_co_creator_log.amount is '变动金额';
|
||||
comment on column market_commission_co_creator_log.last_amount is '上笔金额';
|
||||
comment on column market_commission_co_creator_log.source_type is '来源类型 0-商城订单 1-发放联创佣金';
|
||||
comment on column market_commission_co_creator_log.source_id is '来源id';
|
||||
comment on column market_commission_co_creator_log.source_detail is '来源详情';
|
||||
comment on column market_commission_co_creator_log.type is '类型 1-收入 2-支出';
|
||||
comment on column market_commission_co_creator_log.is_complete is '0-未完成 1-已完成';
|
||||
comment on column market_commission_co_creator_log.statistical_date is '统计时间';
|
||||
comment on column market_commission_co_creator_log.remark is '备注';
|
||||
comment on column market_commission_co_creator_log.create_user is '创建人';
|
||||
comment on column market_commission_co_creator_log.create_dept is '创建部门';
|
||||
comment on column market_commission_co_creator_log.create_time is '创建时间';
|
||||
comment on column market_commission_co_creator_log.update_user is '修改人';
|
||||
comment on column market_commission_co_creator_log.update_time is '修改时间';
|
||||
comment on column market_commission_co_creator_log.status is '状态';
|
||||
comment on column market_commission_co_creator_log.is_deleted is '是否已删除';
|
||||
|
||||
alter table market_commission_co_creator_log
|
||||
owner to yicha1lu;
|
||||
@@ -1,244 +0,0 @@
|
||||
--- 福利积分 benefit_point
|
||||
DROP TABLE IF EXISTS benefit_point;
|
||||
create table benefit_point
|
||||
(
|
||||
id int8 not null primary key,
|
||||
amount decimal(14, 2) default 0,
|
||||
version int4 default 1,
|
||||
create_user int8,
|
||||
create_dept int8,
|
||||
create_time timestamp(6),
|
||||
update_user int8,
|
||||
update_time timestamp(6),
|
||||
status int4 default 1,
|
||||
is_deleted int4 default 0
|
||||
);
|
||||
|
||||
|
||||
comment on table benefit_point is '用户福利值表';
|
||||
comment on column benefit_point.id is '主键(用户id)';
|
||||
comment on column benefit_point.amount is '金额';
|
||||
comment on column benefit_point.version is '版本号';
|
||||
comment on column benefit_point.create_user is '创建人';
|
||||
comment on column benefit_point.create_dept is '创建部门';
|
||||
comment on column benefit_point.create_time is '创建时间';
|
||||
comment on column benefit_point.update_user is '修改人';
|
||||
comment on column benefit_point.update_time is '修改时间';
|
||||
comment on column benefit_point.status is '状态';
|
||||
comment on column benefit_point.is_deleted is '是否已删除';
|
||||
|
||||
alter table benefit_point
|
||||
owner to yicha1lu;
|
||||
|
||||
DROP TABLE IF EXISTS benefit_point_log;
|
||||
create table benefit_point_log
|
||||
(
|
||||
id int8 not null primary key,
|
||||
user_id int8,
|
||||
amount decimal(14, 2) default 0,
|
||||
last_amount decimal(14, 2) default 0, -- 上一笔金额
|
||||
fee decimal(14, 2) default 0,
|
||||
source_type int4, -- 来源类型 0-福利包产出 1-福利包兑换 2-用户直推 3-otc交易
|
||||
source_id int8,
|
||||
source_detail text,
|
||||
type int4 default 1,
|
||||
is_complete int4 default 0, -- 0-未完成 1-已完成
|
||||
statistical_date timestamp(6),
|
||||
remark text,
|
||||
create_user int8,
|
||||
create_dept int8,
|
||||
create_time timestamp(6),
|
||||
update_user int8,
|
||||
update_time timestamp(6),
|
||||
status int4 default 1,
|
||||
is_deleted int4 default 0
|
||||
);
|
||||
create index idx_umbl_uid
|
||||
on benefit_point_log (is_complete, user_id, type, statistical_date, create_time DESC);
|
||||
|
||||
comment on table benefit_point_log is '用户福利值流水表';
|
||||
comment on column benefit_point_log.id is '主键';
|
||||
comment on column benefit_point_log.user_id is '用户id';
|
||||
comment on column benefit_point_log.amount is '金额';
|
||||
comment on column benefit_point_log.last_amount is '上一笔金额';
|
||||
comment on column benefit_point_log.fee is '手续费';
|
||||
comment on column benefit_point_log.source_type is '来源类型 0-福利包产出 1-福利包兑换 2-用户直推 3-otc交易';
|
||||
comment on column benefit_point_log.source_id is '来源id';
|
||||
comment on column benefit_point_log.source_detail is '来源详情';
|
||||
comment on column benefit_point_log.type is '消费类型 1-收入 2-支出';
|
||||
comment on column benefit_point_log.is_complete is '是否完成 0-未完成 1-已完成';
|
||||
comment on column benefit_point_log.statistical_date is '统计时间';
|
||||
comment on column benefit_point_log.remark is '备注';
|
||||
comment on column benefit_point_log.create_user is '创建人';
|
||||
comment on column benefit_point_log.create_dept is '创建部门';
|
||||
comment on column benefit_point_log.create_time is '创建时间';
|
||||
comment on column benefit_point_log.update_user is '修改人';
|
||||
comment on column benefit_point_log.update_time is '修改时间';
|
||||
comment on column benefit_point_log.status is '状态';
|
||||
comment on column benefit_point_log.is_deleted is '是否已删除';
|
||||
alter table benefit_point_log
|
||||
owner to yicha1lu;
|
||||
|
||||
|
||||
--- 现金券 cash_coupon
|
||||
DROP TABLE IF EXISTS cash_coupon;
|
||||
create table cash_coupon
|
||||
(
|
||||
id int8 not null primary key,
|
||||
amount decimal(14, 2) default 0,
|
||||
version int4 default 1,
|
||||
create_user int8,
|
||||
create_dept int8,
|
||||
create_time timestamp(6),
|
||||
update_user int8,
|
||||
update_time timestamp(6),
|
||||
status int4 default 1,
|
||||
is_deleted int4 default 0
|
||||
);
|
||||
|
||||
|
||||
comment on table cash_coupon is '用户现金券表';
|
||||
comment on column cash_coupon.id is '主键(用户id)';
|
||||
comment on column cash_coupon.amount is '面额';
|
||||
comment on column cash_coupon.version is '版本号';
|
||||
comment on column cash_coupon.create_user is '创建人';
|
||||
comment on column cash_coupon.create_dept is '创建部门';
|
||||
comment on column cash_coupon.create_time is '创建时间';
|
||||
comment on column cash_coupon.update_user is '修改人';
|
||||
comment on column cash_coupon.update_time is '修改时间';
|
||||
comment on column cash_coupon.status is '状态';
|
||||
comment on column cash_coupon.is_deleted is '是否已删除';
|
||||
|
||||
alter table cash_coupon
|
||||
owner to yicha1lu;
|
||||
|
||||
DROP TABLE IF EXISTS cash_coupon_log;
|
||||
create table cash_coupon_log
|
||||
(
|
||||
id int8 not null primary key,
|
||||
user_id int8,
|
||||
amount decimal(14, 2) default 0,
|
||||
last_amount decimal(14, 2) default 0, -- 上一笔金额
|
||||
source_type int4, -- 来源类型 0-商城抽奖 1-福利包兑换
|
||||
source_id int8,
|
||||
source_detail text,
|
||||
type int4 default 1,
|
||||
is_complete int4 default 0, -- 0-未完成 1-已完成
|
||||
statistical_date timestamp(6),
|
||||
remark text,
|
||||
create_user int8,
|
||||
create_dept int8,
|
||||
create_time timestamp(6),
|
||||
update_user int8,
|
||||
update_time timestamp(6),
|
||||
status int4 default 1,
|
||||
is_deleted int4 default 0
|
||||
);
|
||||
|
||||
create index idx_umcl_uid
|
||||
on cash_coupon_log (is_complete, user_id, type, statistical_date, create_time DESC);
|
||||
|
||||
comment on table cash_coupon_log is '用户现金券流水表';
|
||||
comment on column cash_coupon_log.id is '主键';
|
||||
comment on column cash_coupon_log.user_id is '用户id';
|
||||
comment on column cash_coupon_log.amount is '金额';
|
||||
comment on column cash_coupon_log.last_amount is '上一笔金额';
|
||||
comment on column cash_coupon_log.source_type is '来源类型 0-商城抽奖 1-福利包兑换';
|
||||
comment on column cash_coupon_log.source_id is '来源id';
|
||||
comment on column cash_coupon_log.source_detail is '来源详情';
|
||||
comment on column cash_coupon_log.type is '消费类型 1-收入 2-支出';
|
||||
comment on column cash_coupon_log.statistical_date is '统计时间';
|
||||
comment on column cash_coupon_log.is_complete is '是否完成 0-未完成 1-已完成';
|
||||
comment on column cash_coupon_log.remark is '备注';
|
||||
comment on column cash_coupon_log.create_user is '创建人';
|
||||
comment on column cash_coupon_log.create_dept is '创建部门';
|
||||
comment on column cash_coupon_log.create_time is '创建时间';
|
||||
comment on column cash_coupon_log.update_user is '修改人';
|
||||
comment on column cash_coupon_log.update_time is '修改时间';
|
||||
comment on column cash_coupon_log.status is '状态';
|
||||
comment on column cash_coupon_log.is_deleted is '是否已删除';
|
||||
|
||||
alter table cash_coupon_log
|
||||
owner to yicha1lu;
|
||||
|
||||
|
||||
--- 用户积分 user_point
|
||||
DROP TABLE IF EXISTS user_point;
|
||||
create table user_point
|
||||
(
|
||||
id int8 not null primary key,
|
||||
amount decimal(14, 2) default 0,
|
||||
version int4 default 1,
|
||||
create_user int8,
|
||||
create_dept int8,
|
||||
create_time timestamp(6),
|
||||
update_user int8,
|
||||
update_time timestamp(6),
|
||||
status int4 default 1,
|
||||
is_deleted int4 default 0
|
||||
);
|
||||
|
||||
|
||||
comment on table user_point is '用户商城积分表';
|
||||
comment on column user_point.id is '主键(用户id)';
|
||||
comment on column user_point.amount is '面额';
|
||||
comment on column user_point.version is '版本号';
|
||||
comment on column user_point.create_user is '创建人';
|
||||
comment on column user_point.create_dept is '创建部门';
|
||||
comment on column user_point.create_time is '创建时间';
|
||||
comment on column user_point.update_user is '修改人';
|
||||
comment on column user_point.update_time is '修改时间';
|
||||
comment on column user_point.is_deleted is '是否已删除';
|
||||
|
||||
alter table user_point
|
||||
owner to yicha1lu;
|
||||
|
||||
DROP TABLE IF EXISTS user_point_log;
|
||||
create table user_point_log
|
||||
(
|
||||
id int8 not null primary key,
|
||||
user_id int8,
|
||||
amount decimal(14, 2) default 0,
|
||||
last_amount decimal(14, 2) default 0, -- 上一笔金额
|
||||
source_type int4, -- 来源类型 0-商城订单 1-商城抽奖
|
||||
source_id int8,
|
||||
source_detail text,
|
||||
type int4 default 1,
|
||||
is_complete int4 default 0, -- 0-未完成 1-已完成
|
||||
statistical_date timestamp(6),
|
||||
remark text,
|
||||
create_user int8,
|
||||
create_dept int8,
|
||||
create_time timestamp(6),
|
||||
update_user int8,
|
||||
update_time timestamp(6),
|
||||
status int4 default 1,
|
||||
is_deleted int4 default 0
|
||||
);
|
||||
|
||||
create index idx_uapl_uid
|
||||
on user_point_log (is_complete, user_id, type, statistical_date, create_time DESC);
|
||||
|
||||
comment on table user_point_log is '用户商城积分流水表';
|
||||
comment on column user_point_log.id is '主键';
|
||||
comment on column user_point_log.user_id is '用户id';
|
||||
comment on column user_point_log.amount is '金额';
|
||||
comment on column user_point_log.last_amount is '上一笔金额';
|
||||
comment on column user_point_log.source_type is '0-商城订单 1-商城抽奖';
|
||||
comment on column user_point_log.source_id is '来源id';
|
||||
comment on column user_point_log.source_detail is '来源详情';
|
||||
comment on column user_point_log.type is '消费类型 1-收入 2-支出';
|
||||
comment on column user_point_log.statistical_date is '统计时间';
|
||||
comment on column user_point_log.is_complete is '是否完成 0-未完成 1-已完成';
|
||||
comment on column user_point_log.remark is '备注';
|
||||
comment on column user_point_log.create_user is '创建人';
|
||||
comment on column user_point_log.create_dept is '创建部门';
|
||||
comment on column user_point_log.create_time is '创建时间';
|
||||
comment on column user_point_log.update_user is '修改人';
|
||||
comment on column user_point_log.update_time is '修改时间';
|
||||
comment on column user_point_log.status is '状态';
|
||||
comment on column user_point_log.is_deleted is '是否已删除';
|
||||
|
||||
alter table user_point_log
|
||||
owner to yicha1lu;
|
||||
|
||||
Reference in New Issue
Block a user