You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

190 lines
12 KiB
Java

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

--
alter table member_point_config
add column brokerage_enabled bit default 1 not null comment '';
alter table member_point_config
add column brokerage_enabled_condition tinyint default 0 not null comment '0- 1-';
alter table member_point_config
add column brokerage_bind_mode tinyint default 0 not null comment ': 0-广1-';
alter table member_point_config
add column brokerage_post_urls varchar(2000) null comment '';
alter table member_point_config
add column brokerage_first_percent int not null comment '';
alter table member_point_config
add column brokerage_second_percent int not null comment '';
alter table member_point_config
add column brokerage_withdraw_min_price int not null comment '';
alter table member_point_config
add column brokerage_bank_names varchar(200) not null comment '=brokerage_bank_name';
alter table member_point_config
add column brokerage_frozen_days int default 7 not null comment '()';
alter table member_point_config
add column brokerage_withdraw_type varchar(32) default '1,2,3,4' not null comment '1-2-3-4-';
--
alter table member_user
add column brokerage_user_id bigint not null comment '广';
alter table member_user
add column brokerage_bind_time datetime null comment '广';
alter table member_user
add column brokerage_enabled bit default 1 not null comment '广';
alter table member_user
add column brokerage_time datetime null comment '';
alter table member_user
add column brokerage_price int default 0 not null comment '';
alter table member_user
add column frozen_brokerage_price int default 0 not null comment '';
create index idx_invite_user_id on member_user (brokerage_user_id) comment '广';
create index idx_agent on member_user (brokerage_enabled) comment '广';
create table member_brokerage_record
(
id int auto_increment comment ''
primary key,
user_id bigint not null comment '',
biz_id varchar(64) default '' not null comment '',
biz_type tinyint default 0 not null comment '0-1-',
title varchar(64) default '' not null comment '',
price int default 0 not null comment '',
total_price int default 0 not null comment '',
description varchar(500) default '' not null comment '',
status tinyint default 0 not null comment '0-1-2-',
frozen_days int default 0 not null comment '',
unfreeze_time datetime null comment '',
creator varchar(64) collate utf8mb4_general_ci default '' null comment '',
create_time datetime default CURRENT_TIMESTAMP not null comment '',
updater varchar(64) collate utf8mb4_general_ci default '' null comment '',
update_time datetime default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '',
deleted bit default b'0' not null comment '',
tenant_id bigint default 0 not null comment ''
)
comment '';
create index idx_user_id on member_brokerage_record (user_id) comment '';
create index idx_biz on member_brokerage_record (biz_type, biz_id) comment '';
create index idx_status on member_brokerage_record (status) comment '';
create table member_brokerage_withdraw
(
id int auto_increment comment ''
primary key,
user_id bigint not null comment '',
price int default 0 not null comment '',
fee_price int default 0 not null comment '',
total_price int default 0 not null comment '',
type tinyint default 0 not null comment '1-2-3-4-',
name varchar(64) null comment '',
account_no varchar(64) null comment '',
bank_name varchar(100) null comment '',
bank_address varchar(200) null comment '',
account_qr_code_url varchar(512) null comment '',
status tinyint(2) default 0 not null comment '0-10- 20-11 - 21-',
audit_reason varchar(128) null comment '',
audit_time datetime null comment '',
remark varchar(500) null comment '',
creator varchar(64) collate utf8mb4_general_ci default '' null comment '',
create_time datetime default CURRENT_TIMESTAMP not null comment '',
updater varchar(64) collate utf8mb4_general_ci default '' null comment '',
update_time datetime default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '',
deleted bit default b'0' not null comment '',
tenant_id bigint default 0 not null comment ''
)
comment '';
create index idx_user_id on member_brokerage_withdraw (user_id) comment '';
create index idx_audit_status on member_brokerage_withdraw (status) comment '';
--
insert into system_dict_type(type, name)
values ('brokerage_enabled_condition', '');
insert into system_dict_data(dict_type, label, value, sort, remark)
values ('brokerage_enabled_condition', '', 0, 0, ''),
('brokerage_enabled_condition', '', 1, 1, '广');
insert into system_dict_type(type, name)
values ('brokerage_bind_mode', '');
insert into system_dict_data(dict_type, label, value, sort, remark)
values ('brokerage_bind_mode', '广', 0, 0, '广广'),
('brokerage_bind_mode', '', 1, 1, '广');
insert into system_dict_type(type, name)
values ('brokerage_withdraw_type', '');
insert into system_dict_data(dict_type, label, value, sort)
values ('brokerage_withdraw_type', '', 1, 1),
('brokerage_withdraw_type', '', 2, 2),
('brokerage_withdraw_type', '', 3, 3),
('brokerage_withdraw_type', '', 4, 4);
insert into system_dict_type(type, name)
values ('brokerage_record_biz_type', '');
insert into system_dict_data(dict_type, label, value, sort)
values ('brokerage_record_biz_type', '', 0, 0),
('brokerage_record_biz_type', '', 1, 1);
insert into system_dict_type(type, name)
values ('brokerage_record_status', '');
insert into system_dict_data(dict_type, label, value, sort)
values ('brokerage_record_status', '', 0, 0),
('brokerage_record_status', '', 1, 1),
('brokerage_record_status', '', 2, 2);
insert into system_dict_type(type, name)
values ('brokerage_withdraw_status', '');
insert into system_dict_data(dict_type, label, value, sort)
values ('brokerage_withdraw_status', '', 0, 0),
('brokerage_withdraw_status', '', 10, 10),
('brokerage_withdraw_status', '', 11, 11),
('brokerage_withdraw_status', '', 20, 20),
('brokerage_withdraw_status', '', 21, 21);
insert into system_dict_type(type, name)
values ('brokerage_bank_name', '');
insert into system_dict_data(dict_type, label, value, sort)
values ('brokerage_bank_name', '', 0, 0),
('brokerage_bank_name', '', 1, 1),
('brokerage_bank_name', '', 2, 2),
('brokerage_bank_name', '', 3, 3),
('brokerage_bank_name', '', 4, 4),
('brokerage_bank_name', '', 5, 5);
--
INSERT INTO system_menu(name, permission, type, sort, parent_id, path, icon, component, status, component_name)
VALUES ('', '', 2, 7, 2262, 'brokerage', 'user', 'member/brokerage/user/index', 0, 'MemberBrokerageUser');
-- ID
SELECT @parentId := LAST_INSERT_ID();
-- SQL
INSERT INTO system_menu(name, permission, type, sort, parent_id, path, icon, component, status)
VALUES ('', 'member:brokerage-user:query', 3, 1, @parentId, '', '', '', 0);
INSERT INTO system_menu(name, permission, type, sort, parent_id, path, icon, component, status)
VALUES ('', 'member:brokerage-user:create', 3, 2, @parentId, '', '', '', 0);
INSERT INTO system_menu(name, permission, type, sort, parent_id, path, icon, component, status)
VALUES ('', 'member:brokerage-user:update', 3, 3, @parentId, '', '', '', 0);
INSERT INTO system_menu(name, permission, type, sort, parent_id, path, icon, component, status)
VALUES ('', 'member:brokerage-user:delete', 3, 4, @parentId, '', '', '', 0);
--
INSERT INTO system_menu(name, permission, type, sort, parent_id, path, icon, component, status, component_name)
VALUES ('', '', 2, 8, 2262, 'brokerage-record', 'list', 'member/brokerage/record/index', 0,
'MemberBrokerageRecord');
-- ID
-- MySQL OraclePostgreSQLSQLServer @parentId
SELECT @parentId := LAST_INSERT_ID();
-- SQL
INSERT INTO system_menu(name, permission, type, sort, parent_id, path, icon, component, status)
VALUES ('', 'member:member-brokerage-record:query', 3, 1, @parentId, '', 'table', '', 0);
--
INSERT INTO system_menu(name, permission, type, sort, parent_id, path, icon, component, status, component_name)
VALUES ('', '', 2, 9, 2262, 'brokerage-withdraw', '', 'member/brokerage/withdraw/index', 0,
'MemberBrokerageWithdraw');
-- ID
-- MySQL OraclePostgreSQLSQLServer @parentId
SELECT @parentId := LAST_INSERT_ID();
-- SQL
INSERT INTO system_menu(name, permission, type, sort, parent_id, path, icon, component, status)
VALUES ('', 'member:brokerage-withdraw:query', 3, 1, @parentId, '', '', '', 0);