feat: expand EasyCode software factory workflows
This commit is contained in:
@@ -1,4 +0,0 @@
|
||||
-- ----------------------------
|
||||
-- 为gen_table表添加create_table_sql字段
|
||||
-- ----------------------------
|
||||
ALTER TABLE gen_table ADD COLUMN create_table_sql LONGTEXT COMMENT '建表SQL语句';
|
||||
File diff suppressed because it is too large
Load Diff
3174
RuoYi-Vue/sql/db_2026-07-15.sql
Normal file
3174
RuoYi-Vue/sql/db_2026-07-15.sql
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
@@ -1,77 +0,0 @@
|
||||
-- EasyCode front AI task center incremental upgrade
|
||||
|
||||
create table if not exists front_ai_generation_task (
|
||||
task_id bigint(20) not null auto_increment comment 'AI task ID',
|
||||
generation_id bigint(20) default null comment 'Generation record ID',
|
||||
project_id bigint(20) not null comment 'Project ID',
|
||||
user_id bigint(20) not null comment 'Front user ID',
|
||||
generate_type varchar(50) not null comment 'Generation type',
|
||||
provider varchar(50) default 'deepseek' comment 'AI provider',
|
||||
model varchar(100) default 'deepseek-chat' comment 'AI model',
|
||||
status varchar(30) not null default 'QUEUED' comment 'Task status',
|
||||
request_hash varchar(64) not null comment 'Request idempotency hash',
|
||||
request_payload longtext comment 'Request JSON',
|
||||
result_payload longtext comment 'Result JSON',
|
||||
error_code varchar(100) default '' comment 'Error code',
|
||||
error_message varchar(1000) default '' comment 'Error message',
|
||||
attempts int default 0 comment 'Attempt count',
|
||||
max_attempts int default 3 comment 'Max attempts',
|
||||
next_retry_time datetime default null comment 'Next retry time',
|
||||
locked_by varchar(100) default '' comment 'Worker lock owner',
|
||||
locked_until datetime default null comment 'Worker lock expiry',
|
||||
progress int default 0 comment 'Progress percent',
|
||||
current_step varchar(100) default '' comment 'Current step',
|
||||
input_tokens int default 0 comment 'Input tokens',
|
||||
output_tokens int default 0 comment 'Output tokens',
|
||||
total_tokens int default 0 comment 'Total tokens',
|
||||
cost_cents int default 0 comment 'Estimated cost in cents',
|
||||
started_at datetime default null comment 'Started time',
|
||||
finished_at datetime default null comment 'Finished time',
|
||||
create_time datetime default null comment 'Create time',
|
||||
update_time datetime default null comment 'Update time',
|
||||
primary key (task_id),
|
||||
key idx_front_ai_task_project (user_id, project_id),
|
||||
key idx_front_ai_task_status (status, next_retry_time),
|
||||
key idx_front_ai_task_generation (generation_id),
|
||||
key idx_front_ai_task_hash (user_id, project_id, request_hash)
|
||||
) engine=innodb auto_increment=100 default charset=utf8mb4 comment='Front AI generation task';
|
||||
|
||||
create table if not exists front_ai_quota_bucket (
|
||||
bucket_id bigint(20) not null auto_increment comment 'Quota bucket ID',
|
||||
user_id bigint(20) not null comment 'Front user ID',
|
||||
period_type varchar(20) not null comment 'DAY or MONTH',
|
||||
period_key varchar(20) not null comment 'Period key',
|
||||
task_limit int default 0 comment 'Task limit',
|
||||
task_used int default 0 comment 'Used tasks',
|
||||
token_limit int default 0 comment 'Token limit',
|
||||
token_used int default 0 comment 'Used tokens',
|
||||
cost_limit_cents int default 0 comment 'Cost limit in cents',
|
||||
cost_used_cents int default 0 comment 'Used cost in cents',
|
||||
running_limit int default 1 comment 'Running task limit',
|
||||
running_count int default 0 comment 'Running task count',
|
||||
create_time datetime default null comment 'Create time',
|
||||
update_time datetime default null comment 'Update time',
|
||||
primary key (bucket_id),
|
||||
unique key uk_front_ai_quota_bucket (user_id, period_type, period_key)
|
||||
) engine=innodb auto_increment=100 default charset=utf8mb4 comment='Front AI quota bucket';
|
||||
|
||||
create table if not exists front_ai_usage_ledger (
|
||||
ledger_id bigint(20) not null auto_increment comment 'Usage ledger ID',
|
||||
task_id bigint(20) default null comment 'Task ID',
|
||||
generation_id bigint(20) default null comment 'Generation record ID',
|
||||
project_id bigint(20) not null comment 'Project ID',
|
||||
user_id bigint(20) not null comment 'Front user ID',
|
||||
generate_type varchar(50) not null comment 'Generation type',
|
||||
provider varchar(50) default 'deepseek' comment 'AI provider',
|
||||
model varchar(100) default 'deepseek-chat' comment 'AI model',
|
||||
input_tokens int default 0 comment 'Input tokens',
|
||||
output_tokens int default 0 comment 'Output tokens',
|
||||
total_tokens int default 0 comment 'Total tokens',
|
||||
cost_cents int default 0 comment 'Estimated cost in cents',
|
||||
success char(1) default '0' comment 'Success flag',
|
||||
error_message varchar(1000) default '' comment 'Error message',
|
||||
create_time datetime default null comment 'Create time',
|
||||
primary key (ledger_id),
|
||||
key idx_front_ai_usage_user (user_id, create_time),
|
||||
key idx_front_ai_usage_task (task_id)
|
||||
) engine=innodb auto_increment=100 default charset=utf8mb4 comment='Front AI usage ledger';
|
||||
@@ -1,17 +0,0 @@
|
||||
set @front_app_blueprint_exists := (
|
||||
select count(1)
|
||||
from information_schema.columns
|
||||
where table_schema = database()
|
||||
and table_name = 'front_project'
|
||||
and column_name = 'app_blueprint'
|
||||
);
|
||||
|
||||
set @front_app_blueprint_sql := if(
|
||||
@front_app_blueprint_exists = 0,
|
||||
'alter table front_project add column app_blueprint longtext comment ''应用蓝图草稿JSON'' after preview_status',
|
||||
'select ''front_project.app_blueprint already exists'''
|
||||
);
|
||||
|
||||
prepare front_app_blueprint_stmt from @front_app_blueprint_sql;
|
||||
execute front_app_blueprint_stmt;
|
||||
deallocate prepare front_app_blueprint_stmt;
|
||||
@@ -1,3 +0,0 @@
|
||||
-- Run once on existing front workbench databases to persist ER diagram drafts.
|
||||
alter table front_project
|
||||
add column er_diagram longtext comment 'ER diagram draft JSON' after preview_status;
|
||||
@@ -1,146 +0,0 @@
|
||||
-- =================================================
|
||||
-- EasyCode front_project incremental upgrade
|
||||
-- Run once on existing front workbench databases created before the current
|
||||
-- front_project schema. Safe to run repeatedly.
|
||||
-- =================================================
|
||||
|
||||
set @front_project_requirement_keyword_exists := (
|
||||
select count(1)
|
||||
from information_schema.columns
|
||||
where table_schema = database()
|
||||
and table_name = 'front_project'
|
||||
and column_name = 'requirement_keyword'
|
||||
);
|
||||
|
||||
set @front_project_requirement_keyword_sql := if(
|
||||
@front_project_requirement_keyword_exists = 0,
|
||||
'alter table front_project add column requirement_keyword varchar(1000) default '''' comment ''需求关键词'' after project_desc',
|
||||
'select ''front_project.requirement_keyword already exists'''
|
||||
);
|
||||
|
||||
prepare front_project_requirement_keyword_stmt from @front_project_requirement_keyword_sql;
|
||||
execute front_project_requirement_keyword_stmt;
|
||||
deallocate prepare front_project_requirement_keyword_stmt;
|
||||
|
||||
set @front_project_industry_template_exists := (
|
||||
select count(1)
|
||||
from information_schema.columns
|
||||
where table_schema = database()
|
||||
and table_name = 'front_project'
|
||||
and column_name = 'industry_template'
|
||||
);
|
||||
|
||||
set @front_project_industry_template_sql := if(
|
||||
@front_project_industry_template_exists = 0,
|
||||
'alter table front_project add column industry_template varchar(50) default '''' comment ''行业模板'' after requirement_keyword',
|
||||
'select ''front_project.industry_template already exists'''
|
||||
);
|
||||
|
||||
prepare front_project_industry_template_stmt from @front_project_industry_template_sql;
|
||||
execute front_project_industry_template_stmt;
|
||||
deallocate prepare front_project_industry_template_stmt;
|
||||
|
||||
set @front_project_app_blueprint_exists := (
|
||||
select count(1)
|
||||
from information_schema.columns
|
||||
where table_schema = database()
|
||||
and table_name = 'front_project'
|
||||
and column_name = 'app_blueprint'
|
||||
);
|
||||
|
||||
set @front_project_app_blueprint_sql := if(
|
||||
@front_project_app_blueprint_exists = 0,
|
||||
'alter table front_project add column app_blueprint longtext comment ''应用蓝图草稿JSON'' after preview_status',
|
||||
'select ''front_project.app_blueprint already exists'''
|
||||
);
|
||||
|
||||
prepare front_project_app_blueprint_stmt from @front_project_app_blueprint_sql;
|
||||
execute front_project_app_blueprint_stmt;
|
||||
deallocate prepare front_project_app_blueprint_stmt;
|
||||
|
||||
set @front_project_er_diagram_exists := (
|
||||
select count(1)
|
||||
from information_schema.columns
|
||||
where table_schema = database()
|
||||
and table_name = 'front_project'
|
||||
and column_name = 'er_diagram'
|
||||
);
|
||||
|
||||
set @front_project_er_diagram_sql := if(
|
||||
@front_project_er_diagram_exists = 0,
|
||||
'alter table front_project add column er_diagram longtext comment ''ER图草稿JSON'' after app_blueprint',
|
||||
'select ''front_project.er_diagram already exists'''
|
||||
);
|
||||
|
||||
prepare front_project_er_diagram_stmt from @front_project_er_diagram_sql;
|
||||
execute front_project_er_diagram_stmt;
|
||||
deallocate prepare front_project_er_diagram_stmt;
|
||||
|
||||
set @front_project_business_loop_plan_exists := (
|
||||
select count(1)
|
||||
from information_schema.columns
|
||||
where table_schema = database()
|
||||
and table_name = 'front_project'
|
||||
and column_name = 'business_loop_plan'
|
||||
);
|
||||
|
||||
set @front_project_business_loop_plan_sql := if(
|
||||
@front_project_business_loop_plan_exists = 0,
|
||||
'alter table front_project add column business_loop_plan longtext null comment ''业务闭环计划'' after app_blueprint',
|
||||
'select ''front_project.business_loop_plan already exists'''
|
||||
);
|
||||
|
||||
prepare front_project_business_loop_plan_stmt from @front_project_business_loop_plan_sql;
|
||||
execute front_project_business_loop_plan_stmt;
|
||||
deallocate prepare front_project_business_loop_plan_stmt;
|
||||
set @front_project_business_blueprint_exists := (
|
||||
select count(1)
|
||||
from information_schema.columns
|
||||
where table_schema = database()
|
||||
and table_name = 'front_project'
|
||||
and column_name = 'business_blueprint'
|
||||
);
|
||||
|
||||
set @front_project_business_blueprint_sql := if(
|
||||
@front_project_business_blueprint_exists = 0,
|
||||
'alter table front_project add column business_blueprint longtext comment ''业务蓝图草稿JSON'' after er_diagram',
|
||||
'select ''front_project.business_blueprint already exists'''
|
||||
);
|
||||
|
||||
prepare front_project_business_blueprint_stmt from @front_project_business_blueprint_sql;
|
||||
execute front_project_business_blueprint_stmt;
|
||||
deallocate prepare front_project_business_blueprint_stmt;
|
||||
|
||||
set @front_project_frontend_enabled_exists := (
|
||||
select count(1)
|
||||
from information_schema.columns
|
||||
where table_schema = database()
|
||||
and table_name = 'front_project'
|
||||
and column_name = 'frontend_enabled'
|
||||
);
|
||||
|
||||
set @front_project_frontend_enabled_sql := if(
|
||||
@front_project_frontend_enabled_exists = 0,
|
||||
'alter table front_project add column frontend_enabled char(1) default ''1'' comment ''是否生成前台前端(1是 0否)'' after back_framework',
|
||||
'select ''front_project.frontend_enabled already exists'''
|
||||
);
|
||||
|
||||
prepare front_project_frontend_enabled_stmt from @front_project_frontend_enabled_sql;
|
||||
execute front_project_frontend_enabled_stmt;
|
||||
deallocate prepare front_project_frontend_enabled_stmt;
|
||||
|
||||
create table if not exists front_project_module (
|
||||
id bigint(20) not null auto_increment comment 'id',
|
||||
project_id bigint(20) not null comment '前台项目ID',
|
||||
module_id bigint(20) not null comment '功能模块ID',
|
||||
status char(1) default '0' comment '状态(0正常 1停用)',
|
||||
create_time datetime default null comment '创建时间',
|
||||
update_time datetime default null comment '更新时间',
|
||||
remark varchar(500) default null comment '备注',
|
||||
primary key (id),
|
||||
unique key uk_front_project_module (project_id, module_id),
|
||||
key idx_front_project_module_project_id (project_id),
|
||||
key idx_front_project_module_module_id (module_id),
|
||||
constraint fk_front_project_module_project foreign key (project_id) references front_project(project_id),
|
||||
constraint fk_front_project_module_module foreign key (module_id) references sys_module(module_id)
|
||||
) engine=innodb auto_increment=100 default charset=utf8mb4 comment='前台项目功能模块关系';
|
||||
@@ -1,17 +0,0 @@
|
||||
set @front_requirement_keyword_exists := (
|
||||
select count(1)
|
||||
from information_schema.columns
|
||||
where table_schema = database()
|
||||
and table_name = 'front_project'
|
||||
and column_name = 'requirement_keyword'
|
||||
);
|
||||
|
||||
set @front_requirement_keyword_sql := if(
|
||||
@front_requirement_keyword_exists = 0,
|
||||
'alter table front_project add column requirement_keyword varchar(1000) default '''' comment ''需求关键词'' after project_desc',
|
||||
'select ''front_project.requirement_keyword already exists'''
|
||||
);
|
||||
|
||||
prepare front_requirement_keyword_stmt from @front_requirement_keyword_sql;
|
||||
execute front_requirement_keyword_stmt;
|
||||
deallocate prepare front_requirement_keyword_stmt;
|
||||
@@ -1,241 +0,0 @@
|
||||
-- =================================================
|
||||
-- EasyCode front workbench tables
|
||||
-- Import after sql/db.sql, or use the copy appended to sql/db.sql
|
||||
-- =================================================
|
||||
|
||||
drop table if exists front_project_file;
|
||||
drop table if exists front_ai_usage_ledger;
|
||||
drop table if exists front_ai_generation_task;
|
||||
drop table if exists front_ai_quota_bucket;
|
||||
drop table if exists front_project_generation;
|
||||
drop table if exists front_project_column;
|
||||
drop table if exists front_project_table;
|
||||
drop table if exists front_project_module;
|
||||
drop table if exists front_project;
|
||||
drop table if exists front_user;
|
||||
|
||||
create table front_user (
|
||||
user_id bigint(20) not null auto_increment comment '前台用户ID',
|
||||
username varchar(50) not null comment '用户名',
|
||||
password varchar(100) not null comment '密码',
|
||||
nickname varchar(50) default '' comment '昵称',
|
||||
email varchar(100) default '' comment '邮箱',
|
||||
phone varchar(20) default '' comment '手机号',
|
||||
status char(1) default '0' comment '状态(0正常 1停用)',
|
||||
del_flag char(1) default '0' comment '删除标志(0存在 2删除)',
|
||||
last_login_time datetime default null comment '最后登录时间',
|
||||
create_time datetime default null comment '创建时间',
|
||||
update_time datetime default null comment '更新时间',
|
||||
remark varchar(500) default null comment '备注',
|
||||
primary key (user_id),
|
||||
unique key uk_front_user_username (username),
|
||||
key idx_front_user_email (email),
|
||||
key idx_front_user_phone (phone)
|
||||
) engine=innodb auto_increment=100 default charset=utf8mb4 comment='前台用户表';
|
||||
|
||||
create table front_project (
|
||||
project_id bigint(20) not null auto_increment comment '前台项目ID',
|
||||
user_id bigint(20) not null comment '前台用户ID',
|
||||
project_name varchar(100) not null comment '项目名称',
|
||||
project_file_name varchar(100) default '' comment '项目文件名',
|
||||
package_name varchar(100) default 'com.easycode.generated' comment '包名',
|
||||
version varchar(20) default '1.0.0' comment '版本号',
|
||||
project_desc varchar(1000) default '' comment '项目描述',
|
||||
requirement_keyword varchar(1000) default '' comment '需求关键词',
|
||||
industry_template varchar(50) default '' comment '行业模板',
|
||||
front_framework varchar(50) default 'Vue3 + Element Plus' comment '前台框架',
|
||||
back_framework varchar(50) default 'Spring Boot + MyBatis' comment '后端框架',
|
||||
frontend_enabled char(1) default '1' comment '是否生成前台前端(1是 0否)',
|
||||
generate_status char(1) default '0' comment '数据库生成状态(0未生成 1生成中 2已生成 3失败)',
|
||||
preview_status char(1) default '0' comment '预览状态(0未预览 1已预览 2失败)',
|
||||
app_blueprint longtext comment '应用蓝图草稿JSON',
|
||||
er_diagram longtext comment 'ER图草稿JSON',
|
||||
business_blueprint longtext comment '业务蓝图草稿JSON',
|
||||
status char(1) default '0' comment '状态(0正常 1停用)',
|
||||
create_time datetime default null comment '创建时间',
|
||||
update_time datetime default null comment '更新时间',
|
||||
remark varchar(500) default null comment '备注',
|
||||
primary key (project_id),
|
||||
key idx_front_project_user_id (user_id),
|
||||
constraint fk_front_project_user foreign key (user_id) references front_user(user_id)
|
||||
) engine=innodb auto_increment=100 default charset=utf8mb4 comment='前台项目草稿表';
|
||||
|
||||
create table front_project_module (
|
||||
id bigint(20) not null auto_increment comment 'id',
|
||||
project_id bigint(20) not null comment '前台项目ID',
|
||||
module_id bigint(20) not null comment '功能模块ID',
|
||||
status char(1) default '0' comment '状态(0正常 1停用)',
|
||||
create_time datetime default null comment '创建时间',
|
||||
update_time datetime default null comment '更新时间',
|
||||
remark varchar(500) default null comment '备注',
|
||||
primary key (id),
|
||||
unique key uk_front_project_module (project_id, module_id),
|
||||
key idx_front_project_module_project_id (project_id),
|
||||
key idx_front_project_module_module_id (module_id),
|
||||
constraint fk_front_project_module_project foreign key (project_id) references front_project(project_id),
|
||||
constraint fk_front_project_module_module foreign key (module_id) references sys_module(module_id)
|
||||
) engine=innodb auto_increment=100 default charset=utf8mb4 comment='前台项目功能模块关系';
|
||||
|
||||
create table front_project_table (
|
||||
table_id bigint(20) not null auto_increment comment '表设计ID',
|
||||
project_id bigint(20) not null comment '项目ID',
|
||||
user_id bigint(20) not null comment '前台用户ID',
|
||||
table_name varchar(200) not null comment '表名称',
|
||||
table_comment varchar(500) default '' comment '表描述',
|
||||
class_name varchar(100) default '' comment '实体类名称',
|
||||
module_name varchar(30) default '' comment '生成模块名',
|
||||
business_name varchar(30) default '' comment '生成业务名',
|
||||
function_name varchar(50) default '' comment '生成功能名',
|
||||
tpl_category varchar(200) default 'crud' comment '模板类型',
|
||||
tpl_web_type varchar(30) default 'element-plus' comment '前端模板类型',
|
||||
options varchar(1000) default '' comment '生成选项',
|
||||
create_table_sql longtext comment '建表SQL',
|
||||
sort int default 0 comment '排序',
|
||||
status char(1) default '0' comment '状态(0正常 1停用)',
|
||||
create_time datetime default null comment '创建时间',
|
||||
update_time datetime default null comment '更新时间',
|
||||
primary key (table_id),
|
||||
unique key uk_front_project_table (project_id, table_name),
|
||||
key idx_front_project_table_project_id (project_id),
|
||||
constraint fk_front_project_table_project foreign key (project_id) references front_project(project_id)
|
||||
) engine=innodb auto_increment=100 default charset=utf8mb4 comment='前台项目表设计';
|
||||
|
||||
create table front_project_column (
|
||||
column_id bigint(20) not null auto_increment comment '字段设计ID',
|
||||
table_id bigint(20) not null comment '表设计ID',
|
||||
project_id bigint(20) not null comment '项目ID',
|
||||
column_name varchar(200) not null comment '字段名称',
|
||||
column_comment varchar(500) default '' comment '字段描述',
|
||||
column_type varchar(100) not null comment '字段类型',
|
||||
java_type varchar(500) default 'String' comment 'Java类型',
|
||||
java_field varchar(200) default '' comment 'Java字段名',
|
||||
is_pk char(1) default '0' comment '是否主键(1是)',
|
||||
is_increment char(1) default '0' comment '是否自增(1是)',
|
||||
is_required char(1) default '0' comment '是否必填(1是)',
|
||||
is_insert char(1) default '1' comment '是否插入字段(1是)',
|
||||
is_edit char(1) default '1' comment '是否编辑字段(1是)',
|
||||
is_list char(1) default '1' comment '是否列表字段(1是)',
|
||||
is_query char(1) default '0' comment '是否查询字段(1是)',
|
||||
query_type varchar(200) default 'EQ' comment '查询方式',
|
||||
html_type varchar(200) default 'input' comment '显示类型',
|
||||
dict_type varchar(200) default '' comment '字典类型',
|
||||
default_value varchar(200) default null comment '默认值',
|
||||
sort int default 0 comment '排序',
|
||||
create_time datetime default null comment '创建时间',
|
||||
update_time datetime default null comment '更新时间',
|
||||
primary key (column_id),
|
||||
key idx_front_project_column_table_id (table_id),
|
||||
key idx_front_project_column_project_id (project_id),
|
||||
constraint fk_front_project_column_table foreign key (table_id) references front_project_table(table_id)
|
||||
) engine=innodb auto_increment=100 default charset=utf8mb4 comment='前台项目字段设计';
|
||||
|
||||
create table front_project_generation (
|
||||
generation_id bigint(20) not null auto_increment comment '生成记录ID',
|
||||
project_id bigint(20) not null comment '项目ID',
|
||||
user_id bigint(20) not null comment '前台用户ID',
|
||||
generate_type varchar(50) not null comment '生成类型',
|
||||
provider varchar(50) default 'deepseek' comment 'AI提供方',
|
||||
prompt_summary varchar(500) default '' comment 'Prompt摘要',
|
||||
request_payload longtext comment '请求内容',
|
||||
response_payload longtext comment '响应内容',
|
||||
success char(1) default '0' comment '是否成功(1成功 0失败)',
|
||||
error_message varchar(1000) default '' comment '错误信息',
|
||||
token_usage int default 0 comment 'Token用量',
|
||||
elapsed_ms bigint(20) default 0 comment '耗时毫秒',
|
||||
create_time datetime default null comment '创建时间',
|
||||
primary key (generation_id),
|
||||
key idx_front_project_generation_project_id (project_id)
|
||||
) engine=innodb auto_increment=100 default charset=utf8mb4 comment='前台项目生成记录';
|
||||
|
||||
create table front_ai_generation_task (
|
||||
task_id bigint(20) not null auto_increment comment 'AI task ID',
|
||||
generation_id bigint(20) default null comment 'Generation record ID',
|
||||
project_id bigint(20) not null comment 'Project ID',
|
||||
user_id bigint(20) not null comment 'Front user ID',
|
||||
generate_type varchar(50) not null comment 'Generation type',
|
||||
provider varchar(50) default 'deepseek' comment 'AI provider',
|
||||
model varchar(100) default 'deepseek-chat' comment 'AI model',
|
||||
status varchar(30) not null default 'QUEUED' comment 'Task status',
|
||||
request_hash varchar(64) not null comment 'Request idempotency hash',
|
||||
request_payload longtext comment 'Request JSON',
|
||||
result_payload longtext comment 'Result JSON',
|
||||
error_code varchar(100) default '' comment 'Error code',
|
||||
error_message varchar(1000) default '' comment 'Error message',
|
||||
attempts int default 0 comment 'Attempt count',
|
||||
max_attempts int default 3 comment 'Max attempts',
|
||||
next_retry_time datetime default null comment 'Next retry time',
|
||||
locked_by varchar(100) default '' comment 'Worker lock owner',
|
||||
locked_until datetime default null comment 'Worker lock expiry',
|
||||
progress int default 0 comment 'Progress percent',
|
||||
current_step varchar(100) default '' comment 'Current step',
|
||||
input_tokens int default 0 comment 'Input tokens',
|
||||
output_tokens int default 0 comment 'Output tokens',
|
||||
total_tokens int default 0 comment 'Total tokens',
|
||||
cost_cents int default 0 comment 'Estimated cost in cents',
|
||||
started_at datetime default null comment 'Started time',
|
||||
finished_at datetime default null comment 'Finished time',
|
||||
create_time datetime default null comment 'Create time',
|
||||
update_time datetime default null comment 'Update time',
|
||||
primary key (task_id),
|
||||
key idx_front_ai_task_project (user_id, project_id),
|
||||
key idx_front_ai_task_status (status, next_retry_time),
|
||||
key idx_front_ai_task_generation (generation_id),
|
||||
key idx_front_ai_task_hash (user_id, project_id, request_hash)
|
||||
) engine=innodb auto_increment=100 default charset=utf8mb4 comment='Front AI generation task';
|
||||
|
||||
create table front_ai_quota_bucket (
|
||||
bucket_id bigint(20) not null auto_increment comment 'Quota bucket ID',
|
||||
user_id bigint(20) not null comment 'Front user ID',
|
||||
period_type varchar(20) not null comment 'DAY or MONTH',
|
||||
period_key varchar(20) not null comment 'Period key',
|
||||
task_limit int default 0 comment 'Task limit',
|
||||
task_used int default 0 comment 'Used tasks',
|
||||
token_limit int default 0 comment 'Token limit',
|
||||
token_used int default 0 comment 'Used tokens',
|
||||
cost_limit_cents int default 0 comment 'Cost limit in cents',
|
||||
cost_used_cents int default 0 comment 'Used cost in cents',
|
||||
running_limit int default 1 comment 'Running task limit',
|
||||
running_count int default 0 comment 'Running task count',
|
||||
create_time datetime default null comment 'Create time',
|
||||
update_time datetime default null comment 'Update time',
|
||||
primary key (bucket_id),
|
||||
unique key uk_front_ai_quota_bucket (user_id, period_type, period_key)
|
||||
) engine=innodb auto_increment=100 default charset=utf8mb4 comment='Front AI quota bucket';
|
||||
|
||||
create table front_ai_usage_ledger (
|
||||
ledger_id bigint(20) not null auto_increment comment 'Usage ledger ID',
|
||||
task_id bigint(20) default null comment 'Task ID',
|
||||
generation_id bigint(20) default null comment 'Generation record ID',
|
||||
project_id bigint(20) not null comment 'Project ID',
|
||||
user_id bigint(20) not null comment 'Front user ID',
|
||||
generate_type varchar(50) not null comment 'Generation type',
|
||||
provider varchar(50) default 'deepseek' comment 'AI provider',
|
||||
model varchar(100) default 'deepseek-chat' comment 'AI model',
|
||||
input_tokens int default 0 comment 'Input tokens',
|
||||
output_tokens int default 0 comment 'Output tokens',
|
||||
total_tokens int default 0 comment 'Total tokens',
|
||||
cost_cents int default 0 comment 'Estimated cost in cents',
|
||||
success char(1) default '0' comment 'Success flag',
|
||||
error_message varchar(1000) default '' comment 'Error message',
|
||||
create_time datetime default null comment 'Create time',
|
||||
primary key (ledger_id),
|
||||
key idx_front_ai_usage_user (user_id, create_time),
|
||||
key idx_front_ai_usage_task (task_id)
|
||||
) engine=innodb auto_increment=100 default charset=utf8mb4 comment='Front AI usage ledger';
|
||||
|
||||
create table front_project_file (
|
||||
file_id bigint(20) not null auto_increment comment '文件缓存ID',
|
||||
project_id bigint(20) not null comment '项目ID',
|
||||
template_type varchar(50) not null comment '模板类型',
|
||||
node_id varchar(100) default '' comment '结构节点ID',
|
||||
table_id bigint(20) default null comment '表设计ID',
|
||||
file_name varchar(255) not null comment '文件名',
|
||||
file_path varchar(500) default '' comment '文件路径',
|
||||
file_content longtext comment '文件内容',
|
||||
content_hash varchar(64) default '' comment '内容哈希',
|
||||
create_time datetime default null comment '创建时间',
|
||||
update_time datetime default null comment '更新时间',
|
||||
primary key (file_id),
|
||||
key idx_front_project_file_project_id (project_id),
|
||||
key idx_front_project_file_lookup (project_id, template_type, table_id)
|
||||
) engine=innodb auto_increment=100 default charset=utf8mb4 comment='前台项目预览文件缓存';
|
||||
@@ -1,18 +0,0 @@
|
||||
-- 项目信息表
|
||||
create table gen_project (
|
||||
project_id bigint(20) not null auto_increment comment '项目ID',
|
||||
project_name varchar(50) not null comment '项目名称',
|
||||
package_name varchar(100) not null comment '包名',
|
||||
version varchar(20) not null comment '版本号',
|
||||
description varchar(500) default null comment '项目描述',
|
||||
author varchar(50) not null comment '作者',
|
||||
front_framework varchar(50) not null comment '前端框架',
|
||||
back_framework varchar(50) not null comment '后端框架',
|
||||
status char(1) default '0' comment '状态(0正常 1停用)',
|
||||
create_by varchar(64) default '' comment '创建者',
|
||||
create_time datetime comment '创建时间',
|
||||
update_by varchar(64) default '' comment '更新者',
|
||||
update_time datetime comment '更新时间',
|
||||
remark varchar(500) default null comment '备注',
|
||||
primary key (project_id)
|
||||
) engine=innodb auto_increment=100 comment = '项目信息表';
|
||||
@@ -1,5 +0,0 @@
|
||||
CREATE TABLE gen_table_project_rel (
|
||||
id BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||
table_id BIGINT NOT NULL,
|
||||
project_id BIGINT NOT NULL
|
||||
);
|
||||
@@ -1,379 +0,0 @@
|
||||
-- =================================================
|
||||
-- 代码生成平台测试数据
|
||||
-- 使用方式:
|
||||
-- 1. 先导入 sql/db.sql
|
||||
-- 2. 再导入本文件:mysql -uroot -p ry < sql/generator_test_data.sql
|
||||
-- 3. 登录 admin/admin123,进入「代码生成平台 -> 项目管理」
|
||||
-- 4. 打开「演示生成项目」,可直接预览/下载 backend、admin_frontend、frontend 三类项目
|
||||
-- =================================================
|
||||
|
||||
SET FOREIGN_KEY_CHECKS = 0;
|
||||
|
||||
-- 清理同一批测试数据,方便重复导入
|
||||
DELETE FROM sys_project_structure WHERE template_id IN (9001, 9002, 9003) OR node_id BETWEEN 900100 AND 900399;
|
||||
DELETE FROM sys_code_snippet_module WHERE snippet_id BETWEEN 9001 AND 9099;
|
||||
DELETE FROM sys_code_snippet WHERE snippet_id BETWEEN 9001 AND 9099;
|
||||
DELETE FROM sys_project_template WHERE project_id = 9001 OR template_id IN (9001, 9002, 9003);
|
||||
DELETE FROM sys_project_table WHERE project_id = 9001 OR table_id = 9001;
|
||||
DELETE FROM gen_table_project_rel WHERE project_id = 9001 OR table_id = 9001;
|
||||
DELETE FROM sys_project_module WHERE project_id = 9001 OR module_id = 9001;
|
||||
DELETE FROM sys_template_file WHERE template_id IN (9001, 9002, 9003) OR template_file_id BETWEEN 900100 AND 900399;
|
||||
DELETE FROM sys_template WHERE template_id IN (9001, 9002, 9003);
|
||||
DELETE FROM gen_table_column WHERE table_id = 9001 OR column_id BETWEEN 900100 AND 900199;
|
||||
DELETE FROM gen_table WHERE table_id = 9001;
|
||||
DELETE FROM gen_project WHERE project_id = 9001;
|
||||
DELETE FROM sys_module WHERE module_id = 9001;
|
||||
DROP TABLE IF EXISTS demo_product;
|
||||
|
||||
-- 示例业务表:不是生成逻辑必须项,但方便和 gen_table 元数据对照
|
||||
CREATE TABLE demo_product (
|
||||
product_id bigint(20) NOT NULL AUTO_INCREMENT COMMENT '商品ID',
|
||||
product_name varchar(100) NOT NULL COMMENT '商品名称',
|
||||
product_code varchar(64) NOT NULL COMMENT '商品编码',
|
||||
price decimal(10,2) DEFAULT 0.00 COMMENT '商品价格',
|
||||
status char(1) DEFAULT '0' COMMENT '状态',
|
||||
create_time datetime DEFAULT NULL COMMENT '创建时间',
|
||||
remark varchar(500) DEFAULT NULL COMMENT '备注',
|
||||
PRIMARY KEY (product_id)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='演示商品表';
|
||||
|
||||
INSERT INTO demo_product (product_id, product_name, product_code, price, status, create_time, remark) VALUES
|
||||
(1, '测试商品A', 'DEMO-A', 19.90, '0', sysdate(), '用于代码生成预览'),
|
||||
(2, '测试商品B', 'DEMO-B', 29.90, '0', sysdate(), '用于代码生成下载');
|
||||
|
||||
-- 测试项目
|
||||
INSERT INTO gen_project (project_id, project_name, project_file_name, package_name, version, project_desc, author, front_framework, back_framework, status, create_by, create_time, remark) VALUES
|
||||
(9001, '演示生成项目', 'demo-generated-app', 'com.example.demo', '1.0.0', '代码生成平台测试项目,可直接预览和下载生成结果', 'Codex', 'Vue2 + Element UI', 'Spring Boot + MyBatis', '0', 'admin', sysdate(), '测试数据,可重复导入');
|
||||
|
||||
-- 测试功能模块,用于验证代码片段按项目模块生效
|
||||
INSERT INTO sys_module (module_id, module_name, module_alias, module_desc, status, del_flag, create_by, create_time, remark) VALUES
|
||||
(9001, '审计增强', 'audit', '演示代码片段模块,给 Controller 注入 ping 方法', '0', '0', 'admin', sysdate(), '测试数据');
|
||||
|
||||
INSERT INTO sys_project_module (id, project_id, module_id, status, create_by, create_time, remark) VALUES
|
||||
(9001, 9001, 9001, '0', 'admin', sysdate(), '演示项目启用审计增强模块');
|
||||
|
||||
-- 示例生成表元数据
|
||||
INSERT INTO gen_table (table_id, table_name, table_comment, class_name, tpl_category, tpl_web_type, package_name, module_name, business_name, function_name, function_author, gen_type, gen_path, options, create_by, create_time, remark, create_table_sql) VALUES
|
||||
(9001, 'demo_product', '演示商品', 'DemoProduct', 'crud', 'element-ui', 'com.example.demo', 'demo', 'product', '演示商品', 'Codex', '0', '/', '{"parentMenuId":"3"}', 'admin', sysdate(), '测试数据',
|
||||
'CREATE TABLE `demo_product` (
|
||||
`product_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT ''商品ID'',
|
||||
`product_name` varchar(100) NOT NULL COMMENT ''商品名称'',
|
||||
`product_code` varchar(64) NOT NULL COMMENT ''商品编码'',
|
||||
`price` decimal(10,2) DEFAULT 0.00 COMMENT ''商品价格'',
|
||||
`status` char(1) DEFAULT ''0'' COMMENT ''状态'',
|
||||
`create_time` datetime DEFAULT NULL COMMENT ''创建时间'',
|
||||
`remark` varchar(500) DEFAULT NULL COMMENT ''备注'',
|
||||
PRIMARY KEY (`product_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT=''演示商品表'';');
|
||||
|
||||
INSERT INTO gen_table_column (column_id, table_id, column_name, column_comment, column_type, java_type, java_field, is_pk, is_increment, is_required, is_insert, is_edit, is_list, is_query, query_type, html_type, dict_type, sort, create_by, create_time) VALUES
|
||||
(900101, 9001, 'product_id', '商品ID', 'bigint(20)', 'Long', 'productId', '1', '1', '1', '0', '0', '0', '0', 'EQ', 'input', '', 1, 'admin', sysdate()),
|
||||
(900102, 9001, 'product_name', '商品名称', 'varchar(100)', 'String', 'productName', '0', '0', '1', '1', '1', '1', '1', 'LIKE', 'input', '', 2, 'admin', sysdate()),
|
||||
(900103, 9001, 'product_code', '商品编码', 'varchar(64)', 'String', 'productCode', '0', '0', '1', '1', '1', '1', '1', 'LIKE', 'input', '', 3, 'admin', sysdate()),
|
||||
(900104, 9001, 'price', '商品价格', 'decimal(10,2)', 'BigDecimal', 'price', '0', '0', '0', '1', '1', '1', '0', 'EQ', 'input', '', 4, 'admin', sysdate()),
|
||||
(900105, 9001, 'status', '状态', 'char(1)', 'String', 'status', '0', '0', '0', '1', '1', '1', '1', 'EQ', 'select', 'sys_normal_disable', 5, 'admin', sysdate()),
|
||||
(900106, 9001, 'create_time', '创建时间', 'datetime', 'Date', 'createTime', '0', '0', '0', '0', '0', '1', '1', 'BETWEEN', 'datetime', '', 6, 'admin', sysdate()),
|
||||
(900107, 9001, 'remark', '备注', 'varchar(500)', 'String', 'remark', '0', '0', '0', '1', '1', '0', '0', 'EQ', 'textarea', '', 7, 'admin', sysdate());
|
||||
|
||||
INSERT INTO sys_project_table (id, table_id, project_id) VALUES
|
||||
(9001, 9001, 9001);
|
||||
|
||||
INSERT INTO gen_table_project_rel (id, table_id, project_id) VALUES
|
||||
(9001, 9001, 9001);
|
||||
|
||||
-- 三类模板
|
||||
INSERT INTO sys_template (template_id, template_name, template_path, template_desc, template_type, template_status, create_by, create_time, remark) VALUES
|
||||
(9001, '测试后端模板', '/test/backend', '生成 Spring Boot + MyBatis 后端项目骨架', 'backend', 0, 'admin', sysdate(), '测试模板'),
|
||||
(9002, '测试后台前端模板', '/test/admin_frontend', '生成后台前端 API 和列表页骨架', 'admin_frontend', 0, 'admin', sysdate(), '测试模板'),
|
||||
(9003, '测试前台前端模板', '/test/frontend', '生成最小前台前端项目骨架', 'frontend', 0, 'admin', sysdate(), '测试模板');
|
||||
|
||||
INSERT INTO sys_project_template (id, project_id, template_id, template_type) VALUES
|
||||
(9001, 9001, 9001, 'backend'),
|
||||
(9002, 9001, 9002, 'admin_frontend'),
|
||||
(9003, 9001, 9003, 'frontend');
|
||||
|
||||
-- 后端模板文件
|
||||
INSERT INTO sys_template_file (template_file_id, template_id, file_name, module_id, file_path, file_content, create_by, create_time) VALUES
|
||||
(900101, 9001, 'pom.xml.vm', NULL, 'pom.xml.vm',
|
||||
'<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>${packageName}</groupId>
|
||||
<artifactId>${projectFileName}</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<name>${projectName}</name>
|
||||
</project>
|
||||
', 'admin', sysdate()),
|
||||
(900102, 9001, 'application.yml.vm', NULL, 'application.yml.vm',
|
||||
'server:
|
||||
port: 8080
|
||||
spring:
|
||||
application:
|
||||
name: ${projectFileName}
|
||||
', 'admin', sysdate()),
|
||||
(900103, 9001, 'README.md.vm', NULL, 'README.md.vm',
|
||||
'# ${projectName}
|
||||
|
||||
包名:`${packageName}`
|
||||
|
||||
## 建表 SQL
|
||||
|
||||
```sql
|
||||
${createTableSql}
|
||||
```
|
||||
', 'admin', sysdate()),
|
||||
(900104, 9001, 'entity.java.vm', NULL, 'entity.java.vm',
|
||||
'package ${packageName}.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* ${functionName}实体
|
||||
*/
|
||||
public class ${ClassName} {
|
||||
#foreach($column in $columns)
|
||||
/** ${column.columnComment} */
|
||||
private ${column.javaType} ${column.javaField};
|
||||
|
||||
#end
|
||||
#foreach($column in $columns)
|
||||
public ${column.javaType} get${column.capJavaField}() {
|
||||
return ${column.javaField};
|
||||
}
|
||||
|
||||
public void set${column.capJavaField}(${column.javaType} ${column.javaField}) {
|
||||
this.${column.javaField} = ${column.javaField};
|
||||
}
|
||||
|
||||
#end
|
||||
}
|
||||
', 'admin', sysdate()),
|
||||
(900105, 9001, 'mapper.java.vm', NULL, 'mapper.java.vm',
|
||||
'package ${packageName}.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import ${packageName}.domain.${ClassName};
|
||||
|
||||
public interface ${ClassName}Mapper {
|
||||
List<${ClassName}> select${ClassName}List(${ClassName} ${className});
|
||||
}
|
||||
', 'admin', sysdate()),
|
||||
(900106, 9001, 'service.java.vm', NULL, 'service.java.vm',
|
||||
'package ${packageName}.service;
|
||||
|
||||
import java.util.List;
|
||||
import ${packageName}.domain.${ClassName};
|
||||
|
||||
public interface I${ClassName}Service {
|
||||
List<${ClassName}> select${ClassName}List(${ClassName} ${className});
|
||||
}
|
||||
', 'admin', sysdate()),
|
||||
(900107, 9001, 'serviceImpl.java.vm', NULL, 'serviceImpl.java.vm',
|
||||
'package ${packageName}.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import ${packageName}.domain.${ClassName};
|
||||
import ${packageName}.mapper.${ClassName}Mapper;
|
||||
import ${packageName}.service.I${ClassName}Service;
|
||||
|
||||
@Service
|
||||
public class ${ClassName}ServiceImpl implements I${ClassName}Service {
|
||||
@Resource
|
||||
private ${ClassName}Mapper ${className}Mapper;
|
||||
|
||||
@Override
|
||||
public List<${ClassName}> select${ClassName}List(${ClassName} ${className}) {
|
||||
return ${className}Mapper.select${ClassName}List(${className});
|
||||
}
|
||||
}
|
||||
', 'admin', sysdate()),
|
||||
(900108, 9001, 'controller.java.vm', NULL, 'controller.java.vm',
|
||||
'package ${packageName}.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import ${packageName}.domain.${ClassName};
|
||||
import ${packageName}.service.I${ClassName}Service;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/${moduleName}/${businessName}")
|
||||
public class ${ClassName}Controller {
|
||||
@Resource
|
||||
private I${ClassName}Service ${className}Service;
|
||||
|
||||
@GetMapping("/list")
|
||||
public List<${ClassName}> list(${ClassName} query) {
|
||||
return ${className}Service.select${ClassName}List(query);
|
||||
}
|
||||
|
||||
$!controllerExtraMethods
|
||||
}
|
||||
', 'admin', sysdate()),
|
||||
(900109, 9001, 'mapper.xml.vm', NULL, 'mapper.xml.vm',
|
||||
'<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="${packageName}.mapper.${ClassName}Mapper">
|
||||
<select id="select${ClassName}List" resultType="${packageName}.domain.${ClassName}">
|
||||
select
|
||||
#foreach($column in $columns)
|
||||
${column.columnName}#if($foreach.hasNext),#end
|
||||
#end
|
||||
from ${tableName}
|
||||
</select>
|
||||
</mapper>
|
||||
', 'admin', sysdate());
|
||||
|
||||
-- 后台前端模板文件
|
||||
INSERT INTO sys_template_file (template_file_id, template_id, file_name, module_id, file_path, file_content, create_by, create_time) VALUES
|
||||
(900201, 9002, 'package.json.vm', NULL, 'package.json.vm',
|
||||
'{
|
||||
"name": "${projectFileName}-admin",
|
||||
"version": "1.0.0",
|
||||
"scripts": {
|
||||
"dev": "vue-cli-service serve"
|
||||
}
|
||||
}
|
||||
', 'admin', sysdate()),
|
||||
(900202, 9002, 'api.js.vm', NULL, 'api.js.vm',
|
||||
'import request from "@/utils/request"
|
||||
|
||||
export function list${ClassName}(query) {
|
||||
return request({
|
||||
url: "/${moduleName}/${businessName}/list",
|
||||
method: "get",
|
||||
params: query
|
||||
})
|
||||
}
|
||||
', 'admin', sysdate()),
|
||||
(900203, 9002, 'index.vue.vm', NULL, 'index.vue.vm',
|
||||
'<template>
|
||||
<div class="app-container">
|
||||
<el-table :data="list">
|
||||
#foreach($column in $columns)
|
||||
#if($column.isList == "1")
|
||||
<el-table-column label="${column.columnComment}" prop="${column.javaField}" />
|
||||
#end
|
||||
#end
|
||||
</el-table>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { list${ClassName} } from "@/api/${moduleName}/${businessName}"
|
||||
|
||||
export default {
|
||||
name: "${ClassName}",
|
||||
data() {
|
||||
return {
|
||||
list: []
|
||||
}
|
||||
},
|
||||
created() {
|
||||
list${ClassName}({}).then(res => {
|
||||
this.list = res.rows || res.data || []
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
', 'admin', sysdate());
|
||||
|
||||
-- 前台前端模板文件
|
||||
INSERT INTO sys_template_file (template_file_id, template_id, file_name, module_id, file_path, file_content, create_by, create_time) VALUES
|
||||
(900301, 9003, 'package.json.vm', NULL, 'package.json.vm',
|
||||
'{
|
||||
"name": "${projectFileName}-web",
|
||||
"version": "1.0.0",
|
||||
"scripts": {
|
||||
"dev": "vite --host 0.0.0.0"
|
||||
}
|
||||
}
|
||||
', 'admin', sysdate()),
|
||||
(900302, 9003, 'README.md.vm', NULL, 'README.md.vm',
|
||||
'# ${projectName} 前台演示
|
||||
|
||||
这是代码生成平台的 frontend 类型测试模板。
|
||||
', 'admin', sysdate()),
|
||||
(900303, 9003, 'index.html.vm', NULL, 'index.html.vm',
|
||||
'<!doctype html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<title>${projectName}</title>
|
||||
</head>
|
||||
<body>
|
||||
<main id="app">
|
||||
<h1>${projectName}</h1>
|
||||
<p>Generated by RuoYi-Vue code generator.</p>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
', 'admin', sysdate());
|
||||
|
||||
-- 代码片段:只对 demo_product + controller.java.vm 生效
|
||||
INSERT INTO sys_code_snippet (snippet_id, module_id, snippet_content, insert_point, template_file_name, relation_table_name, status, del_flag, create_by, create_time, remark) VALUES
|
||||
(9001, 9001,
|
||||
' @GetMapping("/ping")
|
||||
public String ping() {
|
||||
return "demo-product-ok";
|
||||
}',
|
||||
'controllerExtraMethods', 'controller.java.vm', 'demo_product', '0', '0', 'admin', sysdate(), '演示 Controller 插入点');
|
||||
|
||||
INSERT INTO sys_code_snippet_module (snippet_id, module_id) VALUES
|
||||
(9001, 9001);
|
||||
|
||||
-- 后端项目结构
|
||||
INSERT INTO sys_project_structure (node_id, parent_id, node_name, node_type, module, template_id, table_id, category, sort_order, status, create_by, create_time, update_by, update_time) VALUES
|
||||
(900100, 0, '{projectName}', 'folder', NULL, 9001, NULL, NULL, 1, '0', 'admin', sysdate(), '', NULL),
|
||||
(900101, 900100, 'pom.xml', 'file', NULL, 9001, -1, 'pom.xml.vm', 1, '0', 'admin', sysdate(), '', NULL),
|
||||
(900102, 900100, 'README.md', 'file', NULL, 9001, -1, 'README.md.vm', 2, '0', 'admin', sysdate(), '', NULL),
|
||||
(900103, 900100, 'src', 'folder', NULL, 9001, NULL, NULL, 3, '0', 'admin', sysdate(), '', NULL),
|
||||
(900104, 900103, 'main', 'folder', NULL, 9001, NULL, NULL, 1, '0', 'admin', sysdate(), '', NULL),
|
||||
(900105, 900104, 'java', 'folder', NULL, 9001, NULL, NULL, 1, '0', 'admin', sysdate(), '', NULL),
|
||||
(900106, 900105, 'com', 'folder', NULL, 9001, NULL, NULL, 1, '0', 'admin', sysdate(), '', NULL),
|
||||
(900107, 900106, 'example', 'folder', NULL, 9001, NULL, NULL, 1, '0', 'admin', sysdate(), '', NULL),
|
||||
(900108, 900107, 'demo', 'folder', NULL, 9001, NULL, NULL, 1, '0', 'admin', sysdate(), '', NULL),
|
||||
(900109, 900108, 'domain', 'folder', NULL, 9001, NULL, NULL, 1, '0', 'admin', sysdate(), '', NULL),
|
||||
(900110, 900108, 'mapper', 'folder', NULL, 9001, NULL, NULL, 2, '0', 'admin', sysdate(), '', NULL),
|
||||
(900111, 900108, 'service', 'folder', NULL, 9001, NULL, NULL, 3, '0', 'admin', sysdate(), '', NULL),
|
||||
(900112, 900111, 'impl', 'folder', NULL, 9001, NULL, NULL, 1, '0', 'admin', sysdate(), '', NULL),
|
||||
(900113, 900108, 'controller', 'folder', NULL, 9001, NULL, NULL, 4, '0', 'admin', sysdate(), '', NULL),
|
||||
(900114, 900104, 'resources', 'folder', NULL, 9001, NULL, NULL, 2, '0', 'admin', sysdate(), '', NULL),
|
||||
(900115, 900114, 'mapper', 'folder', NULL, 9001, NULL, NULL, 1, '0', 'admin', sysdate(), '', NULL),
|
||||
(900116, 900114, 'application.yml', 'file', NULL, 9001, -1, 'application.yml.vm', 2, '0', 'admin', sysdate(), '', NULL),
|
||||
(900117, 900109, '{ClassName}.java', 'file', NULL, 9001, 0, 'entity.java.vm', 1, '0', 'admin', sysdate(), '', NULL),
|
||||
(900118, 900110, '{ClassName}Mapper.java', 'file', NULL, 9001, 0, 'mapper.java.vm', 1, '0', 'admin', sysdate(), '', NULL),
|
||||
(900119, 900111, 'I{ClassName}Service.java', 'file', NULL, 9001, 0, 'service.java.vm', 1, '0', 'admin', sysdate(), '', NULL),
|
||||
(900120, 900112, '{ClassName}ServiceImpl.java', 'file', NULL, 9001, 0, 'serviceImpl.java.vm', 1, '0', 'admin', sysdate(), '', NULL),
|
||||
(900121, 900113, '{ClassName}Controller.java', 'file', NULL, 9001, 0, 'controller.java.vm', 1, '0', 'admin', sysdate(), '', NULL),
|
||||
(900122, 900115, '{ClassName}Mapper.xml', 'file', NULL, 9001, 0, 'mapper.xml.vm', 1, '0', 'admin', sysdate(), '', NULL);
|
||||
|
||||
-- 后台前端项目结构
|
||||
INSERT INTO sys_project_structure (node_id, parent_id, node_name, node_type, module, template_id, table_id, category, sort_order, status, create_by, create_time, update_by, update_time) VALUES
|
||||
(900200, 0, '{projectName}-admin', 'folder', NULL, 9002, NULL, NULL, 1, '0', 'admin', sysdate(), '', NULL),
|
||||
(900201, 900200, 'package.json', 'file', NULL, 9002, -1, 'package.json.vm', 1, '0', 'admin', sysdate(), '', NULL),
|
||||
(900202, 900200, 'src', 'folder', NULL, 9002, NULL, NULL, 2, '0', 'admin', sysdate(), '', NULL),
|
||||
(900203, 900202, 'api', 'folder', NULL, 9002, NULL, NULL, 1, '0', 'admin', sysdate(), '', NULL),
|
||||
(900204, 900203, 'demo', 'folder', NULL, 9002, NULL, NULL, 1, '0', 'admin', sysdate(), '', NULL),
|
||||
(900205, 900202, 'views', 'folder', NULL, 9002, NULL, NULL, 2, '0', 'admin', sysdate(), '', NULL),
|
||||
(900206, 900205, 'demo', 'folder', NULL, 9002, NULL, NULL, 1, '0', 'admin', sysdate(), '', NULL),
|
||||
(900207, 900206, '{businessName}', 'folder', NULL, 9002, 0, NULL, 1, '0', 'admin', sysdate(), '', NULL),
|
||||
(900208, 900204, '{businessName}.js', 'file', NULL, 9002, 0, 'api.js.vm', 1, '0', 'admin', sysdate(), '', NULL),
|
||||
(900209, 900207, 'index.vue', 'file', NULL, 9002, 0, 'index.vue.vm', 1, '0', 'admin', sysdate(), '', NULL);
|
||||
|
||||
-- 前台前端项目结构
|
||||
INSERT INTO sys_project_structure (node_id, parent_id, node_name, node_type, module, template_id, table_id, category, sort_order, status, create_by, create_time, update_by, update_time) VALUES
|
||||
(900300, 0, '{projectName}-web', 'folder', NULL, 9003, NULL, NULL, 1, '0', 'admin', sysdate(), '', NULL),
|
||||
(900301, 900300, 'package.json', 'file', NULL, 9003, -1, 'package.json.vm', 1, '0', 'admin', sysdate(), '', NULL),
|
||||
(900302, 900300, 'README.md', 'file', NULL, 9003, -1, 'README.md.vm', 2, '0', 'admin', sysdate(), '', NULL),
|
||||
(900303, 900300, 'index.html', 'file', NULL, 9003, -1, 'index.html.vm', 3, '0', 'admin', sysdate(), '', NULL);
|
||||
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
@@ -1,62 +0,0 @@
|
||||
-- ----------------------------
|
||||
-- 1、功能模块表
|
||||
-- ----------------------------
|
||||
drop table if exists sys_module;
|
||||
create table sys_module (
|
||||
module_id bigint(20) not null auto_increment comment '模块id',
|
||||
module_name varchar(50) not null comment '模块名称',
|
||||
module_alias varchar(50) default '' comment '模块别名',
|
||||
module_desc varchar(500) default '' comment '模块描述',
|
||||
status char(1) default '0' comment '状态(0正常 1停用)',
|
||||
del_flag char(1) default '0' comment '删除标志(0代表存在 2代表删除)',
|
||||
create_by varchar(64) default '' comment '创建者',
|
||||
create_time datetime comment '创建时间',
|
||||
update_by varchar(64) default '' comment '更新者',
|
||||
update_time datetime comment '更新时间',
|
||||
remark varchar(500) default null comment '备注',
|
||||
primary key (module_id)
|
||||
) engine=innodb auto_increment=100 comment = '功能模块表';
|
||||
|
||||
-- ----------------------------
|
||||
-- 2、代码片段管理表
|
||||
-- ----------------------------
|
||||
drop table if exists sys_code_snippet;
|
||||
create table sys_code_snippet (
|
||||
snippet_id bigint(20) not null auto_increment comment '代码片段id',
|
||||
module_id bigint(20) not null comment '功能模块id',
|
||||
snippet_content text not null comment '代码片段内容',
|
||||
insert_point varchar(255) default '' comment '插入点',
|
||||
param1 varchar(255) default null comment '参数1',
|
||||
param2 varchar(255) default null comment '参数2',
|
||||
param3 varchar(255) default null comment '参数3',
|
||||
param4 varchar(255) default null comment '参数4',
|
||||
param5 varchar(255) default null comment '参数5',
|
||||
status char(1) default '0' comment '状态(0正常 1停用)',
|
||||
del_flag char(1) default '0' comment '删除标志(0代表存在 2代表删除)',
|
||||
create_by varchar(64) default '' comment '创建者',
|
||||
create_time datetime comment '创建时间',
|
||||
update_by varchar(64) default '' comment '更新者',
|
||||
update_time datetime comment '更新时间',
|
||||
remark varchar(500) default null comment '备注',
|
||||
primary key (snippet_id),
|
||||
foreign key (module_id) references sys_module(module_id)
|
||||
) engine=innodb auto_increment=100 comment = '代码片段管理表';
|
||||
|
||||
-- ----------------------------
|
||||
-- 3、功能模块与项目关系表
|
||||
-- ----------------------------
|
||||
drop table if exists sys_project_module;
|
||||
create table sys_project_module (
|
||||
id bigint(20) not null auto_increment comment 'id',
|
||||
project_id bigint(20) not null comment '项目id',
|
||||
module_id bigint(20) not null comment '功能模块id',
|
||||
status char(1) default '0' comment '状态(0正常 1停用)',
|
||||
create_by varchar(64) default '' comment '创建者',
|
||||
create_time datetime comment '创建时间',
|
||||
update_by varchar(64) default '' comment '更新者',
|
||||
update_time datetime comment '更新时间',
|
||||
remark varchar(500) default null comment '备注',
|
||||
primary key (id),
|
||||
unique key idx_project_module (project_id, module_id),
|
||||
foreign key (module_id) references sys_module(module_id)
|
||||
) engine=innodb auto_increment=100 comment = '功能模块与项目关系表';
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,174 +0,0 @@
|
||||
DROP TABLE IF EXISTS QRTZ_FIRED_TRIGGERS;
|
||||
DROP TABLE IF EXISTS QRTZ_PAUSED_TRIGGER_GRPS;
|
||||
DROP TABLE IF EXISTS QRTZ_SCHEDULER_STATE;
|
||||
DROP TABLE IF EXISTS QRTZ_LOCKS;
|
||||
DROP TABLE IF EXISTS QRTZ_SIMPLE_TRIGGERS;
|
||||
DROP TABLE IF EXISTS QRTZ_SIMPROP_TRIGGERS;
|
||||
DROP TABLE IF EXISTS QRTZ_CRON_TRIGGERS;
|
||||
DROP TABLE IF EXISTS QRTZ_BLOB_TRIGGERS;
|
||||
DROP TABLE IF EXISTS QRTZ_TRIGGERS;
|
||||
DROP TABLE IF EXISTS QRTZ_JOB_DETAILS;
|
||||
DROP TABLE IF EXISTS QRTZ_CALENDARS;
|
||||
|
||||
-- ----------------------------
|
||||
-- 1、存储每一个已配置的 jobDetail 的详细信息
|
||||
-- ----------------------------
|
||||
create table QRTZ_JOB_DETAILS (
|
||||
sched_name varchar(120) not null comment '调度名称',
|
||||
job_name varchar(200) not null comment '任务名称',
|
||||
job_group varchar(200) not null comment '任务组名',
|
||||
description varchar(250) null comment '相关介绍',
|
||||
job_class_name varchar(250) not null comment '执行任务类名称',
|
||||
is_durable varchar(1) not null comment '是否持久化',
|
||||
is_nonconcurrent varchar(1) not null comment '是否并发',
|
||||
is_update_data varchar(1) not null comment '是否更新数据',
|
||||
requests_recovery varchar(1) not null comment '是否接受恢复执行',
|
||||
job_data blob null comment '存放持久化job对象',
|
||||
primary key (sched_name, job_name, job_group)
|
||||
) engine=innodb comment = '任务详细信息表';
|
||||
|
||||
-- ----------------------------
|
||||
-- 2、 存储已配置的 Trigger 的信息
|
||||
-- ----------------------------
|
||||
create table QRTZ_TRIGGERS (
|
||||
sched_name varchar(120) not null comment '调度名称',
|
||||
trigger_name varchar(200) not null comment '触发器的名字',
|
||||
trigger_group varchar(200) not null comment '触发器所属组的名字',
|
||||
job_name varchar(200) not null comment 'qrtz_job_details表job_name的外键',
|
||||
job_group varchar(200) not null comment 'qrtz_job_details表job_group的外键',
|
||||
description varchar(250) null comment '相关介绍',
|
||||
next_fire_time bigint(13) null comment '上一次触发时间(毫秒)',
|
||||
prev_fire_time bigint(13) null comment '下一次触发时间(默认为-1表示不触发)',
|
||||
priority integer null comment '优先级',
|
||||
trigger_state varchar(16) not null comment '触发器状态',
|
||||
trigger_type varchar(8) not null comment '触发器的类型',
|
||||
start_time bigint(13) not null comment '开始时间',
|
||||
end_time bigint(13) null comment '结束时间',
|
||||
calendar_name varchar(200) null comment '日程表名称',
|
||||
misfire_instr smallint(2) null comment '补偿执行的策略',
|
||||
job_data blob null comment '存放持久化job对象',
|
||||
primary key (sched_name, trigger_name, trigger_group),
|
||||
foreign key (sched_name, job_name, job_group) references QRTZ_JOB_DETAILS(sched_name, job_name, job_group)
|
||||
) engine=innodb comment = '触发器详细信息表';
|
||||
|
||||
-- ----------------------------
|
||||
-- 3、 存储简单的 Trigger,包括重复次数,间隔,以及已触发的次数
|
||||
-- ----------------------------
|
||||
create table QRTZ_SIMPLE_TRIGGERS (
|
||||
sched_name varchar(120) not null comment '调度名称',
|
||||
trigger_name varchar(200) not null comment 'qrtz_triggers表trigger_name的外键',
|
||||
trigger_group varchar(200) not null comment 'qrtz_triggers表trigger_group的外键',
|
||||
repeat_count bigint(7) not null comment '重复的次数统计',
|
||||
repeat_interval bigint(12) not null comment '重复的间隔时间',
|
||||
times_triggered bigint(10) not null comment '已经触发的次数',
|
||||
primary key (sched_name, trigger_name, trigger_group),
|
||||
foreign key (sched_name, trigger_name, trigger_group) references QRTZ_TRIGGERS(sched_name, trigger_name, trigger_group)
|
||||
) engine=innodb comment = '简单触发器的信息表';
|
||||
|
||||
-- ----------------------------
|
||||
-- 4、 存储 Cron Trigger,包括 Cron 表达式和时区信息
|
||||
-- ----------------------------
|
||||
create table QRTZ_CRON_TRIGGERS (
|
||||
sched_name varchar(120) not null comment '调度名称',
|
||||
trigger_name varchar(200) not null comment 'qrtz_triggers表trigger_name的外键',
|
||||
trigger_group varchar(200) not null comment 'qrtz_triggers表trigger_group的外键',
|
||||
cron_expression varchar(200) not null comment 'cron表达式',
|
||||
time_zone_id varchar(80) comment '时区',
|
||||
primary key (sched_name, trigger_name, trigger_group),
|
||||
foreign key (sched_name, trigger_name, trigger_group) references QRTZ_TRIGGERS(sched_name, trigger_name, trigger_group)
|
||||
) engine=innodb comment = 'Cron类型的触发器表';
|
||||
|
||||
-- ----------------------------
|
||||
-- 5、 Trigger 作为 Blob 类型存储(用于 Quartz 用户用 JDBC 创建他们自己定制的 Trigger 类型,JobStore 并不知道如何存储实例的时候)
|
||||
-- ----------------------------
|
||||
create table QRTZ_BLOB_TRIGGERS (
|
||||
sched_name varchar(120) not null comment '调度名称',
|
||||
trigger_name varchar(200) not null comment 'qrtz_triggers表trigger_name的外键',
|
||||
trigger_group varchar(200) not null comment 'qrtz_triggers表trigger_group的外键',
|
||||
blob_data blob null comment '存放持久化Trigger对象',
|
||||
primary key (sched_name, trigger_name, trigger_group),
|
||||
foreign key (sched_name, trigger_name, trigger_group) references QRTZ_TRIGGERS(sched_name, trigger_name, trigger_group)
|
||||
) engine=innodb comment = 'Blob类型的触发器表';
|
||||
|
||||
-- ----------------------------
|
||||
-- 6、 以 Blob 类型存储存放日历信息, quartz可配置一个日历来指定一个时间范围
|
||||
-- ----------------------------
|
||||
create table QRTZ_CALENDARS (
|
||||
sched_name varchar(120) not null comment '调度名称',
|
||||
calendar_name varchar(200) not null comment '日历名称',
|
||||
calendar blob not null comment '存放持久化calendar对象',
|
||||
primary key (sched_name, calendar_name)
|
||||
) engine=innodb comment = '日历信息表';
|
||||
|
||||
-- ----------------------------
|
||||
-- 7、 存储已暂停的 Trigger 组的信息
|
||||
-- ----------------------------
|
||||
create table QRTZ_PAUSED_TRIGGER_GRPS (
|
||||
sched_name varchar(120) not null comment '调度名称',
|
||||
trigger_group varchar(200) not null comment 'qrtz_triggers表trigger_group的外键',
|
||||
primary key (sched_name, trigger_group)
|
||||
) engine=innodb comment = '暂停的触发器表';
|
||||
|
||||
-- ----------------------------
|
||||
-- 8、 存储与已触发的 Trigger 相关的状态信息,以及相联 Job 的执行信息
|
||||
-- ----------------------------
|
||||
create table QRTZ_FIRED_TRIGGERS (
|
||||
sched_name varchar(120) not null comment '调度名称',
|
||||
entry_id varchar(95) not null comment '调度器实例id',
|
||||
trigger_name varchar(200) not null comment 'qrtz_triggers表trigger_name的外键',
|
||||
trigger_group varchar(200) not null comment 'qrtz_triggers表trigger_group的外键',
|
||||
instance_name varchar(200) not null comment '调度器实例名',
|
||||
fired_time bigint(13) not null comment '触发的时间',
|
||||
sched_time bigint(13) not null comment '定时器制定的时间',
|
||||
priority integer not null comment '优先级',
|
||||
state varchar(16) not null comment '状态',
|
||||
job_name varchar(200) null comment '任务名称',
|
||||
job_group varchar(200) null comment '任务组名',
|
||||
is_nonconcurrent varchar(1) null comment '是否并发',
|
||||
requests_recovery varchar(1) null comment '是否接受恢复执行',
|
||||
primary key (sched_name, entry_id)
|
||||
) engine=innodb comment = '已触发的触发器表';
|
||||
|
||||
-- ----------------------------
|
||||
-- 9、 存储少量的有关 Scheduler 的状态信息,假如是用于集群中,可以看到其他的 Scheduler 实例
|
||||
-- ----------------------------
|
||||
create table QRTZ_SCHEDULER_STATE (
|
||||
sched_name varchar(120) not null comment '调度名称',
|
||||
instance_name varchar(200) not null comment '实例名称',
|
||||
last_checkin_time bigint(13) not null comment '上次检查时间',
|
||||
checkin_interval bigint(13) not null comment '检查间隔时间',
|
||||
primary key (sched_name, instance_name)
|
||||
) engine=innodb comment = '调度器状态表';
|
||||
|
||||
-- ----------------------------
|
||||
-- 10、 存储程序的悲观锁的信息(假如使用了悲观锁)
|
||||
-- ----------------------------
|
||||
create table QRTZ_LOCKS (
|
||||
sched_name varchar(120) not null comment '调度名称',
|
||||
lock_name varchar(40) not null comment '悲观锁名称',
|
||||
primary key (sched_name, lock_name)
|
||||
) engine=innodb comment = '存储的悲观锁信息表';
|
||||
|
||||
-- ----------------------------
|
||||
-- 11、 Quartz集群实现同步机制的行锁表
|
||||
-- ----------------------------
|
||||
create table QRTZ_SIMPROP_TRIGGERS (
|
||||
sched_name varchar(120) not null comment '调度名称',
|
||||
trigger_name varchar(200) not null comment 'qrtz_triggers表trigger_name的外键',
|
||||
trigger_group varchar(200) not null comment 'qrtz_triggers表trigger_group的外键',
|
||||
str_prop_1 varchar(512) null comment 'String类型的trigger的第一个参数',
|
||||
str_prop_2 varchar(512) null comment 'String类型的trigger的第二个参数',
|
||||
str_prop_3 varchar(512) null comment 'String类型的trigger的第三个参数',
|
||||
int_prop_1 int null comment 'int类型的trigger的第一个参数',
|
||||
int_prop_2 int null comment 'int类型的trigger的第二个参数',
|
||||
long_prop_1 bigint null comment 'long类型的trigger的第一个参数',
|
||||
long_prop_2 bigint null comment 'long类型的trigger的第二个参数',
|
||||
dec_prop_1 numeric(13,4) null comment 'decimal类型的trigger的第一个参数',
|
||||
dec_prop_2 numeric(13,4) null comment 'decimal类型的trigger的第二个参数',
|
||||
bool_prop_1 varchar(1) null comment 'Boolean类型的trigger的第一个参数',
|
||||
bool_prop_2 varchar(1) null comment 'Boolean类型的trigger的第二个参数',
|
||||
primary key (sched_name, trigger_name, trigger_group),
|
||||
foreign key (sched_name, trigger_name, trigger_group) references QRTZ_TRIGGERS(sched_name, trigger_name, trigger_group)
|
||||
) engine=innodb comment = '同步机制的行锁表';
|
||||
|
||||
commit;
|
||||
@@ -1,701 +0,0 @@
|
||||
-- ----------------------------
|
||||
-- 1、部门表
|
||||
-- ----------------------------
|
||||
drop table if exists sys_dept;
|
||||
create table sys_dept (
|
||||
dept_id bigint(20) not null auto_increment comment '部门id',
|
||||
parent_id bigint(20) default 0 comment '父部门id',
|
||||
ancestors varchar(50) default '' comment '祖级列表',
|
||||
dept_name varchar(30) default '' comment '部门名称',
|
||||
order_num int(4) default 0 comment '显示顺序',
|
||||
leader varchar(20) default null comment '负责人',
|
||||
phone varchar(11) default null comment '联系电话',
|
||||
email varchar(50) default null comment '邮箱',
|
||||
status char(1) default '0' comment '部门状态(0正常 1停用)',
|
||||
del_flag char(1) default '0' comment '删除标志(0代表存在 2代表删除)',
|
||||
create_by varchar(64) default '' comment '创建者',
|
||||
create_time datetime comment '创建时间',
|
||||
update_by varchar(64) default '' comment '更新者',
|
||||
update_time datetime comment '更新时间',
|
||||
primary key (dept_id)
|
||||
) engine=innodb auto_increment=200 comment = '部门表';
|
||||
|
||||
-- ----------------------------
|
||||
-- 初始化-部门表数据
|
||||
-- ----------------------------
|
||||
insert into sys_dept values(100, 0, '0', '若依科技', 0, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
|
||||
insert into sys_dept values(101, 100, '0,100', '深圳总公司', 1, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
|
||||
insert into sys_dept values(102, 100, '0,100', '长沙分公司', 2, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
|
||||
insert into sys_dept values(103, 101, '0,100,101', '研发部门', 1, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
|
||||
insert into sys_dept values(104, 101, '0,100,101', '市场部门', 2, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
|
||||
insert into sys_dept values(105, 101, '0,100,101', '测试部门', 3, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
|
||||
insert into sys_dept values(106, 101, '0,100,101', '财务部门', 4, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
|
||||
insert into sys_dept values(107, 101, '0,100,101', '运维部门', 5, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
|
||||
insert into sys_dept values(108, 102, '0,100,102', '市场部门', 1, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
|
||||
insert into sys_dept values(109, 102, '0,100,102', '财务部门', 2, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null);
|
||||
|
||||
|
||||
-- ----------------------------
|
||||
-- 2、用户信息表
|
||||
-- ----------------------------
|
||||
drop table if exists sys_user;
|
||||
create table sys_user (
|
||||
user_id bigint(20) not null auto_increment comment '用户ID',
|
||||
dept_id bigint(20) default null comment '部门ID',
|
||||
user_name varchar(30) not null comment '用户账号',
|
||||
nick_name varchar(30) not null comment '用户昵称',
|
||||
user_type varchar(2) default '00' comment '用户类型(00系统用户)',
|
||||
email varchar(50) default '' comment '用户邮箱',
|
||||
phonenumber varchar(11) default '' comment '手机号码',
|
||||
sex char(1) default '0' comment '用户性别(0男 1女 2未知)',
|
||||
avatar varchar(100) default '' comment '头像地址',
|
||||
password varchar(100) default '' comment '密码',
|
||||
status char(1) default '0' comment '帐号状态(0正常 1停用)',
|
||||
del_flag char(1) default '0' comment '删除标志(0代表存在 2代表删除)',
|
||||
login_ip varchar(128) default '' comment '最后登录IP',
|
||||
login_date datetime comment '最后登录时间',
|
||||
create_by varchar(64) default '' comment '创建者',
|
||||
create_time datetime comment '创建时间',
|
||||
update_by varchar(64) default '' comment '更新者',
|
||||
update_time datetime comment '更新时间',
|
||||
remark varchar(500) default null comment '备注',
|
||||
primary key (user_id)
|
||||
) engine=innodb auto_increment=100 comment = '用户信息表';
|
||||
|
||||
-- ----------------------------
|
||||
-- 初始化-用户信息表数据
|
||||
-- ----------------------------
|
||||
insert into sys_user values(1, 103, 'admin', '若依', '00', 'ry@163.com', '15888888888', '1', '', '$2a$10$7JB720yubVSZvUI0rEqK/.VqGOZTH.ulu33dHOiBE8ByOhJIrdAu2', '0', '0', '127.0.0.1', sysdate(), 'admin', sysdate(), '', null, '管理员');
|
||||
insert into sys_user values(2, 105, 'ry', '若依', '00', 'ry@qq.com', '15666666666', '1', '', '$2a$10$7JB720yubVSZvUI0rEqK/.VqGOZTH.ulu33dHOiBE8ByOhJIrdAu2', '0', '0', '127.0.0.1', sysdate(), 'admin', sysdate(), '', null, '测试员');
|
||||
|
||||
|
||||
-- ----------------------------
|
||||
-- 3、岗位信息表
|
||||
-- ----------------------------
|
||||
drop table if exists sys_post;
|
||||
create table sys_post
|
||||
(
|
||||
post_id bigint(20) not null auto_increment comment '岗位ID',
|
||||
post_code varchar(64) not null comment '岗位编码',
|
||||
post_name varchar(50) not null comment '岗位名称',
|
||||
post_sort int(4) not null comment '显示顺序',
|
||||
status char(1) not null comment '状态(0正常 1停用)',
|
||||
create_by varchar(64) default '' comment '创建者',
|
||||
create_time datetime comment '创建时间',
|
||||
update_by varchar(64) default '' comment '更新者',
|
||||
update_time datetime comment '更新时间',
|
||||
remark varchar(500) default null comment '备注',
|
||||
primary key (post_id)
|
||||
) engine=innodb comment = '岗位信息表';
|
||||
|
||||
-- ----------------------------
|
||||
-- 初始化-岗位信息表数据
|
||||
-- ----------------------------
|
||||
insert into sys_post values(1, 'ceo', '董事长', 1, '0', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_post values(2, 'se', '项目经理', 2, '0', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_post values(3, 'hr', '人力资源', 3, '0', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_post values(4, 'user', '普通员工', 4, '0', 'admin', sysdate(), '', null, '');
|
||||
|
||||
|
||||
-- ----------------------------
|
||||
-- 4、角色信息表
|
||||
-- ----------------------------
|
||||
drop table if exists sys_role;
|
||||
create table sys_role (
|
||||
role_id bigint(20) not null auto_increment comment '角色ID',
|
||||
role_name varchar(30) not null comment '角色名称',
|
||||
role_key varchar(100) not null comment '角色权限字符串',
|
||||
role_sort int(4) not null comment '显示顺序',
|
||||
data_scope char(1) default '1' comment '数据范围(1:全部数据权限 2:自定数据权限 3:本部门数据权限 4:本部门及以下数据权限)',
|
||||
menu_check_strictly tinyint(1) default 1 comment '菜单树选择项是否关联显示',
|
||||
dept_check_strictly tinyint(1) default 1 comment '部门树选择项是否关联显示',
|
||||
status char(1) not null comment '角色状态(0正常 1停用)',
|
||||
del_flag char(1) default '0' comment '删除标志(0代表存在 2代表删除)',
|
||||
create_by varchar(64) default '' comment '创建者',
|
||||
create_time datetime comment '创建时间',
|
||||
update_by varchar(64) default '' comment '更新者',
|
||||
update_time datetime comment '更新时间',
|
||||
remark varchar(500) default null comment '备注',
|
||||
primary key (role_id)
|
||||
) engine=innodb auto_increment=100 comment = '角色信息表';
|
||||
|
||||
-- ----------------------------
|
||||
-- 初始化-角色信息表数据
|
||||
-- ----------------------------
|
||||
insert into sys_role values('1', '超级管理员', 'admin', 1, 1, 1, 1, '0', '0', 'admin', sysdate(), '', null, '超级管理员');
|
||||
insert into sys_role values('2', '普通角色', 'common', 2, 2, 1, 1, '0', '0', 'admin', sysdate(), '', null, '普通角色');
|
||||
|
||||
|
||||
-- ----------------------------
|
||||
-- 5、菜单权限表
|
||||
-- ----------------------------
|
||||
drop table if exists sys_menu;
|
||||
create table sys_menu (
|
||||
menu_id bigint(20) not null auto_increment comment '菜单ID',
|
||||
menu_name varchar(50) not null comment '菜单名称',
|
||||
parent_id bigint(20) default 0 comment '父菜单ID',
|
||||
order_num int(4) default 0 comment '显示顺序',
|
||||
path varchar(200) default '' comment '路由地址',
|
||||
component varchar(255) default null comment '组件路径',
|
||||
query varchar(255) default null comment '路由参数',
|
||||
route_name varchar(50) default '' comment '路由名称',
|
||||
is_frame int(1) default 1 comment '是否为外链(0是 1否)',
|
||||
is_cache int(1) default 0 comment '是否缓存(0缓存 1不缓存)',
|
||||
menu_type char(1) default '' comment '菜单类型(M目录 C菜单 F按钮)',
|
||||
visible char(1) default 0 comment '菜单状态(0显示 1隐藏)',
|
||||
status char(1) default 0 comment '菜单状态(0正常 1停用)',
|
||||
perms varchar(100) default null comment '权限标识',
|
||||
icon varchar(100) default '#' comment '菜单图标',
|
||||
create_by varchar(64) default '' comment '创建者',
|
||||
create_time datetime comment '创建时间',
|
||||
update_by varchar(64) default '' comment '更新者',
|
||||
update_time datetime comment '更新时间',
|
||||
remark varchar(500) default '' comment '备注',
|
||||
primary key (menu_id)
|
||||
) engine=innodb auto_increment=2000 comment = '菜单权限表';
|
||||
|
||||
-- ----------------------------
|
||||
-- 初始化-菜单信息表数据
|
||||
-- ----------------------------
|
||||
-- 一级菜单
|
||||
insert into sys_menu values('1', '系统管理', '0', '1', 'system', null, '', '', 1, 0, 'M', '0', '0', '', 'system', 'admin', sysdate(), '', null, '系统管理目录');
|
||||
insert into sys_menu values('2', '系统监控', '0', '2', 'monitor', null, '', '', 1, 0, 'M', '0', '0', '', 'monitor', 'admin', sysdate(), '', null, '系统监控目录');
|
||||
insert into sys_menu values('3', '系统工具', '0', '3', 'tool', null, '', '', 1, 0, 'M', '0', '0', '', 'tool', 'admin', sysdate(), '', null, '系统工具目录');
|
||||
insert into sys_menu values('4', '若依官网', '0', '4', 'http://ruoyi.vip', null, '', '', 0, 0, 'M', '0', '0', '', 'guide', 'admin', sysdate(), '', null, '若依官网地址');
|
||||
-- 二级菜单
|
||||
insert into sys_menu values('100', '用户管理', '1', '1', 'user', 'system/user/index', '', '', 1, 0, 'C', '0', '0', 'system:user:list', 'user', 'admin', sysdate(), '', null, '用户管理菜单');
|
||||
insert into sys_menu values('101', '角色管理', '1', '2', 'role', 'system/role/index', '', '', 1, 0, 'C', '0', '0', 'system:role:list', 'peoples', 'admin', sysdate(), '', null, '角色管理菜单');
|
||||
insert into sys_menu values('102', '菜单管理', '1', '3', 'menu', 'system/menu/index', '', '', 1, 0, 'C', '0', '0', 'system:menu:list', 'tree-table', 'admin', sysdate(), '', null, '菜单管理菜单');
|
||||
insert into sys_menu values('103', '部门管理', '1', '4', 'dept', 'system/dept/index', '', '', 1, 0, 'C', '0', '0', 'system:dept:list', 'tree', 'admin', sysdate(), '', null, '部门管理菜单');
|
||||
insert into sys_menu values('104', '岗位管理', '1', '5', 'post', 'system/post/index', '', '', 1, 0, 'C', '0', '0', 'system:post:list', 'post', 'admin', sysdate(), '', null, '岗位管理菜单');
|
||||
insert into sys_menu values('105', '字典管理', '1', '6', 'dict', 'system/dict/index', '', '', 1, 0, 'C', '0', '0', 'system:dict:list', 'dict', 'admin', sysdate(), '', null, '字典管理菜单');
|
||||
insert into sys_menu values('106', '参数设置', '1', '7', 'config', 'system/config/index', '', '', 1, 0, 'C', '0', '0', 'system:config:list', 'edit', 'admin', sysdate(), '', null, '参数设置菜单');
|
||||
insert into sys_menu values('107', '通知公告', '1', '8', 'notice', 'system/notice/index', '', '', 1, 0, 'C', '0', '0', 'system:notice:list', 'message', 'admin', sysdate(), '', null, '通知公告菜单');
|
||||
insert into sys_menu values('108', '日志管理', '1', '9', 'log', '', '', '', 1, 0, 'M', '0', '0', '', 'log', 'admin', sysdate(), '', null, '日志管理菜单');
|
||||
insert into sys_menu values('109', '在线用户', '2', '1', 'online', 'monitor/online/index', '', '', 1, 0, 'C', '0', '0', 'monitor:online:list', 'online', 'admin', sysdate(), '', null, '在线用户菜单');
|
||||
insert into sys_menu values('110', '定时任务', '2', '2', 'job', 'monitor/job/index', '', '', 1, 0, 'C', '0', '0', 'monitor:job:list', 'job', 'admin', sysdate(), '', null, '定时任务菜单');
|
||||
insert into sys_menu values('111', '数据监控', '2', '3', 'druid', 'monitor/druid/index', '', '', 1, 0, 'C', '0', '0', 'monitor:druid:list', 'druid', 'admin', sysdate(), '', null, '数据监控菜单');
|
||||
insert into sys_menu values('112', '服务监控', '2', '4', 'server', 'monitor/server/index', '', '', 1, 0, 'C', '0', '0', 'monitor:server:list', 'server', 'admin', sysdate(), '', null, '服务监控菜单');
|
||||
insert into sys_menu values('113', '缓存监控', '2', '5', 'cache', 'monitor/cache/index', '', '', 1, 0, 'C', '0', '0', 'monitor:cache:list', 'redis', 'admin', sysdate(), '', null, '缓存监控菜单');
|
||||
insert into sys_menu values('114', '缓存列表', '2', '6', 'cacheList', 'monitor/cache/list', '', '', 1, 0, 'C', '0', '0', 'monitor:cache:list', 'redis-list', 'admin', sysdate(), '', null, '缓存列表菜单');
|
||||
insert into sys_menu values('115', '表单构建', '3', '1', 'build', 'tool/build/index', '', '', 1, 0, 'C', '0', '0', 'tool:build:list', 'build', 'admin', sysdate(), '', null, '表单构建菜单');
|
||||
insert into sys_menu values('116', '代码生成', '3', '2', 'gen', 'tool/gen/index', '', '', 1, 0, 'C', '0', '0', 'tool:gen:list', 'code', 'admin', sysdate(), '', null, '代码生成菜单');
|
||||
insert into sys_menu values('117', '系统接口', '3', '3', 'swagger', 'tool/swagger/index', '', '', 1, 0, 'C', '0', '0', 'tool:swagger:list', 'swagger', 'admin', sysdate(), '', null, '系统接口菜单');
|
||||
-- 三级菜单
|
||||
insert into sys_menu values('500', '操作日志', '108', '1', 'operlog', 'monitor/operlog/index', '', '', 1, 0, 'C', '0', '0', 'monitor:operlog:list', 'form', 'admin', sysdate(), '', null, '操作日志菜单');
|
||||
insert into sys_menu values('501', '登录日志', '108', '2', 'logininfor', 'monitor/logininfor/index', '', '', 1, 0, 'C', '0', '0', 'monitor:logininfor:list', 'logininfor', 'admin', sysdate(), '', null, '登录日志菜单');
|
||||
-- 用户管理按钮
|
||||
insert into sys_menu values('1000', '用户查询', '100', '1', '', '', '', '', 1, 0, 'F', '0', '0', 'system:user:query', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1001', '用户新增', '100', '2', '', '', '', '', 1, 0, 'F', '0', '0', 'system:user:add', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1002', '用户修改', '100', '3', '', '', '', '', 1, 0, 'F', '0', '0', 'system:user:edit', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1003', '用户删除', '100', '4', '', '', '', '', 1, 0, 'F', '0', '0', 'system:user:remove', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1004', '用户导出', '100', '5', '', '', '', '', 1, 0, 'F', '0', '0', 'system:user:export', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1005', '用户导入', '100', '6', '', '', '', '', 1, 0, 'F', '0', '0', 'system:user:import', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1006', '重置密码', '100', '7', '', '', '', '', 1, 0, 'F', '0', '0', 'system:user:resetPwd', '#', 'admin', sysdate(), '', null, '');
|
||||
-- 角色管理按钮
|
||||
insert into sys_menu values('1007', '角色查询', '101', '1', '', '', '', '', 1, 0, 'F', '0', '0', 'system:role:query', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1008', '角色新增', '101', '2', '', '', '', '', 1, 0, 'F', '0', '0', 'system:role:add', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1009', '角色修改', '101', '3', '', '', '', '', 1, 0, 'F', '0', '0', 'system:role:edit', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1010', '角色删除', '101', '4', '', '', '', '', 1, 0, 'F', '0', '0', 'system:role:remove', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1011', '角色导出', '101', '5', '', '', '', '', 1, 0, 'F', '0', '0', 'system:role:export', '#', 'admin', sysdate(), '', null, '');
|
||||
-- 菜单管理按钮
|
||||
insert into sys_menu values('1012', '菜单查询', '102', '1', '', '', '', '', 1, 0, 'F', '0', '0', 'system:menu:query', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1013', '菜单新增', '102', '2', '', '', '', '', 1, 0, 'F', '0', '0', 'system:menu:add', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1014', '菜单修改', '102', '3', '', '', '', '', 1, 0, 'F', '0', '0', 'system:menu:edit', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1015', '菜单删除', '102', '4', '', '', '', '', 1, 0, 'F', '0', '0', 'system:menu:remove', '#', 'admin', sysdate(), '', null, '');
|
||||
-- 部门管理按钮
|
||||
insert into sys_menu values('1016', '部门查询', '103', '1', '', '', '', '', 1, 0, 'F', '0', '0', 'system:dept:query', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1017', '部门新增', '103', '2', '', '', '', '', 1, 0, 'F', '0', '0', 'system:dept:add', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1018', '部门修改', '103', '3', '', '', '', '', 1, 0, 'F', '0', '0', 'system:dept:edit', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1019', '部门删除', '103', '4', '', '', '', '', 1, 0, 'F', '0', '0', 'system:dept:remove', '#', 'admin', sysdate(), '', null, '');
|
||||
-- 岗位管理按钮
|
||||
insert into sys_menu values('1020', '岗位查询', '104', '1', '', '', '', '', 1, 0, 'F', '0', '0', 'system:post:query', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1021', '岗位新增', '104', '2', '', '', '', '', 1, 0, 'F', '0', '0', 'system:post:add', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1022', '岗位修改', '104', '3', '', '', '', '', 1, 0, 'F', '0', '0', 'system:post:edit', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1023', '岗位删除', '104', '4', '', '', '', '', 1, 0, 'F', '0', '0', 'system:post:remove', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1024', '岗位导出', '104', '5', '', '', '', '', 1, 0, 'F', '0', '0', 'system:post:export', '#', 'admin', sysdate(), '', null, '');
|
||||
-- 字典管理按钮
|
||||
insert into sys_menu values('1025', '字典查询', '105', '1', '#', '', '', '', 1, 0, 'F', '0', '0', 'system:dict:query', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1026', '字典新增', '105', '2', '#', '', '', '', 1, 0, 'F', '0', '0', 'system:dict:add', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1027', '字典修改', '105', '3', '#', '', '', '', 1, 0, 'F', '0', '0', 'system:dict:edit', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1028', '字典删除', '105', '4', '#', '', '', '', 1, 0, 'F', '0', '0', 'system:dict:remove', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1029', '字典导出', '105', '5', '#', '', '', '', 1, 0, 'F', '0', '0', 'system:dict:export', '#', 'admin', sysdate(), '', null, '');
|
||||
-- 参数设置按钮
|
||||
insert into sys_menu values('1030', '参数查询', '106', '1', '#', '', '', '', 1, 0, 'F', '0', '0', 'system:config:query', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1031', '参数新增', '106', '2', '#', '', '', '', 1, 0, 'F', '0', '0', 'system:config:add', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1032', '参数修改', '106', '3', '#', '', '', '', 1, 0, 'F', '0', '0', 'system:config:edit', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1033', '参数删除', '106', '4', '#', '', '', '', 1, 0, 'F', '0', '0', 'system:config:remove', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1034', '参数导出', '106', '5', '#', '', '', '', 1, 0, 'F', '0', '0', 'system:config:export', '#', 'admin', sysdate(), '', null, '');
|
||||
-- 通知公告按钮
|
||||
insert into sys_menu values('1035', '公告查询', '107', '1', '#', '', '', '', 1, 0, 'F', '0', '0', 'system:notice:query', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1036', '公告新增', '107', '2', '#', '', '', '', 1, 0, 'F', '0', '0', 'system:notice:add', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1037', '公告修改', '107', '3', '#', '', '', '', 1, 0, 'F', '0', '0', 'system:notice:edit', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1038', '公告删除', '107', '4', '#', '', '', '', 1, 0, 'F', '0', '0', 'system:notice:remove', '#', 'admin', sysdate(), '', null, '');
|
||||
-- 操作日志按钮
|
||||
insert into sys_menu values('1039', '操作查询', '500', '1', '#', '', '', '', 1, 0, 'F', '0', '0', 'monitor:operlog:query', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1040', '操作删除', '500', '2', '#', '', '', '', 1, 0, 'F', '0', '0', 'monitor:operlog:remove', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1041', '日志导出', '500', '3', '#', '', '', '', 1, 0, 'F', '0', '0', 'monitor:operlog:export', '#', 'admin', sysdate(), '', null, '');
|
||||
-- 登录日志按钮
|
||||
insert into sys_menu values('1042', '登录查询', '501', '1', '#', '', '', '', 1, 0, 'F', '0', '0', 'monitor:logininfor:query', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1043', '登录删除', '501', '2', '#', '', '', '', 1, 0, 'F', '0', '0', 'monitor:logininfor:remove', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1044', '日志导出', '501', '3', '#', '', '', '', 1, 0, 'F', '0', '0', 'monitor:logininfor:export', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1045', '账户解锁', '501', '4', '#', '', '', '', 1, 0, 'F', '0', '0', 'monitor:logininfor:unlock', '#', 'admin', sysdate(), '', null, '');
|
||||
-- 在线用户按钮
|
||||
insert into sys_menu values('1046', '在线查询', '109', '1', '#', '', '', '', 1, 0, 'F', '0', '0', 'monitor:online:query', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1047', '批量强退', '109', '2', '#', '', '', '', 1, 0, 'F', '0', '0', 'monitor:online:batchLogout', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1048', '单条强退', '109', '3', '#', '', '', '', 1, 0, 'F', '0', '0', 'monitor:online:forceLogout', '#', 'admin', sysdate(), '', null, '');
|
||||
-- 定时任务按钮
|
||||
insert into sys_menu values('1049', '任务查询', '110', '1', '#', '', '', '', 1, 0, 'F', '0', '0', 'monitor:job:query', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1050', '任务新增', '110', '2', '#', '', '', '', 1, 0, 'F', '0', '0', 'monitor:job:add', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1051', '任务修改', '110', '3', '#', '', '', '', 1, 0, 'F', '0', '0', 'monitor:job:edit', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1052', '任务删除', '110', '4', '#', '', '', '', 1, 0, 'F', '0', '0', 'monitor:job:remove', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1053', '状态修改', '110', '5', '#', '', '', '', 1, 0, 'F', '0', '0', 'monitor:job:changeStatus', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1054', '任务导出', '110', '6', '#', '', '', '', 1, 0, 'F', '0', '0', 'monitor:job:export', '#', 'admin', sysdate(), '', null, '');
|
||||
-- 代码生成按钮
|
||||
insert into sys_menu values('1055', '生成查询', '116', '1', '#', '', '', '', 1, 0, 'F', '0', '0', 'tool:gen:query', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1056', '生成修改', '116', '2', '#', '', '', '', 1, 0, 'F', '0', '0', 'tool:gen:edit', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1057', '生成删除', '116', '3', '#', '', '', '', 1, 0, 'F', '0', '0', 'tool:gen:remove', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1058', '导入代码', '116', '4', '#', '', '', '', 1, 0, 'F', '0', '0', 'tool:gen:import', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1059', '预览代码', '116', '5', '#', '', '', '', 1, 0, 'F', '0', '0', 'tool:gen:preview', '#', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_menu values('1060', '生成代码', '116', '6', '#', '', '', '', 1, 0, 'F', '0', '0', 'tool:gen:code', '#', 'admin', sysdate(), '', null, '');
|
||||
|
||||
|
||||
-- ----------------------------
|
||||
-- 6、用户和角色关联表 用户N-1角色
|
||||
-- ----------------------------
|
||||
drop table if exists sys_user_role;
|
||||
create table sys_user_role (
|
||||
user_id bigint(20) not null comment '用户ID',
|
||||
role_id bigint(20) not null comment '角色ID',
|
||||
primary key(user_id, role_id)
|
||||
) engine=innodb comment = '用户和角色关联表';
|
||||
|
||||
-- ----------------------------
|
||||
-- 初始化-用户和角色关联表数据
|
||||
-- ----------------------------
|
||||
insert into sys_user_role values ('1', '1');
|
||||
insert into sys_user_role values ('2', '2');
|
||||
|
||||
|
||||
-- ----------------------------
|
||||
-- 7、角色和菜单关联表 角色1-N菜单
|
||||
-- ----------------------------
|
||||
drop table if exists sys_role_menu;
|
||||
create table sys_role_menu (
|
||||
role_id bigint(20) not null comment '角色ID',
|
||||
menu_id bigint(20) not null comment '菜单ID',
|
||||
primary key(role_id, menu_id)
|
||||
) engine=innodb comment = '角色和菜单关联表';
|
||||
|
||||
-- ----------------------------
|
||||
-- 初始化-角色和菜单关联表数据
|
||||
-- ----------------------------
|
||||
insert into sys_role_menu values ('2', '1');
|
||||
insert into sys_role_menu values ('2', '2');
|
||||
insert into sys_role_menu values ('2', '3');
|
||||
insert into sys_role_menu values ('2', '4');
|
||||
insert into sys_role_menu values ('2', '100');
|
||||
insert into sys_role_menu values ('2', '101');
|
||||
insert into sys_role_menu values ('2', '102');
|
||||
insert into sys_role_menu values ('2', '103');
|
||||
insert into sys_role_menu values ('2', '104');
|
||||
insert into sys_role_menu values ('2', '105');
|
||||
insert into sys_role_menu values ('2', '106');
|
||||
insert into sys_role_menu values ('2', '107');
|
||||
insert into sys_role_menu values ('2', '108');
|
||||
insert into sys_role_menu values ('2', '109');
|
||||
insert into sys_role_menu values ('2', '110');
|
||||
insert into sys_role_menu values ('2', '111');
|
||||
insert into sys_role_menu values ('2', '112');
|
||||
insert into sys_role_menu values ('2', '113');
|
||||
insert into sys_role_menu values ('2', '114');
|
||||
insert into sys_role_menu values ('2', '115');
|
||||
insert into sys_role_menu values ('2', '116');
|
||||
insert into sys_role_menu values ('2', '117');
|
||||
insert into sys_role_menu values ('2', '500');
|
||||
insert into sys_role_menu values ('2', '501');
|
||||
insert into sys_role_menu values ('2', '1000');
|
||||
insert into sys_role_menu values ('2', '1001');
|
||||
insert into sys_role_menu values ('2', '1002');
|
||||
insert into sys_role_menu values ('2', '1003');
|
||||
insert into sys_role_menu values ('2', '1004');
|
||||
insert into sys_role_menu values ('2', '1005');
|
||||
insert into sys_role_menu values ('2', '1006');
|
||||
insert into sys_role_menu values ('2', '1007');
|
||||
insert into sys_role_menu values ('2', '1008');
|
||||
insert into sys_role_menu values ('2', '1009');
|
||||
insert into sys_role_menu values ('2', '1010');
|
||||
insert into sys_role_menu values ('2', '1011');
|
||||
insert into sys_role_menu values ('2', '1012');
|
||||
insert into sys_role_menu values ('2', '1013');
|
||||
insert into sys_role_menu values ('2', '1014');
|
||||
insert into sys_role_menu values ('2', '1015');
|
||||
insert into sys_role_menu values ('2', '1016');
|
||||
insert into sys_role_menu values ('2', '1017');
|
||||
insert into sys_role_menu values ('2', '1018');
|
||||
insert into sys_role_menu values ('2', '1019');
|
||||
insert into sys_role_menu values ('2', '1020');
|
||||
insert into sys_role_menu values ('2', '1021');
|
||||
insert into sys_role_menu values ('2', '1022');
|
||||
insert into sys_role_menu values ('2', '1023');
|
||||
insert into sys_role_menu values ('2', '1024');
|
||||
insert into sys_role_menu values ('2', '1025');
|
||||
insert into sys_role_menu values ('2', '1026');
|
||||
insert into sys_role_menu values ('2', '1027');
|
||||
insert into sys_role_menu values ('2', '1028');
|
||||
insert into sys_role_menu values ('2', '1029');
|
||||
insert into sys_role_menu values ('2', '1030');
|
||||
insert into sys_role_menu values ('2', '1031');
|
||||
insert into sys_role_menu values ('2', '1032');
|
||||
insert into sys_role_menu values ('2', '1033');
|
||||
insert into sys_role_menu values ('2', '1034');
|
||||
insert into sys_role_menu values ('2', '1035');
|
||||
insert into sys_role_menu values ('2', '1036');
|
||||
insert into sys_role_menu values ('2', '1037');
|
||||
insert into sys_role_menu values ('2', '1038');
|
||||
insert into sys_role_menu values ('2', '1039');
|
||||
insert into sys_role_menu values ('2', '1040');
|
||||
insert into sys_role_menu values ('2', '1041');
|
||||
insert into sys_role_menu values ('2', '1042');
|
||||
insert into sys_role_menu values ('2', '1043');
|
||||
insert into sys_role_menu values ('2', '1044');
|
||||
insert into sys_role_menu values ('2', '1045');
|
||||
insert into sys_role_menu values ('2', '1046');
|
||||
insert into sys_role_menu values ('2', '1047');
|
||||
insert into sys_role_menu values ('2', '1048');
|
||||
insert into sys_role_menu values ('2', '1049');
|
||||
insert into sys_role_menu values ('2', '1050');
|
||||
insert into sys_role_menu values ('2', '1051');
|
||||
insert into sys_role_menu values ('2', '1052');
|
||||
insert into sys_role_menu values ('2', '1053');
|
||||
insert into sys_role_menu values ('2', '1054');
|
||||
insert into sys_role_menu values ('2', '1055');
|
||||
insert into sys_role_menu values ('2', '1056');
|
||||
insert into sys_role_menu values ('2', '1057');
|
||||
insert into sys_role_menu values ('2', '1058');
|
||||
insert into sys_role_menu values ('2', '1059');
|
||||
insert into sys_role_menu values ('2', '1060');
|
||||
|
||||
-- ----------------------------
|
||||
-- 8、角色和部门关联表 角色1-N部门
|
||||
-- ----------------------------
|
||||
drop table if exists sys_role_dept;
|
||||
create table sys_role_dept (
|
||||
role_id bigint(20) not null comment '角色ID',
|
||||
dept_id bigint(20) not null comment '部门ID',
|
||||
primary key(role_id, dept_id)
|
||||
) engine=innodb comment = '角色和部门关联表';
|
||||
|
||||
-- ----------------------------
|
||||
-- 初始化-角色和部门关联表数据
|
||||
-- ----------------------------
|
||||
insert into sys_role_dept values ('2', '100');
|
||||
insert into sys_role_dept values ('2', '101');
|
||||
insert into sys_role_dept values ('2', '105');
|
||||
|
||||
|
||||
-- ----------------------------
|
||||
-- 9、用户与岗位关联表 用户1-N岗位
|
||||
-- ----------------------------
|
||||
drop table if exists sys_user_post;
|
||||
create table sys_user_post
|
||||
(
|
||||
user_id bigint(20) not null comment '用户ID',
|
||||
post_id bigint(20) not null comment '岗位ID',
|
||||
primary key (user_id, post_id)
|
||||
) engine=innodb comment = '用户与岗位关联表';
|
||||
|
||||
-- ----------------------------
|
||||
-- 初始化-用户与岗位关联表数据
|
||||
-- ----------------------------
|
||||
insert into sys_user_post values ('1', '1');
|
||||
insert into sys_user_post values ('2', '2');
|
||||
|
||||
|
||||
-- ----------------------------
|
||||
-- 10、操作日志记录
|
||||
-- ----------------------------
|
||||
drop table if exists sys_oper_log;
|
||||
create table sys_oper_log (
|
||||
oper_id bigint(20) not null auto_increment comment '日志主键',
|
||||
title varchar(50) default '' comment '模块标题',
|
||||
business_type int(2) default 0 comment '业务类型(0其它 1新增 2修改 3删除)',
|
||||
method varchar(200) default '' comment '方法名称',
|
||||
request_method varchar(10) default '' comment '请求方式',
|
||||
operator_type int(1) default 0 comment '操作类别(0其它 1后台用户 2手机端用户)',
|
||||
oper_name varchar(50) default '' comment '操作人员',
|
||||
dept_name varchar(50) default '' comment '部门名称',
|
||||
oper_url varchar(255) default '' comment '请求URL',
|
||||
oper_ip varchar(128) default '' comment '主机地址',
|
||||
oper_location varchar(255) default '' comment '操作地点',
|
||||
oper_param varchar(2000) default '' comment '请求参数',
|
||||
json_result varchar(2000) default '' comment '返回参数',
|
||||
status int(1) default 0 comment '操作状态(0正常 1异常)',
|
||||
error_msg varchar(2000) default '' comment '错误消息',
|
||||
oper_time datetime comment '操作时间',
|
||||
cost_time bigint(20) default 0 comment '消耗时间',
|
||||
primary key (oper_id),
|
||||
key idx_sys_oper_log_bt (business_type),
|
||||
key idx_sys_oper_log_s (status),
|
||||
key idx_sys_oper_log_ot (oper_time)
|
||||
) engine=innodb auto_increment=100 comment = '操作日志记录';
|
||||
|
||||
|
||||
-- ----------------------------
|
||||
-- 11、字典类型表
|
||||
-- ----------------------------
|
||||
drop table if exists sys_dict_type;
|
||||
create table sys_dict_type
|
||||
(
|
||||
dict_id bigint(20) not null auto_increment comment '字典主键',
|
||||
dict_name varchar(100) default '' comment '字典名称',
|
||||
dict_type varchar(100) default '' comment '字典类型',
|
||||
status char(1) default '0' comment '状态(0正常 1停用)',
|
||||
create_by varchar(64) default '' comment '创建者',
|
||||
create_time datetime comment '创建时间',
|
||||
update_by varchar(64) default '' comment '更新者',
|
||||
update_time datetime comment '更新时间',
|
||||
remark varchar(500) default null comment '备注',
|
||||
primary key (dict_id),
|
||||
unique (dict_type)
|
||||
) engine=innodb auto_increment=100 comment = '字典类型表';
|
||||
|
||||
insert into sys_dict_type values(1, '用户性别', 'sys_user_sex', '0', 'admin', sysdate(), '', null, '用户性别列表');
|
||||
insert into sys_dict_type values(2, '菜单状态', 'sys_show_hide', '0', 'admin', sysdate(), '', null, '菜单状态列表');
|
||||
insert into sys_dict_type values(3, '系统开关', 'sys_normal_disable', '0', 'admin', sysdate(), '', null, '系统开关列表');
|
||||
insert into sys_dict_type values(4, '任务状态', 'sys_job_status', '0', 'admin', sysdate(), '', null, '任务状态列表');
|
||||
insert into sys_dict_type values(5, '任务分组', 'sys_job_group', '0', 'admin', sysdate(), '', null, '任务分组列表');
|
||||
insert into sys_dict_type values(6, '系统是否', 'sys_yes_no', '0', 'admin', sysdate(), '', null, '系统是否列表');
|
||||
insert into sys_dict_type values(7, '通知类型', 'sys_notice_type', '0', 'admin', sysdate(), '', null, '通知类型列表');
|
||||
insert into sys_dict_type values(8, '通知状态', 'sys_notice_status', '0', 'admin', sysdate(), '', null, '通知状态列表');
|
||||
insert into sys_dict_type values(9, '操作类型', 'sys_oper_type', '0', 'admin', sysdate(), '', null, '操作类型列表');
|
||||
insert into sys_dict_type values(10, '系统状态', 'sys_common_status', '0', 'admin', sysdate(), '', null, '登录状态列表');
|
||||
|
||||
|
||||
-- ----------------------------
|
||||
-- 12、字典数据表
|
||||
-- ----------------------------
|
||||
drop table if exists sys_dict_data;
|
||||
create table sys_dict_data
|
||||
(
|
||||
dict_code bigint(20) not null auto_increment comment '字典编码',
|
||||
dict_sort int(4) default 0 comment '字典排序',
|
||||
dict_label varchar(100) default '' comment '字典标签',
|
||||
dict_value varchar(100) default '' comment '字典键值',
|
||||
dict_type varchar(100) default '' comment '字典类型',
|
||||
css_class varchar(100) default null comment '样式属性(其他样式扩展)',
|
||||
list_class varchar(100) default null comment '表格回显样式',
|
||||
is_default char(1) default 'N' comment '是否默认(Y是 N否)',
|
||||
status char(1) default '0' comment '状态(0正常 1停用)',
|
||||
create_by varchar(64) default '' comment '创建者',
|
||||
create_time datetime comment '创建时间',
|
||||
update_by varchar(64) default '' comment '更新者',
|
||||
update_time datetime comment '更新时间',
|
||||
remark varchar(500) default null comment '备注',
|
||||
primary key (dict_code)
|
||||
) engine=innodb auto_increment=100 comment = '字典数据表';
|
||||
|
||||
insert into sys_dict_data values(1, 1, '男', '0', 'sys_user_sex', '', '', 'Y', '0', 'admin', sysdate(), '', null, '性别男');
|
||||
insert into sys_dict_data values(2, 2, '女', '1', 'sys_user_sex', '', '', 'N', '0', 'admin', sysdate(), '', null, '性别女');
|
||||
insert into sys_dict_data values(3, 3, '未知', '2', 'sys_user_sex', '', '', 'N', '0', 'admin', sysdate(), '', null, '性别未知');
|
||||
insert into sys_dict_data values(4, 1, '显示', '0', 'sys_show_hide', '', 'primary', 'Y', '0', 'admin', sysdate(), '', null, '显示菜单');
|
||||
insert into sys_dict_data values(5, 2, '隐藏', '1', 'sys_show_hide', '', 'danger', 'N', '0', 'admin', sysdate(), '', null, '隐藏菜单');
|
||||
insert into sys_dict_data values(6, 1, '正常', '0', 'sys_normal_disable', '', 'primary', 'Y', '0', 'admin', sysdate(), '', null, '正常状态');
|
||||
insert into sys_dict_data values(7, 2, '停用', '1', 'sys_normal_disable', '', 'danger', 'N', '0', 'admin', sysdate(), '', null, '停用状态');
|
||||
insert into sys_dict_data values(8, 1, '正常', '0', 'sys_job_status', '', 'primary', 'Y', '0', 'admin', sysdate(), '', null, '正常状态');
|
||||
insert into sys_dict_data values(9, 2, '暂停', '1', 'sys_job_status', '', 'danger', 'N', '0', 'admin', sysdate(), '', null, '停用状态');
|
||||
insert into sys_dict_data values(10, 1, '默认', 'DEFAULT', 'sys_job_group', '', '', 'Y', '0', 'admin', sysdate(), '', null, '默认分组');
|
||||
insert into sys_dict_data values(11, 2, '系统', 'SYSTEM', 'sys_job_group', '', '', 'N', '0', 'admin', sysdate(), '', null, '系统分组');
|
||||
insert into sys_dict_data values(12, 1, '是', 'Y', 'sys_yes_no', '', 'primary', 'Y', '0', 'admin', sysdate(), '', null, '系统默认是');
|
||||
insert into sys_dict_data values(13, 2, '否', 'N', 'sys_yes_no', '', 'danger', 'N', '0', 'admin', sysdate(), '', null, '系统默认否');
|
||||
insert into sys_dict_data values(14, 1, '通知', '1', 'sys_notice_type', '', 'warning', 'Y', '0', 'admin', sysdate(), '', null, '通知');
|
||||
insert into sys_dict_data values(15, 2, '公告', '2', 'sys_notice_type', '', 'success', 'N', '0', 'admin', sysdate(), '', null, '公告');
|
||||
insert into sys_dict_data values(16, 1, '正常', '0', 'sys_notice_status', '', 'primary', 'Y', '0', 'admin', sysdate(), '', null, '正常状态');
|
||||
insert into sys_dict_data values(17, 2, '关闭', '1', 'sys_notice_status', '', 'danger', 'N', '0', 'admin', sysdate(), '', null, '关闭状态');
|
||||
insert into sys_dict_data values(18, 99, '其他', '0', 'sys_oper_type', '', 'info', 'N', '0', 'admin', sysdate(), '', null, '其他操作');
|
||||
insert into sys_dict_data values(19, 1, '新增', '1', 'sys_oper_type', '', 'info', 'N', '0', 'admin', sysdate(), '', null, '新增操作');
|
||||
insert into sys_dict_data values(20, 2, '修改', '2', 'sys_oper_type', '', 'info', 'N', '0', 'admin', sysdate(), '', null, '修改操作');
|
||||
insert into sys_dict_data values(21, 3, '删除', '3', 'sys_oper_type', '', 'danger', 'N', '0', 'admin', sysdate(), '', null, '删除操作');
|
||||
insert into sys_dict_data values(22, 4, '授权', '4', 'sys_oper_type', '', 'primary', 'N', '0', 'admin', sysdate(), '', null, '授权操作');
|
||||
insert into sys_dict_data values(23, 5, '导出', '5', 'sys_oper_type', '', 'warning', 'N', '0', 'admin', sysdate(), '', null, '导出操作');
|
||||
insert into sys_dict_data values(24, 6, '导入', '6', 'sys_oper_type', '', 'warning', 'N', '0', 'admin', sysdate(), '', null, '导入操作');
|
||||
insert into sys_dict_data values(25, 7, '强退', '7', 'sys_oper_type', '', 'danger', 'N', '0', 'admin', sysdate(), '', null, '强退操作');
|
||||
insert into sys_dict_data values(26, 8, '生成代码', '8', 'sys_oper_type', '', 'warning', 'N', '0', 'admin', sysdate(), '', null, '生成操作');
|
||||
insert into sys_dict_data values(27, 9, '清空数据', '9', 'sys_oper_type', '', 'danger', 'N', '0', 'admin', sysdate(), '', null, '清空操作');
|
||||
insert into sys_dict_data values(28, 1, '成功', '0', 'sys_common_status', '', 'primary', 'N', '0', 'admin', sysdate(), '', null, '正常状态');
|
||||
insert into sys_dict_data values(29, 2, '失败', '1', 'sys_common_status', '', 'danger', 'N', '0', 'admin', sysdate(), '', null, '停用状态');
|
||||
|
||||
|
||||
-- ----------------------------
|
||||
-- 13、参数配置表
|
||||
-- ----------------------------
|
||||
drop table if exists sys_config;
|
||||
create table sys_config (
|
||||
config_id int(5) not null auto_increment comment '参数主键',
|
||||
config_name varchar(100) default '' comment '参数名称',
|
||||
config_key varchar(100) default '' comment '参数键名',
|
||||
config_value varchar(500) default '' comment '参数键值',
|
||||
config_type char(1) default 'N' comment '系统内置(Y是 N否)',
|
||||
create_by varchar(64) default '' comment '创建者',
|
||||
create_time datetime comment '创建时间',
|
||||
update_by varchar(64) default '' comment '更新者',
|
||||
update_time datetime comment '更新时间',
|
||||
remark varchar(500) default null comment '备注',
|
||||
primary key (config_id)
|
||||
) engine=innodb auto_increment=100 comment = '参数配置表';
|
||||
|
||||
insert into sys_config values(1, '主框架页-默认皮肤样式名称', 'sys.index.skinName', 'skin-blue', 'Y', 'admin', sysdate(), '', null, '蓝色 skin-blue、绿色 skin-green、紫色 skin-purple、红色 skin-red、黄色 skin-yellow' );
|
||||
insert into sys_config values(2, '用户管理-账号初始密码', 'sys.user.initPassword', '123456', 'Y', 'admin', sysdate(), '', null, '初始化密码 123456' );
|
||||
insert into sys_config values(3, '主框架页-侧边栏主题', 'sys.index.sideTheme', 'theme-dark', 'Y', 'admin', sysdate(), '', null, '深色主题theme-dark,浅色主题theme-light' );
|
||||
insert into sys_config values(4, '账号自助-验证码开关', 'sys.account.captchaEnabled', 'true', 'Y', 'admin', sysdate(), '', null, '是否开启验证码功能(true开启,false关闭)');
|
||||
insert into sys_config values(5, '账号自助-是否开启用户注册功能', 'sys.account.registerUser', 'false', 'Y', 'admin', sysdate(), '', null, '是否开启注册用户功能(true开启,false关闭)');
|
||||
insert into sys_config values(6, '用户登录-黑名单列表', 'sys.login.blackIPList', '', 'Y', 'admin', sysdate(), '', null, '设置登录IP黑名单限制,多个匹配项以;分隔,支持匹配(*通配、网段)');
|
||||
|
||||
|
||||
-- ----------------------------
|
||||
-- 14、系统访问记录
|
||||
-- ----------------------------
|
||||
drop table if exists sys_logininfor;
|
||||
create table sys_logininfor (
|
||||
info_id bigint(20) not null auto_increment comment '访问ID',
|
||||
user_name varchar(50) default '' comment '用户账号',
|
||||
ipaddr varchar(128) default '' comment '登录IP地址',
|
||||
login_location varchar(255) default '' comment '登录地点',
|
||||
browser varchar(50) default '' comment '浏览器类型',
|
||||
os varchar(50) default '' comment '操作系统',
|
||||
status char(1) default '0' comment '登录状态(0成功 1失败)',
|
||||
msg varchar(255) default '' comment '提示消息',
|
||||
login_time datetime comment '访问时间',
|
||||
primary key (info_id),
|
||||
key idx_sys_logininfor_s (status),
|
||||
key idx_sys_logininfor_lt (login_time)
|
||||
) engine=innodb auto_increment=100 comment = '系统访问记录';
|
||||
|
||||
|
||||
-- ----------------------------
|
||||
-- 15、定时任务调度表
|
||||
-- ----------------------------
|
||||
drop table if exists sys_job;
|
||||
create table sys_job (
|
||||
job_id bigint(20) not null auto_increment comment '任务ID',
|
||||
job_name varchar(64) default '' comment '任务名称',
|
||||
job_group varchar(64) default 'DEFAULT' comment '任务组名',
|
||||
invoke_target varchar(500) not null comment '调用目标字符串',
|
||||
cron_expression varchar(255) default '' comment 'cron执行表达式',
|
||||
misfire_policy varchar(20) default '3' comment '计划执行错误策略(1立即执行 2执行一次 3放弃执行)',
|
||||
concurrent char(1) default '1' comment '是否并发执行(0允许 1禁止)',
|
||||
status char(1) default '0' comment '状态(0正常 1暂停)',
|
||||
create_by varchar(64) default '' comment '创建者',
|
||||
create_time datetime comment '创建时间',
|
||||
update_by varchar(64) default '' comment '更新者',
|
||||
update_time datetime comment '更新时间',
|
||||
remark varchar(500) default '' comment '备注信息',
|
||||
primary key (job_id, job_name, job_group)
|
||||
) engine=innodb auto_increment=100 comment = '定时任务调度表';
|
||||
|
||||
insert into sys_job values(1, '系统默认(无参)', 'DEFAULT', 'ryTask.ryNoParams', '0/10 * * * * ?', '3', '1', '1', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_job values(2, '系统默认(有参)', 'DEFAULT', 'ryTask.ryParams(\'ry\')', '0/15 * * * * ?', '3', '1', '1', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_job values(3, '系统默认(多参)', 'DEFAULT', 'ryTask.ryMultipleParams(\'ry\', true, 2000L, 316.50D, 100)', '0/20 * * * * ?', '3', '1', '1', 'admin', sysdate(), '', null, '');
|
||||
|
||||
|
||||
-- ----------------------------
|
||||
-- 16、定时任务调度日志表
|
||||
-- ----------------------------
|
||||
drop table if exists sys_job_log;
|
||||
create table sys_job_log (
|
||||
job_log_id bigint(20) not null auto_increment comment '任务日志ID',
|
||||
job_name varchar(64) not null comment '任务名称',
|
||||
job_group varchar(64) not null comment '任务组名',
|
||||
invoke_target varchar(500) not null comment '调用目标字符串',
|
||||
job_message varchar(500) comment '日志信息',
|
||||
status char(1) default '0' comment '执行状态(0正常 1失败)',
|
||||
exception_info varchar(2000) default '' comment '异常信息',
|
||||
create_time datetime comment '创建时间',
|
||||
primary key (job_log_id)
|
||||
) engine=innodb comment = '定时任务调度日志表';
|
||||
|
||||
|
||||
-- ----------------------------
|
||||
-- 17、通知公告表
|
||||
-- ----------------------------
|
||||
drop table if exists sys_notice;
|
||||
create table sys_notice (
|
||||
notice_id int(4) not null auto_increment comment '公告ID',
|
||||
notice_title varchar(50) not null comment '公告标题',
|
||||
notice_type char(1) not null comment '公告类型(1通知 2公告)',
|
||||
notice_content longblob default null comment '公告内容',
|
||||
status char(1) default '0' comment '公告状态(0正常 1关闭)',
|
||||
create_by varchar(64) default '' comment '创建者',
|
||||
create_time datetime comment '创建时间',
|
||||
update_by varchar(64) default '' comment '更新者',
|
||||
update_time datetime comment '更新时间',
|
||||
remark varchar(255) default null comment '备注',
|
||||
primary key (notice_id)
|
||||
) engine=innodb auto_increment=10 comment = '通知公告表';
|
||||
|
||||
-- ----------------------------
|
||||
-- 初始化-公告信息表数据
|
||||
-- ----------------------------
|
||||
insert into sys_notice values('1', '温馨提醒:2018-07-01 若依新版本发布啦', '2', '新版本内容', '0', 'admin', sysdate(), '', null, '管理员');
|
||||
insert into sys_notice values('2', '维护通知:2018-07-01 若依系统凌晨维护', '1', '维护内容', '0', 'admin', sysdate(), '', null, '管理员');
|
||||
|
||||
|
||||
-- ----------------------------
|
||||
-- 18、代码生成业务表
|
||||
-- ----------------------------
|
||||
drop table if exists gen_table;
|
||||
create table gen_table (
|
||||
table_id bigint(20) not null auto_increment comment '编号',
|
||||
table_name varchar(200) default '' comment '表名称',
|
||||
table_comment varchar(500) default '' comment '表描述',
|
||||
sub_table_name varchar(64) default null comment '关联子表的表名',
|
||||
sub_table_fk_name varchar(64) default null comment '子表关联的外键名',
|
||||
class_name varchar(100) default '' comment '实体类名称',
|
||||
tpl_category varchar(200) default 'crud' comment '使用的模板(crud单表操作 tree树表操作)',
|
||||
tpl_web_type varchar(30) default '' comment '前端模板类型(element-ui模版 element-plus模版)',
|
||||
package_name varchar(100) comment '生成包路径',
|
||||
module_name varchar(30) comment '生成模块名',
|
||||
business_name varchar(30) comment '生成业务名',
|
||||
function_name varchar(50) comment '生成功能名',
|
||||
function_author varchar(50) comment '生成功能作者',
|
||||
gen_type char(1) default '0' comment '生成代码方式(0zip压缩包 1自定义路径)',
|
||||
gen_path varchar(200) default '/' comment '生成路径(不填默认项目路径)',
|
||||
options varchar(1000) comment '其它生成选项',
|
||||
create_by varchar(64) default '' comment '创建者',
|
||||
create_time datetime comment '创建时间',
|
||||
update_by varchar(64) default '' comment '更新者',
|
||||
update_time datetime comment '更新时间',
|
||||
remark varchar(500) default null comment '备注',
|
||||
primary key (table_id)
|
||||
) engine=innodb auto_increment=1 comment = '代码生成业务表';
|
||||
|
||||
|
||||
-- ----------------------------
|
||||
-- 19、代码生成业务表字段
|
||||
-- ----------------------------
|
||||
drop table if exists gen_table_column;
|
||||
create table gen_table_column (
|
||||
column_id bigint(20) not null auto_increment comment '编号',
|
||||
table_id bigint(20) comment '归属表编号',
|
||||
column_name varchar(200) comment '列名称',
|
||||
column_comment varchar(500) comment '列描述',
|
||||
column_type varchar(100) comment '列类型',
|
||||
java_type varchar(500) comment 'JAVA类型',
|
||||
java_field varchar(200) comment 'JAVA字段名',
|
||||
is_pk char(1) comment '是否主键(1是)',
|
||||
is_increment char(1) comment '是否自增(1是)',
|
||||
is_required char(1) comment '是否必填(1是)',
|
||||
is_insert char(1) comment '是否为插入字段(1是)',
|
||||
is_edit char(1) comment '是否编辑字段(1是)',
|
||||
is_list char(1) comment '是否列表字段(1是)',
|
||||
is_query char(1) comment '是否查询字段(1是)',
|
||||
query_type varchar(200) default 'EQ' comment '查询方式(等于、不等于、大于、小于、范围)',
|
||||
html_type varchar(200) comment '显示类型(文本框、文本域、下拉框、复选框、单选框、日期控件)',
|
||||
dict_type varchar(200) default '' comment '字典类型',
|
||||
sort int comment '排序',
|
||||
create_by varchar(64) default '' comment '创建者',
|
||||
create_time datetime comment '创建时间',
|
||||
update_by varchar(64) default '' comment '更新者',
|
||||
update_time datetime comment '更新时间',
|
||||
primary key (column_id)
|
||||
) engine=innodb auto_increment=1 comment = '代码生成业务表字段';
|
||||
@@ -1,89 +0,0 @@
|
||||
-- EasyCode source store tables
|
||||
-- Import after sql/db.sql when upgrading an existing database.
|
||||
|
||||
delete from sys_dict_data where dict_type = 'source_project_category';
|
||||
delete from sys_dict_type where dict_type = 'source_project_category';
|
||||
insert into sys_dict_type values(null, '源码分类', 'source_project_category', '0', 'admin', sysdate(), '', null, '源码库分类列表');
|
||||
insert into sys_dict_data values(null, 1, '企业管理系统', 'enterprise', 'source_project_category', '', 'primary', 'Y', '0', 'admin', sysdate(), '', null, '源码分类-企业管理系统');
|
||||
insert into sys_dict_data values(null, 2, '商城系统', 'mall', 'source_project_category', '', 'success', 'N', '0', 'admin', sysdate(), '', null, '源码分类-商城系统');
|
||||
insert into sys_dict_data values(null, 3, 'OA 办公', 'office', 'source_project_category', '', 'info', 'N', '0', 'admin', sysdate(), '', null, '源码分类-OA 办公');
|
||||
insert into sys_dict_data values(null, 4, '低代码平台', 'lowcode', 'source_project_category', '', 'warning', 'N', '0', 'admin', sysdate(), '', null, '源码分类-低代码平台');
|
||||
insert into sys_dict_data values(null, 5, '微服务脚手架', 'microservice', 'source_project_category', '', 'danger', 'N', '0', 'admin', sysdate(), '', null, '源码分类-微服务脚手架');
|
||||
|
||||
drop table if exists source_purchase;
|
||||
drop table if exists source_project;
|
||||
|
||||
create table source_project (
|
||||
project_id bigint(20) not null auto_increment comment '源码项目ID',
|
||||
slug varchar(100) not null comment '前台访问标识',
|
||||
project_name varchar(120) not null comment '项目名称',
|
||||
category varchar(50) default '' comment '分类',
|
||||
cover_text varchar(30) default '' comment '封面标识',
|
||||
summary varchar(500) default '' comment '项目摘要',
|
||||
description_md longtext comment 'Markdown项目描述',
|
||||
price bigint(20) default 0 comment '价格,单位分',
|
||||
view_count bigint(20) default 0 comment '浏览量',
|
||||
tags longtext comment '技术标签JSON',
|
||||
modules longtext comment '功能模块JSON',
|
||||
scenes longtext comment '适用场景JSON',
|
||||
resource_name varchar(200) default '' comment '源码资源名称',
|
||||
resource_url varchar(500) default '' comment '源码资源地址',
|
||||
resource_version varchar(50) default '' comment '源码资源版本',
|
||||
resource_size varchar(50) default '' comment '源码资源大小',
|
||||
sort int default 0 comment '排序',
|
||||
status char(1) default '0' comment '状态(0上架 1下架)',
|
||||
del_flag char(1) default '0' comment '删除标志(0存在 2删除)',
|
||||
create_by varchar(64) default '' comment '创建者',
|
||||
create_time datetime default null comment '创建时间',
|
||||
update_by varchar(64) default '' comment '更新者',
|
||||
update_time datetime default null comment '更新时间',
|
||||
remark varchar(500) default null comment '备注',
|
||||
primary key (project_id),
|
||||
unique key uk_source_project_slug (slug),
|
||||
key idx_source_project_category (category),
|
||||
key idx_source_project_status (status, del_flag)
|
||||
) engine=innodb auto_increment=100 default charset=utf8mb4 comment='源码库项目表';
|
||||
|
||||
create table source_purchase (
|
||||
purchase_id bigint(20) not null auto_increment comment '购买记录ID',
|
||||
project_id bigint(20) not null comment '源码项目ID',
|
||||
user_id bigint(20) not null comment '前台用户ID',
|
||||
order_no varchar(64) not null comment '订单号',
|
||||
amount bigint(20) default 0 comment '金额,单位分',
|
||||
pay_status char(1) default '0' comment '支付状态(0待支付 1已支付 2已取消)',
|
||||
resource_status char(1) default '0' comment '资源状态(0未发放 1已发放)',
|
||||
purchase_time datetime default null comment '购买时间',
|
||||
create_by varchar(64) default '' comment '创建者',
|
||||
create_time datetime default null comment '创建时间',
|
||||
update_by varchar(64) default '' comment '更新者',
|
||||
update_time datetime default null comment '更新时间',
|
||||
remark varchar(500) default null comment '备注',
|
||||
primary key (purchase_id),
|
||||
unique key uk_source_purchase_order_no (order_no),
|
||||
key idx_source_purchase_user (user_id),
|
||||
key idx_source_purchase_project (project_id),
|
||||
constraint fk_source_purchase_project foreign key (project_id) references source_project(project_id),
|
||||
constraint fk_source_purchase_user foreign key (user_id) references front_user(user_id)
|
||||
) engine=innodb auto_increment=100 default charset=utf8mb4 comment='源码购买记录表';
|
||||
|
||||
insert into source_project
|
||||
(project_id, slug, project_name, category, cover_text, summary, description_md, price, view_count, tags, modules, scenes, resource_name, resource_url, resource_version, resource_size, sort, status, del_flag, create_by, create_time, update_by, update_time, remark)
|
||||
values
|
||||
(100, 'dms-platform', '商用车 DMS 管理系统', 'enterprise', 'DMS', '覆盖经销商、维修工单、索赔、配件库存、服务活动和结算的商用车售后管理源码。',
|
||||
'# 商用车 DMS 管理系统\n\n这套源码面向商用车售后服务场景,提供经销商、车辆档案、维修工单、索赔流程、配件库存和结算对账等核心能力。\n\n## 核心功能\n\n- 经销商档案、服务站和维修技师管理\n- 车辆档案、保养提醒和维修历史追踪\n- 维修工单、派工、完工质检和费用结算\n- 配件入库、出库、调拨和库存预警\n- 索赔申请、审核、结算和统计报表', 39900, 2860,
|
||||
'["Spring Boot","Vue2","MySQL"]', '["经销商管理","维修工单","配件库存","索赔结算","服务活动"]', '["汽车后市场","商用车售后","经销商协同"]', '', '', '1.0.0', '', 1, '0', '0', 'admin', sysdate(), 'admin', sysdate(), null),
|
||||
(101, 'mall-order-system', '商城订单管理系统', 'mall', 'MALL', '包含商品、订单、支付、库存、优惠券、会员和后台统计模块的商城管理源码。',
|
||||
'# 商城订单管理系统\n\n项目提供从商品上架到订单履约的完整后台管理能力,适合作为中小型商城或订单中台的启动源码。\n\n## 功能模块\n\n- 商品分类、SKU、库存和上下架\n- 购物车、订单、支付记录和售后单\n- 优惠券、满减活动和会员等级\n- 后台统计看板和经营数据导出', 29900, 1980,
|
||||
'["Spring Cloud","Redis","Vue3"]', '["商品中心","订单中心","支付记录","会员体系","营销活动"]', '["电商后台","订单运营","会员营销"]', '', '', '1.0.0', '', 2, '0', '0', 'admin', sysdate(), 'admin', sysdate(), null),
|
||||
(102, 'oa-approval-suite', 'OA 办公审批系统', 'office', 'OA', '集成用户、角色、菜单、审批流、请假、报销、公告和文件管理的办公源码。',
|
||||
'# OA 办公审批系统\n\n这是一套偏企业内网办公的基础源码,重点覆盖审批、公告、文件与权限管理。\n\n## 亮点\n\n- 可配置审批节点和审批人\n- 请假、报销、外出等常见办公流程\n- 公告通知、附件上传和文件归档\n- 角色、菜单、按钮级权限控制', 26800, 1750,
|
||||
'["Sa-Token","Element UI","工作流"]', '["审批流程","请假报销","公告通知","文件管理","权限菜单"]', '["企业内网","行政审批","协同办公"]', '', '', '1.0.0', '', 3, '0', '0', 'admin', sysdate(), 'admin', sysdate(), null),
|
||||
(103, 'erp-warehouse', 'ERP 仓储管理系统', 'enterprise', 'ERP', '提供采购、销售、入库、出库、盘点、供应商和库存报表模块的仓储源码。',
|
||||
'# ERP 仓储管理系统\n\n源码聚焦进销存和仓储管理,适合小型供应链、仓库和贸易公司快速搭建业务后台。\n\n## 模块清单\n\n- 采购订单、采购入库和供应商档案\n- 销售订单、销售出库和客户档案\n- 库存流水、库存盘点和预警规则\n- Excel 导入导出与库存报表', 19900, 1320,
|
||||
'["ERP","MyBatis-Plus","Excel"]', '["采购入库","销售出库","库存盘点","供应商管理","报表导出"]', '["仓储管理","进销存","供应链后台"]', '', '', '1.0.0', '', 4, '0', '0', 'admin', sysdate(), 'admin', sysdate(), null),
|
||||
(104, 'lowcode-form-platform', '低代码表单平台', 'lowcode', 'FORM', '支持动态表单、拖拽布局、字段配置、数据字典和在线设计的低代码源码。',
|
||||
'# 低代码表单平台\n\n项目用于构建配置化表单和数据采集页面,包含设计器、字段配置、预览和提交数据管理。\n\n## 能力范围\n\n- 拖拽式表单组件编排\n- 字段属性、校验规则和选项配置\n- 字典数据联动\n- 表单预览与数据提交记录', 49900, 980,
|
||||
'["Vue3","Element Plus","拖拽设计"]', '["表单设计器","字段配置","动态校验","数据字典","表单预览"]', '["低代码平台","动态表单","配置化后台"]', '', '', '1.0.0', '', 5, '0', '0', 'admin', sysdate(), 'admin', sysdate(), null),
|
||||
(105, 'microservice-auth-starter', '微服务权限脚手架', 'microservice', 'MS', '集成网关、认证中心、系统服务、日志服务、文件服务和监控基础能力的脚手架源码。',
|
||||
'# 微服务权限脚手架\n\n这套源码适合从单体后台升级到微服务架构的团队,预置认证、网关、系统权限和基础监控能力。\n\n## 服务组成\n\n- Gateway 网关统一鉴权和路由\n- Auth 认证中心\n- System 系统权限服务\n- Log 操作日志服务\n- File 文件服务', 59900, 2560,
|
||||
'["Spring Cloud","Nacos","Gateway"]', '["网关服务","认证中心","系统服务","日志中心","文件服务"]', '["微服务基础架构","权限平台","多服务治理"]', '', '', '1.0.0', '', 6, '0', '0', 'admin', sysdate(), 'admin', sysdate(), null);
|
||||
@@ -1,32 +0,0 @@
|
||||
-- ----------------------------
|
||||
-- 项目结构节点表
|
||||
-- ----------------------------
|
||||
drop table if exists sys_project_structure;
|
||||
create table sys_project_structure (
|
||||
node_id bigint(20) not null auto_increment comment '节点ID',
|
||||
parent_id bigint(20) default 0 comment '父节点ID',
|
||||
node_name varchar(50) not null comment '节点名称',
|
||||
node_type varchar(20) not null comment '节点类型(folder/file)',
|
||||
module varchar(100) not null comment '功能模块',
|
||||
template_id bigint(20) comment '模板ID',
|
||||
table_id bigint(20) comment '关联表ID',
|
||||
category varchar(50) comment '文件类别',
|
||||
sort_order int(4) default 0 comment '显示顺序',
|
||||
status char(1) default '0' comment '状态(0正常 1停用)',
|
||||
create_by varchar(64) default '' comment '创建者',
|
||||
create_time datetime comment '创建时间',
|
||||
update_by varchar(64) default '' comment '更新者',
|
||||
update_time datetime comment '更新时间',
|
||||
primary key (node_id)
|
||||
) engine=innodb auto_increment=100 comment = '项目结构节点表';
|
||||
|
||||
-- ----------------------------
|
||||
-- 初始化-项目结构节点表数据
|
||||
-- ----------------------------
|
||||
insert into sys_project_structure values(1, 0, '项目根目录', 'folder', '根模块', null, null, null, 1, '0', 'admin', sysdate(), '', null);
|
||||
insert into sys_project_structure values(2, 1, 'src', 'folder', '源码', null, null, null, 1, '0', 'admin', sysdate(), '', null);
|
||||
insert into sys_project_structure values(3, 2, 'main', 'folder', '主目录', null, null, null, 1, '0', 'admin', sysdate(), '', null);
|
||||
insert into sys_project_structure values(4, 3, 'java', 'folder', '源代码', null, null, null, 1, '0', 'admin', sysdate(), '', null);
|
||||
insert into sys_project_structure values(5, 3, 'resources', 'folder', '资源', null, null, null, 2, '0', 'admin', sysdate(), '', null);
|
||||
insert into sys_project_structure values(6, 1, 'pom.xml', 'file', '依赖管理', null, null, 'xml', 2, '0', 'admin', sysdate(), '', null);
|
||||
insert into sys_project_structure values(7, 1, 'README.md', 'file', '说明文档', null, null, 'markdown', 3, '0', 'admin', sysdate(), '', null);
|
||||
Reference in New Issue
Block a user