| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120 |
- -- ----------------------------
- -- 第三方平台授权表
- -- ----------------------------
- drop table if exists sys_social;
- create table sys_social
- (
- id bigint not null comment '主键',
- user_id bigint not null comment '用户ID',
- tenant_id varchar(20) default '000000' comment '租户id',
- auth_id varchar(255) not null comment '平台+平台唯一id',
- source varchar(255) not null comment '用户来源',
- open_id varchar(255) default null comment '平台编号唯一id',
- user_name varchar(30) not null comment '登录账号',
- nick_name varchar(50) default '' comment '用户昵称',
- email varchar(255) default '' comment '用户邮箱',
- avatar varchar(500) default '' comment '头像地址',
- access_token varchar(2000) not null comment '用户的授权令牌',
- expire_in int default null comment '用户的授权令牌的有效期,部分平台可能没有',
- refresh_token varchar(255) default null comment '刷新令牌,部分平台可能没有',
- access_code varchar(2000) default null comment '平台的授权信息,部分平台可能没有',
- union_id varchar(255) default null comment '用户的 unionid',
- scope varchar(255) default null comment '授予的权限,部分平台可能没有',
- token_type varchar(255) default null comment '个别平台的授权信息,部分平台可能没有',
- id_token varchar(2000) default null comment 'id token,部分平台可能没有',
- mac_algorithm varchar(255) default null comment '小米平台用户的附带属性,部分平台可能没有',
- mac_key varchar(255) default null comment '小米平台用户的附带属性,部分平台可能没有',
- code varchar(255) default null comment '用户的授权code,部分平台可能没有',
- oauth_token varchar(255) default null comment 'Twitter平台用户的附带属性,部分平台可能没有',
- oauth_token_secret varchar(255) default null comment 'Twitter平台用户的附带属性,部分平台可能没有',
- create_dept bigint(20) comment '创建部门',
- create_by bigint(20) comment '创建者',
- create_time datetime comment '创建时间',
- update_by bigint(20) comment '更新者',
- update_time datetime comment '更新时间',
- del_flag char(1) default '0' comment '删除标志(0代表存在 1代表删除)',
- PRIMARY KEY (id)
- ) engine=innodb DEFAULT CHARSET=utf8mb4 comment = '社会化关系表';
- -- ----------------------------
- -- 租户表
- -- ----------------------------
- drop table if exists sys_tenant;
- create table sys_tenant
- (
- id bigint(20) not null comment 'id',
- tenant_id varchar(20) not null comment '租户编号',
- contact_user_name varchar(20) comment '联系人',
- contact_phone varchar(20) comment '联系电话',
- company_name varchar(30) comment '企业名称',
- license_number varchar(30) comment '统一社会信用代码',
- address varchar(200) comment '地址',
- intro varchar(200) comment '企业简介',
- domain varchar(200) comment '域名',
- remark varchar(200) comment '备注',
- package_id bigint(20) comment '租户套餐编号',
- expire_time datetime comment '过期时间',
- account_count int default -1 comment '用户数量(-1不限制)',
- status char(1) default '0' comment '租户状态(0正常 1停用)',
- del_flag char(1) default '0' comment '删除标志(0代表存在 1代表删除)',
- create_dept bigint(20) comment '创建部门',
- create_by bigint(20) comment '创建者',
- create_time datetime comment '创建时间',
- update_by bigint(20) comment '更新者',
- update_time datetime comment '更新时间',
- primary key (id)
- ) engine=innodb DEFAULT CHARSET=utf8mb4 comment = '租户表';
- -- ----------------------------
- -- 初始化-租户表数据
- -- ----------------------------
- insert into sys_tenant values(1, '000000', '管理组', '15888888888', 'XXX有限公司', null, null, '多租户通用后台管理管理系统', null, null, null, null, -1, '0', '0', 103, 1, sysdate(), null, null);
- -- ----------------------------
- -- 租户套餐表
- -- ----------------------------
- drop table if exists sys_tenant_package;
- create table sys_tenant_package (
- package_id bigint(20) not null comment '租户套餐id',
- package_name varchar(20) comment '套餐名称',
- menu_ids varchar(3000) comment '关联菜单id',
- remark varchar(200) comment '备注',
- menu_check_strictly tinyint(1) default 1 comment '菜单树选择项是否关联显示',
- status char(1) default '0' comment '状态(0正常 1停用)',
- del_flag char(1) default '0' comment '删除标志(0代表存在 1代表删除)',
- create_dept bigint(20) comment '创建部门',
- create_by bigint(20) comment '创建者',
- create_time datetime comment '创建时间',
- update_by bigint(20) comment '更新者',
- update_time datetime comment '更新时间',
- primary key (package_id)
- ) engine=innodb DEFAULT CHARSET=utf8mb4 comment = '租户套餐表';
- -- ----------------------------
- -- 1、部门表
- -- ----------------------------
- drop table if exists sys_dept;
- create table sys_dept (
- dept_id bigint(20) not null comment '部门id',
- tenant_id varchar(20) default '000000' comment '租户编号',
- parent_id bigint(20) default 0 comment '父部门id',
- ancestors varchar(500) default '' comment '祖级列表',
- dept_name varchar(30) default '' comment '部门名称',
- dept_category varchar(100) default null comment '部门类别编码',
- order_num int(4) default 0 comment '显示顺序',
- leader bigint(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代表存在 1代表删除)',
- create_dept bigint(20) default null comment '创建部门',
- create_by bigint(20) default null comment '创建者',
- create_time datetime comment '创建时间',
- update_by bigint(20) default null comment '更新者',
- update_time datetime comment '更新时间',
- primary key (dept_id)
- ) engine=innodb DEFAULT CHARSET=utf8mb4 comment = '部门表';
- -- ----------------------------
- -- 初始化-部门表数据
- -- ----------------------------
- insert into sys_dept values(100, '000000', 0, '0', 'XXX科技', null,0, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate(), null, null);
- insert into sys_dept values(101, '000000', 100, '0,100', '深圳总公司', null,1, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate(), null, null);
- insert into sys_dept values(102, '000000', 100, '0,100', '长沙分公司', null,2, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate(), null, null);
- insert into sys_dept values(103, '000000', 101, '0,100,101', '研发部门', null,1, 1, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate(), null, null);
- insert into sys_dept values(104, '000000', 101, '0,100,101', '市场部门', null,2, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate(), null, null);
- insert into sys_dept values(105, '000000', 101, '0,100,101', '测试部门', null,3, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate(), null, null);
- insert into sys_dept values(106, '000000', 101, '0,100,101', '财务部门', null,4, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate(), null, null);
- insert into sys_dept values(107, '000000', 101, '0,100,101', '运维部门', null,5, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate(), null, null);
- insert into sys_dept values(108, '000000', 102, '0,100,102', '市场部门', null,1, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate(), null, null);
- insert into sys_dept values(109, '000000', 102, '0,100,102', '财务部门', null,2, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, sysdate(), null, null);
- -- ----------------------------
- -- 2、用户信息表
- -- ----------------------------
- drop table if exists sys_user;
- create table sys_user (
- user_id bigint(20) not null comment '用户ID',
- tenant_id varchar(20) default '000000' comment '租户编号',
- dept_id bigint(20) default null comment '部门ID',
- user_name varchar(30) not null comment '用户账号',
- nick_name varchar(50) not null comment '用户昵称',
- user_type varchar(10) default 'sys_user' comment '用户类型(sys_user系统用户)',
- email varchar(50) default '' comment '用户邮箱',
- phonenumber varchar(11) default '' comment '手机号码',
- sex char(1) default '0' comment '用户性别(0男 1女 2未知)',
- avatar bigint(20) comment '头像地址',
- password varchar(100) default '' comment '密码',
- status char(1) default '0' comment '账号状态(0正常 1停用)',
- del_flag char(1) default '0' comment '删除标志(0代表存在 1代表删除)',
- login_ip varchar(128) default '' comment '最后登录IP',
- login_date datetime comment '最后登录时间',
- create_dept bigint(20) default null comment '创建部门',
- create_by bigint(20) default null comment '创建者',
- create_time datetime comment '创建时间',
- update_by bigint(20) default null comment '更新者',
- update_time datetime comment '更新时间',
- remark varchar(500) default null comment '备注',
- primary key (user_id)
- ) engine=innodb DEFAULT CHARSET=utf8mb4 comment = '用户信息表';
- -- ----------------------------
- -- 初始化-用户信息表数据
- -- ----------------------------
- insert into sys_user values(1, '000000', 103, 'admin', '疯狂的狮子Li', 'sys_user', 'crazyLionLi@163.com', '15888888888', '1', null, '$2a$10$7JB720yubVSZvUI0rEqK/.VqGOZTH.ulu33dHOiBE8ByOhJIrdAu2', '0', '0', '127.0.0.1', sysdate(), 103, 1, sysdate(), null, null, '管理员');
- insert into sys_user values(3, '000000', 108, 'test', '本部门及以下 密码666666', 'sys_user', '', '', '0', null, '$2a$10$b8yUzN0C71sbz.PhNOCgJe.Tu1yWC3RNrTyjSQ8p1W0.aaUXUJ.Ne', '0', '0', '127.0.0.1', sysdate(), 103, 1, sysdate(), 3, sysdate(), null);
- insert into sys_user values(4, '000000', 102, 'test1', '仅本人 密码666666', 'sys_user', '', '', '0', null, '$2a$10$b8yUzN0C71sbz.PhNOCgJe.Tu1yWC3RNrTyjSQ8p1W0.aaUXUJ.Ne', '0', '0', '127.0.0.1', sysdate(), 103, 1, sysdate(), 4, sysdate(), null);
- -- ----------------------------
- -- 3、岗位信息表
- -- ----------------------------
- drop table if exists sys_post;
- create table sys_post
- (
- post_id bigint(20) not null comment '岗位ID',
- tenant_id varchar(20) default '000000' comment '租户编号',
- dept_id bigint(20) not null comment '部门id',
- post_code varchar(64) not null comment '岗位编码',
- post_category varchar(100) default 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_dept bigint(20) default null comment '创建部门',
- create_by bigint(20) default null comment '创建者',
- create_time datetime comment '创建时间',
- update_by bigint(20) default null comment '更新者',
- update_time datetime comment '更新时间',
- remark varchar(500) default null comment '备注',
- primary key (post_id)
- ) engine=innodb DEFAULT CHARSET=utf8mb4 comment = '岗位信息表';
- -- ----------------------------
- -- 初始化-岗位信息表数据
- -- ----------------------------
- insert into sys_post values(1, '000000', 103, 'ceo', null, '董事长', 1, '0', 103, 1, sysdate(), null, null, '');
- insert into sys_post values(2, '000000', 100, 'se', null, '项目经理', 2, '0', 103, 1, sysdate(), null, null, '');
- insert into sys_post values(3, '000000', 100, 'hr', null, '人力资源', 3, '0', 103, 1, sysdate(), null, null, '');
- insert into sys_post values(4, '000000', 100, 'user', null, '普通员工', 4, '0', 103, 1, sysdate(), null, null, '');
- -- ----------------------------
- -- 4、角色信息表
- -- ----------------------------
- drop table if exists sys_role;
- create table sys_role (
- role_id bigint(20) not null comment '角色ID',
- tenant_id varchar(20) default '000000' comment '租户编号',
- 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:本部门及以下数据权限 5:仅本人数据权限 6:部门及以下或本人数据权限)',
- 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代表存在 1代表删除)',
- create_dept bigint(20) default null comment '创建部门',
- create_by bigint(20) default null comment '创建者',
- create_time datetime comment '创建时间',
- update_by bigint(20) default null comment '更新者',
- update_time datetime comment '更新时间',
- remark varchar(500) default null comment '备注',
- primary key (role_id)
- ) engine=innodb DEFAULT CHARSET=utf8mb4 comment = '角色信息表';
- -- ----------------------------
- -- 初始化-角色信息表数据
- -- ----------------------------
- insert into sys_role values(1, '000000', '超级管理员', 'superadmin', 1, 1, 1, 1, '0', '0', 103, 1, sysdate(), null, null, '超级管理员');
- insert into sys_role values(3, '000000', '本部门及以下', 'test1', 3, 4, 1, 1, '0', '0', 103, 1, sysdate(), null, null, '');
- insert into sys_role values(4, '000000', '仅本人', 'test2', 4, 5, 1, 1, '0', '0', 103, 1, sysdate(), null, null, '');
- -- ----------------------------
- -- 5、菜单权限表
- -- ----------------------------
- drop table if exists sys_menu;
- create table sys_menu (
- menu_id bigint(20) not null 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_param varchar(255) default null 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_dept bigint(20) default null comment '创建部门',
- create_by bigint(20) default null comment '创建者',
- create_time datetime comment '创建时间',
- update_by bigint(20) default null comment '更新者',
- update_time datetime comment '更新时间',
- remark varchar(500) default '' comment '备注',
- primary key (menu_id)
- ) engine=innodb DEFAULT CHARSET=utf8mb4 comment = '菜单权限表';
- -- ----------------------------
- -- 初始化-菜单信息表数据
- -- ----------------------------
- -- 一级菜单
- insert into sys_menu values('1', '系统管理', '0', '1', 'system', null, '', 1, 0, 'M', '0', '0', '', 'system', 103, 1, sysdate(), null, null, '系统管理目录');
- insert into sys_menu values('6', '租户管理', '0', '2', 'tenant', null, '', 1, 0, 'M', '0', '0', '', 'chart', 103, 1, sysdate(), null, null, '租户管理目录');
- insert into sys_menu values('2', '系统监控', '0', '3', 'monitor', null, '', 1, 0, 'M', '0', '0', '', 'monitor', 103, 1, sysdate(), null, null, '系统监控目录');
- insert into sys_menu values('3', '系统工具', '0', '4', 'tool', null, '', 1, 0, 'M', '0', '0', '', 'tool', 103, 1, sysdate(), null, null, '系统工具目录');
- insert into sys_menu values('4', 'PLUS官网', '0', '5', 'https://gitee.com/dromara/RuoYi-Vue-Plus', null, '', 0, 0, 'M', '0', '0', '', 'guide', 103, 1, sysdate(), null, null, 'RuoYi-Vue-Plus官网地址');
- insert into sys_menu values('5', '测试菜单', '0', '5', 'demo', null, '', 1, 0, 'M', '0', '0', '', 'star', 103, 1, sysdate(), null, null, '测试菜单');
- -- 二级菜单
- insert into sys_menu values('100', '用户管理', '1', '1', 'user', 'system/user/index', '', 1, 0, 'C', '0', '0', 'system:user:list', 'user', 103, 1, sysdate(), null, null, '用户管理菜单');
- insert into sys_menu values('101', '角色管理', '1', '2', 'role', 'system/role/index', '', 1, 0, 'C', '0', '0', 'system:role:list', 'peoples', 103, 1, sysdate(), null, null, '角色管理菜单');
- insert into sys_menu values('102', '菜单管理', '1', '3', 'menu', 'system/menu/index', '', 1, 0, 'C', '0', '0', 'system:menu:list', 'tree-table', 103, 1, sysdate(), null, null, '菜单管理菜单');
- insert into sys_menu values('103', '部门管理', '1', '4', 'dept', 'system/dept/index', '', 1, 0, 'C', '0', '0', 'system:dept:list', 'tree', 103, 1, sysdate(), null, null, '部门管理菜单');
- insert into sys_menu values('104', '岗位管理', '1', '5', 'post', 'system/post/index', '', 1, 0, 'C', '0', '0', 'system:post:list', 'post', 103, 1, sysdate(), null, null, '岗位管理菜单');
- insert into sys_menu values('105', '字典管理', '1', '6', 'dict', 'system/dict/index', '', 1, 0, 'C', '0', '0', 'system:dict:list', 'dict', 103, 1, sysdate(), null, null, '字典管理菜单');
- insert into sys_menu values('106', '参数设置', '1', '7', 'config', 'system/config/index', '', 1, 0, 'C', '0', '0', 'system:config:list', 'edit', 103, 1, sysdate(), null, null, '参数设置菜单');
- insert into sys_menu values('107', '通知公告', '1', '8', 'notice', 'system/notice/index', '', 1, 0, 'C', '0', '0', 'system:notice:list', 'message', 103, 1, sysdate(), null, null, '通知公告菜单');
- insert into sys_menu values('108', '日志管理', '1', '9', 'log', '', '', 1, 0, 'M', '0', '0', '', 'log', 103, 1, sysdate(), null, null, '日志管理菜单');
- insert into sys_menu values('109', '在线用户', '2', '1', 'online', 'monitor/online/index', '', 1, 0, 'C', '0', '0', 'monitor:online:list', 'online', 103, 1, sysdate(), null, null, '在线用户菜单');
- insert into sys_menu values('113', '缓存监控', '2', '5', 'cache', 'monitor/cache/index', '', 1, 0, 'C', '0', '0', 'monitor:cache:list', 'redis', 103, 1, sysdate(), null, null, '缓存监控菜单');
- insert into sys_menu values('115', '代码生成', '3', '2', 'gen', 'tool/gen/index', '', 1, 0, 'C', '0', '0', 'tool:gen:list', 'code', 103, 1, sysdate(), null, null, '代码生成菜单');
- insert into sys_menu values('121', '租户管理', '6', '1', 'tenant', 'system/tenant/index', '', 1, 0, 'C', '0', '0', 'system:tenant:list', 'list', 103, 1, sysdate(), null, null, '租户管理菜单');
- insert into sys_menu values('122', '租户套餐管理', '6', '2', 'tenantPackage', 'system/tenantPackage/index', '', 1, 0, 'C', '0', '0', 'system:tenantPackage:list', 'form', 103, 1, sysdate(), null, null, '租户套餐管理菜单');
- insert into sys_menu values('123', '客户端管理', '1', '11', 'client', 'system/client/index', '', 1, 0, 'C', '0', '0', 'system:client:list', 'international', 103, 1, sysdate(), null, null, '客户端管理菜单');
- insert into sys_menu values('116', '修改生成配置', '3', '2', 'gen-edit/index/:tableId', 'tool/gen/editTable', '', 1, 1, 'C', '1', '0', 'tool:gen:edit', '#', 103, 1, sysdate(), null, null, '/tool/gen');
- insert into sys_menu values('130', '分配用户', '1', '2', 'role-auth/user/:roleId', 'system/role/authUser', '', 1, 1, 'C', '1', '0', 'system:role:edit', '#', 103, 1, sysdate(), null, null, '/system/role');
- insert into sys_menu values('131', '分配角色', '1', '1', 'user-auth/role/:userId', 'system/user/authRole', '', 1, 1, 'C', '1', '0', 'system:user:edit', '#', 103, 1, sysdate(), null, null, '/system/user');
- insert into sys_menu values('132', '字典数据', '1', '6', 'dict-data/index/:dictId', 'system/dict/data', '', 1, 1, 'C', '1', '0', 'system:dict:list', '#', 103, 1, sysdate(), null, null, '/system/dict');
- insert into sys_menu values('133', '文件配置管理', '1', '10', 'oss-config/index', 'system/oss/config', '', 1, 1, 'C', '1', '0', 'system:ossConfig:list', '#', 103, 1, sysdate(), null, null, '/system/oss');
- -- springboot-admin监控
- insert into sys_menu values('117', 'Admin监控', '2', '5', 'Admin', 'monitor/admin/index', '', 1, 0, 'C', '0', '0', 'monitor:admin:list', 'dashboard', 103, 1, sysdate(), null, null, 'Admin监控菜单');
- -- oss菜单
- insert into sys_menu values('118', '文件管理', '1', '10', 'oss', 'system/oss/index', '', 1, 0, 'C', '0', '0', 'system:oss:list', 'upload', 103, 1, sysdate(), null, null, '文件管理菜单');
- -- snail-job server控制台
- insert into sys_menu values('120', '任务调度中心', '2', '6', 'snailjob', 'monitor/snailjob/index', '', 1, 0, 'C', '0', '0', 'monitor:snailjob:list', 'job', 103, 1, sysdate(), null, null, 'SnailJob控制台菜单');
- -- 三级菜单
- insert into sys_menu values('500', '操作日志', '108', '1', 'operlog', 'monitor/operlog/index', '', 1, 0, 'C', '0', '0', 'monitor:operlog:list', 'form', 103, 1, sysdate(), null, null, '操作日志菜单');
- insert into sys_menu values('501', '登录日志', '108', '2', 'logininfor', 'monitor/logininfor/index', '', 1, 0, 'C', '0', '0', 'monitor:logininfor:list', 'logininfor', 103, 1, sysdate(), null, null, '登录日志菜单');
- -- 用户管理按钮
- insert into sys_menu values('1001', '用户查询', '100', '1', '', '', '', 1, 0, 'F', '0', '0', 'system:user:query', '#', 103, 1, sysdate(), null, null, '');
- insert into sys_menu values('1002', '用户新增', '100', '2', '', '', '', 1, 0, 'F', '0', '0', 'system:user:add', '#', 103, 1, sysdate(), null, null, '');
- insert into sys_menu values('1003', '用户修改', '100', '3', '', '', '', 1, 0, 'F', '0', '0', 'system:user:edit', '#', 103, 1, sysdate(), null, null, '');
- insert into sys_menu values('1004', '用户删除', '100', '4', '', '', '', 1, 0, 'F', '0', '0', 'system:user:remove', '#', 103, 1, sysdate(), null, null, '');
- insert into sys_menu values('1005', '用户导出', '100', '5', '', '', '', 1, 0, 'F', '0', '0', 'system:user:export', '#', 103, 1, sysdate(), null, null, '');
- insert into sys_menu values('1006', '用户导入', '100', '6', '', '', '', 1, 0, 'F', '0', '0', 'system:user:import', '#', 103, 1, sysdate(), null, null, '');
- insert into sys_menu values('1007', '重置密码', '100', '7', '', '', '', 1, 0, 'F', '0', '0', 'system:user:resetPwd', '#', 103, 1, sysdate(), null, null, '');
- -- 角色管理按钮
- insert into sys_menu values('1008', '角色查询', '101', '1', '', '', '', 1, 0, 'F', '0', '0', 'system:role:query', '#', 103, 1, sysdate(), null, null, '');
- insert into sys_menu values('1009', '角色新增', '101', '2', '', '', '', 1, 0, 'F', '0', '0', 'system:role:add', '#', 103, 1, sysdate(), null, null, '');
- insert into sys_menu values('1010', '角色修改', '101', '3', '', '', '', 1, 0, 'F', '0', '0', 'system:role:edit', '#', 103, 1, sysdate(), null, null, '');
- insert into sys_menu values('1011', '角色删除', '101', '4', '', '', '', 1, 0, 'F', '0', '0', 'system:role:remove', '#', 103, 1, sysdate(), null, null, '');
- insert into sys_menu values('1012', '角色导出', '101', '5', '', '', '', 1, 0, 'F', '0', '0', 'system:role:export', '#', 103, 1, sysdate(), null, null, '');
- -- 菜单管理按钮
- insert into sys_menu values('1013', '菜单查询', '102', '1', '', '', '', 1, 0, 'F', '0', '0', 'system:menu:query', '#', 103, 1, sysdate(), null, null, '');
- insert into sys_menu values('1014', '菜单新增', '102', '2', '', '', '', 1, 0, 'F', '0', '0', 'system:menu:add', '#', 103, 1, sysdate(), null, null, '');
- insert into sys_menu values('1015', '菜单修改', '102', '3', '', '', '', 1, 0, 'F', '0', '0', 'system:menu:edit', '#', 103, 1, sysdate(), null, null, '');
- insert into sys_menu values('1016', '菜单删除', '102', '4', '', '', '', 1, 0, 'F', '0', '0', 'system:menu:remove', '#', 103, 1, sysdate(), null, null, '');
- -- 部门管理按钮
- insert into sys_menu values('1017', '部门查询', '103', '1', '', '', '', 1, 0, 'F', '0', '0', 'system:dept:query', '#', 103, 1, sysdate(), null, null, '');
- insert into sys_menu values('1018', '部门新增', '103', '2', '', '', '', 1, 0, 'F', '0', '0', 'system:dept:add', '#', 103, 1, sysdate(), null, null, '');
- insert into sys_menu values('1019', '部门修改', '103', '3', '', '', '', 1, 0, 'F', '0', '0', 'system:dept:edit', '#', 103, 1, sysdate(), null, null, '');
- insert into sys_menu values('1020', '部门删除', '103', '4', '', '', '', 1, 0, 'F', '0', '0', 'system:dept:remove', '#', 103, 1, sysdate(), null, null, '');
- -- 岗位管理按钮
- insert into sys_menu values('1021', '岗位查询', '104', '1', '', '', '', 1, 0, 'F', '0', '0', 'system:post:query', '#', 103, 1, sysdate(), null, null, '');
- insert into sys_menu values('1022', '岗位新增', '104', '2', '', '', '', 1, 0, 'F', '0', '0', 'system:post:add', '#', 103, 1, sysdate(), null, null, '');
- insert into sys_menu values('1023', '岗位修改', '104', '3', '', '', '', 1, 0, 'F', '0', '0', 'system:post:edit', '#', 103, 1, sysdate(), null, null, '');
- insert into sys_menu values('1024', '岗位删除', '104', '4', '', '', '', 1, 0, 'F', '0', '0', 'system:post:remove', '#', 103, 1, sysdate(), null, null, '');
- insert into sys_menu values('1025', '岗位导出', '104', '5', '', '', '', 1, 0, 'F', '0', '0', 'system:post:export', '#', 103, 1, sysdate(), null, null, '');
- -- 字典管理按钮
- insert into sys_menu values('1026', '字典查询', '105', '1', '#', '', '', 1, 0, 'F', '0', '0', 'system:dict:query', '#', 103, 1, sysdate(), null, null, '');
- insert into sys_menu values('1027', '字典新增', '105', '2', '#', '', '', 1, 0, 'F', '0', '0', 'system:dict:add', '#', 103, 1, sysdate(), null, null, '');
- insert into sys_menu values('1028', '字典修改', '105', '3', '#', '', '', 1, 0, 'F', '0', '0', 'system:dict:edit', '#', 103, 1, sysdate(), null, null, '');
- insert into sys_menu values('1029', '字典删除', '105', '4', '#', '', '', 1, 0, 'F', '0', '0', 'system:dict:remove', '#', 103, 1, sysdate(), null, null, '');
- insert into sys_menu values('1030', '字典导出', '105', '5', '#', '', '', 1, 0, 'F', '0', '0', 'system:dict:export', '#', 103, 1, sysdate(), null, null, '');
- -- 参数设置按钮
- insert into sys_menu values('1031', '参数查询', '106', '1', '#', '', '', 1, 0, 'F', '0', '0', 'system:config:query', '#', 103, 1, sysdate(), null, null, '');
- insert into sys_menu values('1032', '参数新增', '106', '2', '#', '', '', 1, 0, 'F', '0', '0', 'system:config:add', '#', 103, 1, sysdate(), null, null, '');
- insert into sys_menu values('1033', '参数修改', '106', '3', '#', '', '', 1, 0, 'F', '0', '0', 'system:config:edit', '#', 103, 1, sysdate(), null, null, '');
- insert into sys_menu values('1034', '参数删除', '106', '4', '#', '', '', 1, 0, 'F', '0', '0', 'system:config:remove', '#', 103, 1, sysdate(), null, null, '');
- insert into sys_menu values('1035', '参数导出', '106', '5', '#', '', '', 1, 0, 'F', '0', '0', 'system:config:export', '#', 103, 1, sysdate(), null, null, '');
- -- 通知公告按钮
- insert into sys_menu values('1036', '公告查询', '107', '1', '#', '', '', 1, 0, 'F', '0', '0', 'system:notice:query', '#', 103, 1, sysdate(), null, null, '');
- insert into sys_menu values('1037', '公告新增', '107', '2', '#', '', '', 1, 0, 'F', '0', '0', 'system:notice:add', '#', 103, 1, sysdate(), null, null, '');
- insert into sys_menu values('1038', '公告修改', '107', '3', '#', '', '', 1, 0, 'F', '0', '0', 'system:notice:edit', '#', 103, 1, sysdate(), null, null, '');
- insert into sys_menu values('1039', '公告删除', '107', '4', '#', '', '', 1, 0, 'F', '0', '0', 'system:notice:remove', '#', 103, 1, sysdate(), null, null, '');
- -- 操作日志按钮
- insert into sys_menu values('1040', '操作查询', '500', '1', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:operlog:query', '#', 103, 1, sysdate(), null, null, '');
- insert into sys_menu values('1041', '操作删除', '500', '2', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:operlog:remove', '#', 103, 1, sysdate(), null, null, '');
- insert into sys_menu values('1042', '日志导出', '500', '4', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:operlog:export', '#', 103, 1, sysdate(), null, null, '');
- -- 登录日志按钮
- insert into sys_menu values('1043', '登录查询', '501', '1', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:logininfor:query', '#', 103, 1, sysdate(), null, null, '');
- insert into sys_menu values('1044', '登录删除', '501', '2', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:logininfor:remove', '#', 103, 1, sysdate(), null, null, '');
- insert into sys_menu values('1045', '日志导出', '501', '3', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:logininfor:export', '#', 103, 1, sysdate(), null, null, '');
- insert into sys_menu values('1050', '账户解锁', '501', '4', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:logininfor:unlock', '#', 103, 1, sysdate(), null, null, '');
- -- 在线用户按钮
- insert into sys_menu values('1046', '在线查询', '109', '1', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:online:query', '#', 103, 1, sysdate(), null, null, '');
- insert into sys_menu values('1047', '批量强退', '109', '2', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:online:batchLogout', '#', 103, 1, sysdate(), null, null, '');
- insert into sys_menu values('1048', '单条强退', '109', '3', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:online:forceLogout', '#', 103, 1, sysdate(), null, null, '');
- -- 代码生成按钮
- insert into sys_menu values('1055', '生成查询', '115', '1', '#', '', '', 1, 0, 'F', '0', '0', 'tool:gen:query', '#', 103, 1, sysdate(), null, null, '');
- insert into sys_menu values('1056', '生成修改', '115', '2', '#', '', '', 1, 0, 'F', '0', '0', 'tool:gen:edit', '#', 103, 1, sysdate(), null, null, '');
- insert into sys_menu values('1057', '生成删除', '115', '3', '#', '', '', 1, 0, 'F', '0', '0', 'tool:gen:remove', '#', 103, 1, sysdate(), null, null, '');
- insert into sys_menu values('1058', '导入代码', '115', '2', '#', '', '', 1, 0, 'F', '0', '0', 'tool:gen:import', '#', 103, 1, sysdate(), null, null, '');
- insert into sys_menu values('1059', '预览代码', '115', '4', '#', '', '', 1, 0, 'F', '0', '0', 'tool:gen:preview', '#', 103, 1, sysdate(), null, null, '');
- insert into sys_menu values('1060', '生成代码', '115', '5', '#', '', '', 1, 0, 'F', '0', '0', 'tool:gen:code', '#', 103, 1, sysdate(), null, null, '');
- -- oss相关按钮
- insert into sys_menu values('1600', '文件查询', '118', '1', '#', '', '', 1, 0, 'F', '0', '0', 'system:oss:query', '#', 103, 1, sysdate(), null, null, '');
- insert into sys_menu values('1601', '文件上传', '118', '2', '#', '', '', 1, 0, 'F', '0', '0', 'system:oss:upload', '#', 103, 1, sysdate(), null, null, '');
- insert into sys_menu values('1602', '文件下载', '118', '3', '#', '', '', 1, 0, 'F', '0', '0', 'system:oss:download', '#', 103, 1, sysdate(), null, null, '');
- insert into sys_menu values('1603', '文件删除', '118', '4', '#', '', '', 1, 0, 'F', '0', '0', 'system:oss:remove', '#', 103, 1, sysdate(), null, null, '');
- insert into sys_menu values('1620', '配置列表', '118', '5', '#', '', '', 1, 0, 'F', '0', '0', 'system:ossConfig:list', '#', 103, 1, sysdate(), null, null, '');
- insert into sys_menu values('1621', '配置添加', '118', '6', '#', '', '', 1, 0, 'F', '0', '0', 'system:ossConfig:add', '#', 103, 1, sysdate(), null, null, '');
- insert into sys_menu values('1622', '配置编辑', '118', '6', '#', '', '', 1, 0, 'F', '0', '0', 'system:ossConfig:edit', '#', 103, 1, sysdate(), null, null, '');
- insert into sys_menu values('1623', '配置删除', '118', '6', '#', '', '', 1, 0, 'F', '0', '0', 'system:ossConfig:remove', '#', 103, 1, sysdate(), null, null, '');
- -- 租户管理相关按钮
- insert into sys_menu values ('1606', '租户查询', '121', '1', '#', '', '', 1, 0, 'F', '0', '0', 'system:tenant:query', '#', 103, 1, sysdate(), null, null, '');
- insert into sys_menu values ('1607', '租户新增', '121', '2', '#', '', '', 1, 0, 'F', '0', '0', 'system:tenant:add', '#', 103, 1, sysdate(), null, null, '');
- insert into sys_menu values ('1608', '租户修改', '121', '3', '#', '', '', 1, 0, 'F', '0', '0', 'system:tenant:edit', '#', 103, 1, sysdate(), null, null, '');
- insert into sys_menu values ('1609', '租户删除', '121', '4', '#', '', '', 1, 0, 'F', '0', '0', 'system:tenant:remove', '#', 103, 1, sysdate(), null, null, '');
- insert into sys_menu values ('1610', '租户导出', '121', '5', '#', '', '', 1, 0, 'F', '0', '0', 'system:tenant:export', '#', 103, 1, sysdate(), null, null, '');
- -- 租户套餐管理相关按钮
- insert into sys_menu values ('1611', '租户套餐查询', '122', '1', '#', '', '', 1, 0, 'F', '0', '0', 'system:tenantPackage:query', '#', 103, 1, sysdate(), null, null, '');
- insert into sys_menu values ('1612', '租户套餐新增', '122', '2', '#', '', '', 1, 0, 'F', '0', '0', 'system:tenantPackage:add', '#', 103, 1, sysdate(), null, null, '');
- insert into sys_menu values ('1613', '租户套餐修改', '122', '3', '#', '', '', 1, 0, 'F', '0', '0', 'system:tenantPackage:edit', '#', 103, 1, sysdate(), null, null, '');
- insert into sys_menu values ('1614', '租户套餐删除', '122', '4', '#', '', '', 1, 0, 'F', '0', '0', 'system:tenantPackage:remove', '#', 103, 1, sysdate(), null, null, '');
- insert into sys_menu values ('1615', '租户套餐导出', '122', '5', '#', '', '', 1, 0, 'F', '0', '0', 'system:tenantPackage:export', '#', 103, 1, sysdate(), null, null, '');
- -- 客户端管理按钮
- insert into sys_menu values('1061', '客户端管理查询', '123', '1', '#', '', '', 1, 0, 'F', '0', '0', 'system:client:query', '#', 103, 1, sysdate(), null, null, '');
- insert into sys_menu values('1062', '客户端管理新增', '123', '2', '#', '', '', 1, 0, 'F', '0', '0', 'system:client:add', '#', 103, 1, sysdate(), null, null, '');
- insert into sys_menu values('1063', '客户端管理修改', '123', '3', '#', '', '', 1, 0, 'F', '0', '0', 'system:client:edit', '#', 103, 1, sysdate(), null, null, '');
- insert into sys_menu values('1064', '客户端管理删除', '123', '4', '#', '', '', 1, 0, 'F', '0', '0', 'system:client:remove', '#', 103, 1, sysdate(), null, null, '');
- insert into sys_menu values('1065', '客户端管理导出', '123', '5', '#', '', '', 1, 0, 'F', '0', '0', 'system:client:export', '#', 103, 1, sysdate(), null, null, '');
- -- 测试菜单
- insert into sys_menu values('1500', '测试单表', '5', '1', 'demo', 'demo/demo/index', '', 1, 0, 'C', '0', '0', 'demo:demo:list', '#', 103, 1, sysdate(), null, null, '测试单表菜单');
- insert into sys_menu values('1501', '测试单表查询', '1500', '1', '#', '', '', 1, 0, 'F', '0', '0', 'demo:demo:query', '#', 103, 1, sysdate(), null, null, '');
- insert into sys_menu values('1502', '测试单表新增', '1500', '2', '#', '', '', 1, 0, 'F', '0', '0', 'demo:demo:add', '#', 103, 1, sysdate(), null, null, '');
- insert into sys_menu values('1503', '测试单表修改', '1500', '3', '#', '', '', 1, 0, 'F', '0', '0', 'demo:demo:edit', '#', 103, 1, sysdate(), null, null, '');
- insert into sys_menu values('1504', '测试单表删除', '1500', '4', '#', '', '', 1, 0, 'F', '0', '0', 'demo:demo:remove', '#', 103, 1, sysdate(), null, null, '');
- insert into sys_menu values('1505', '测试单表导出', '1500', '5', '#', '', '', 1, 0, 'F', '0', '0', 'demo:demo:export', '#', 103, 1, sysdate(), null, null, '');
- insert into sys_menu values('1506', '测试树表', '5', '1', 'tree', 'demo/tree/index', '', 1, 0, 'C', '0', '0', 'demo:tree:list', '#', 103, 1, sysdate(), null, null, '测试树表菜单');
- insert into sys_menu values('1507', '测试树表查询', '1506', '1', '#', '', '', 1, 0, 'F', '0', '0', 'demo:tree:query', '#', 103, 1, sysdate(), null, null, '');
- insert into sys_menu values('1508', '测试树表新增', '1506', '2', '#', '', '', 1, 0, 'F', '0', '0', 'demo:tree:add', '#', 103, 1, sysdate(), null, null, '');
- insert into sys_menu values('1509', '测试树表修改', '1506', '3', '#', '', '', 1, 0, 'F', '0', '0', 'demo:tree:edit', '#', 103, 1, sysdate(), null, null, '');
- insert into sys_menu values('1510', '测试树表删除', '1506', '4', '#', '', '', 1, 0, 'F', '0', '0', 'demo:tree:remove', '#', 103, 1, sysdate(), null, null, '');
- insert into sys_menu values('1511', '测试树表导出', '1506', '5', '#', '', '', 1, 0, 'F', '0', '0', 'demo:tree:export', '#', 103, 1, sysdate(), null, 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 DEFAULT CHARSET=utf8mb4 comment = '用户和角色关联表';
- -- ----------------------------
- -- 初始化-用户和角色关联表数据
- -- ----------------------------
- insert into sys_user_role values ('1', '1');
- insert into sys_user_role values ('3', '3');
- insert into sys_user_role values ('4', '4');
- -- ----------------------------
- -- 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 DEFAULT CHARSET=utf8mb4 comment = '角色和菜单关联表';
- -- ----------------------------
- -- 初始化-角色和菜单关联表数据
- -- ----------------------------
- insert into sys_role_menu values ('3', '1');
- insert into sys_role_menu values ('3', '5');
- insert into sys_role_menu values ('3', '100');
- insert into sys_role_menu values ('3', '101');
- insert into sys_role_menu values ('3', '102');
- insert into sys_role_menu values ('3', '103');
- insert into sys_role_menu values ('3', '104');
- insert into sys_role_menu values ('3', '105');
- insert into sys_role_menu values ('3', '106');
- insert into sys_role_menu values ('3', '107');
- insert into sys_role_menu values ('3', '108');
- insert into sys_role_menu values ('3', '118');
- insert into sys_role_menu values ('3', '123');
- insert into sys_role_menu values ('3', '130');
- insert into sys_role_menu values ('3', '131');
- insert into sys_role_menu values ('3', '132');
- insert into sys_role_menu values ('3', '133');
- insert into sys_role_menu values ('3', '500');
- insert into sys_role_menu values ('3', '501');
- insert into sys_role_menu values ('3', '1001');
- insert into sys_role_menu values ('3', '1002');
- insert into sys_role_menu values ('3', '1003');
- insert into sys_role_menu values ('3', '1004');
- insert into sys_role_menu values ('3', '1005');
- insert into sys_role_menu values ('3', '1006');
- insert into sys_role_menu values ('3', '1007');
- insert into sys_role_menu values ('3', '1008');
- insert into sys_role_menu values ('3', '1009');
- insert into sys_role_menu values ('3', '1010');
- insert into sys_role_menu values ('3', '1011');
- insert into sys_role_menu values ('3', '1012');
- insert into sys_role_menu values ('3', '1013');
- insert into sys_role_menu values ('3', '1014');
- insert into sys_role_menu values ('3', '1015');
- insert into sys_role_menu values ('3', '1016');
- insert into sys_role_menu values ('3', '1017');
- insert into sys_role_menu values ('3', '1018');
- insert into sys_role_menu values ('3', '1019');
- insert into sys_role_menu values ('3', '1020');
- insert into sys_role_menu values ('3', '1021');
- insert into sys_role_menu values ('3', '1022');
- insert into sys_role_menu values ('3', '1023');
- insert into sys_role_menu values ('3', '1024');
- insert into sys_role_menu values ('3', '1025');
- insert into sys_role_menu values ('3', '1026');
- insert into sys_role_menu values ('3', '1027');
- insert into sys_role_menu values ('3', '1028');
- insert into sys_role_menu values ('3', '1029');
- insert into sys_role_menu values ('3', '1030');
- insert into sys_role_menu values ('3', '1031');
- insert into sys_role_menu values ('3', '1032');
- insert into sys_role_menu values ('3', '1033');
- insert into sys_role_menu values ('3', '1034');
- insert into sys_role_menu values ('3', '1035');
- insert into sys_role_menu values ('3', '1036');
- insert into sys_role_menu values ('3', '1037');
- insert into sys_role_menu values ('3', '1038');
- insert into sys_role_menu values ('3', '1039');
- insert into sys_role_menu values ('3', '1040');
- insert into sys_role_menu values ('3', '1041');
- insert into sys_role_menu values ('3', '1042');
- insert into sys_role_menu values ('3', '1043');
- insert into sys_role_menu values ('3', '1044');
- insert into sys_role_menu values ('3', '1045');
- insert into sys_role_menu values ('3', '1050');
- insert into sys_role_menu values ('3', '1061');
- insert into sys_role_menu values ('3', '1062');
- insert into sys_role_menu values ('3', '1063');
- insert into sys_role_menu values ('3', '1064');
- insert into sys_role_menu values ('3', '1065');
- insert into sys_role_menu values ('3', '1500');
- insert into sys_role_menu values ('3', '1501');
- insert into sys_role_menu values ('3', '1502');
- insert into sys_role_menu values ('3', '1503');
- insert into sys_role_menu values ('3', '1504');
- insert into sys_role_menu values ('3', '1505');
- insert into sys_role_menu values ('3', '1506');
- insert into sys_role_menu values ('3', '1507');
- insert into sys_role_menu values ('3', '1508');
- insert into sys_role_menu values ('3', '1509');
- insert into sys_role_menu values ('3', '1510');
- insert into sys_role_menu values ('3', '1511');
- insert into sys_role_menu values ('3', '1600');
- insert into sys_role_menu values ('3', '1601');
- insert into sys_role_menu values ('3', '1602');
- insert into sys_role_menu values ('3', '1603');
- insert into sys_role_menu values ('3', '1620');
- insert into sys_role_menu values ('3', '1621');
- insert into sys_role_menu values ('3', '1622');
- insert into sys_role_menu values ('3', '1623');
- insert into sys_role_menu values ('3', '11616');
- insert into sys_role_menu values ('3', '11618');
- insert into sys_role_menu values ('3', '11619');
- insert into sys_role_menu values ('3', '11622');
- insert into sys_role_menu values ('3', '11623');
- insert into sys_role_menu values ('3', '11629');
- insert into sys_role_menu values ('3', '11632');
- insert into sys_role_menu values ('3', '11633');
- insert into sys_role_menu values ('3', '11638');
- insert into sys_role_menu values ('3', '11639');
- insert into sys_role_menu values ('3', '11640');
- insert into sys_role_menu values ('3', '11641');
- insert into sys_role_menu values ('3', '11642');
- insert into sys_role_menu values ('3', '11643');
- insert into sys_role_menu values ('3', '11701');
- insert into sys_role_menu values ('4', '5');
- insert into sys_role_menu values ('4', '1500');
- insert into sys_role_menu values ('4', '1501');
- insert into sys_role_menu values ('4', '1502');
- insert into sys_role_menu values ('4', '1503');
- insert into sys_role_menu values ('4', '1504');
- insert into sys_role_menu values ('4', '1505');
- insert into sys_role_menu values ('4', '1506');
- insert into sys_role_menu values ('4', '1507');
- insert into sys_role_menu values ('4', '1508');
- insert into sys_role_menu values ('4', '1509');
- insert into sys_role_menu values ('4', '1510');
- insert into sys_role_menu values ('4', '1511');
- -- ----------------------------
- -- 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 DEFAULT CHARSET=utf8mb4 comment = '角色和部门关联表';
- -- ----------------------------
- -- 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 DEFAULT CHARSET=utf8mb4 comment = '用户与岗位关联表';
- -- ----------------------------
- -- 初始化-用户与岗位关联表数据
- -- ----------------------------
- insert into sys_user_post values ('1', '1');
- -- ----------------------------
- -- 10、操作日志记录
- -- ----------------------------
- drop table if exists sys_oper_log;
- create table sys_oper_log (
- oper_id bigint(20) not null comment '日志主键',
- tenant_id varchar(20) default '000000' comment '租户编号',
- title varchar(50) default '' comment '模块标题',
- business_type int(2) default 0 comment '业务类型(0其它 1新增 2修改 3删除)',
- method varchar(100) 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(4000) default '' comment '请求参数',
- json_result varchar(4000) default '' comment '返回参数',
- status int(1) default 0 comment '操作状态(0正常 1异常)',
- error_msg varchar(4000) 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 DEFAULT CHARSET=utf8mb4 comment = '操作日志记录';
- -- ----------------------------
- -- 11、字典类型表
- -- ----------------------------
- drop table if exists sys_dict_type;
- create table sys_dict_type
- (
- dict_id bigint(20) not null comment '字典主键',
- tenant_id varchar(20) default '000000' comment '租户编号',
- dict_name varchar(100) default '' comment '字典名称',
- dict_type varchar(100) default '' comment '字典类型',
- create_dept bigint(20) default null comment '创建部门',
- create_by bigint(20) default null comment '创建者',
- create_time datetime comment '创建时间',
- update_by bigint(20) default null comment '更新者',
- update_time datetime comment '更新时间',
- remark varchar(500) default null comment '备注',
- primary key (dict_id),
- unique (tenant_id, dict_type)
- ) engine=innodb DEFAULT CHARSET=utf8mb4 comment = '字典类型表';
- insert into sys_dict_type values(1, '000000', '用户性别', 'sys_user_sex', 103, 1, sysdate(), null, null, '用户性别列表');
- insert into sys_dict_type values(2, '000000', '菜单状态', 'sys_show_hide', 103, 1, sysdate(), null, null, '菜单状态列表');
- insert into sys_dict_type values(3, '000000', '系统开关', 'sys_normal_disable', 103, 1, sysdate(), null, null, '系统开关列表');
- insert into sys_dict_type values(6, '000000', '系统是否', 'sys_yes_no', 103, 1, sysdate(), null, null, '系统是否列表');
- insert into sys_dict_type values(7, '000000', '通知类型', 'sys_notice_type', 103, 1, sysdate(), null, null, '通知类型列表');
- insert into sys_dict_type values(8, '000000', '通知状态', 'sys_notice_status', 103, 1, sysdate(), null, null, '通知状态列表');
- insert into sys_dict_type values(9, '000000', '操作类型', 'sys_oper_type', 103, 1, sysdate(), null, null, '操作类型列表');
- insert into sys_dict_type values(10, '000000', '系统状态', 'sys_common_status', 103, 1, sysdate(), null, null, '登录状态列表');
- insert into sys_dict_type values(11, '000000', '授权类型', 'sys_grant_type', 103, 1, sysdate(), null, null, '认证授权类型');
- insert into sys_dict_type values(12, '000000', '设备类型', 'sys_device_type', 103, 1, sysdate(), null, null, '客户端设备类型');
- -- ----------------------------
- -- 12、字典数据表
- -- ----------------------------
- drop table if exists sys_dict_data;
- create table sys_dict_data
- (
- dict_code bigint(20) not null comment '字典编码',
- tenant_id varchar(20) default '000000' 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否)',
- create_dept bigint(20) default null comment '创建部门',
- create_by bigint(20) default null comment '创建者',
- create_time datetime comment '创建时间',
- update_by bigint(20) default null comment '更新者',
- update_time datetime comment '更新时间',
- remark varchar(500) default null comment '备注',
- primary key (dict_code)
- ) engine=innodb DEFAULT CHARSET=utf8mb4 comment = '字典数据表';
- insert into sys_dict_data values(1, '000000', 1, '男', '0', 'sys_user_sex', '', '', 'Y', 103, 1, sysdate(), null, null, '性别男');
- insert into sys_dict_data values(2, '000000', 2, '女', '1', 'sys_user_sex', '', '', 'N', 103, 1, sysdate(), null, null, '性别女');
- insert into sys_dict_data values(3, '000000', 3, '未知', '2', 'sys_user_sex', '', '', 'N', 103, 1, sysdate(), null, null, '性别未知');
- insert into sys_dict_data values(4, '000000', 1, '显示', '0', 'sys_show_hide', '', 'primary', 'Y', 103, 1, sysdate(), null, null, '显示菜单');
- insert into sys_dict_data values(5, '000000', 2, '隐藏', '1', 'sys_show_hide', '', 'danger', 'N', 103, 1, sysdate(), null, null, '隐藏菜单');
- insert into sys_dict_data values(6, '000000', 1, '正常', '0', 'sys_normal_disable', '', 'primary', 'Y', 103, 1, sysdate(), null, null, '正常状态');
- insert into sys_dict_data values(7, '000000', 2, '停用', '1', 'sys_normal_disable', '', 'danger', 'N', 103, 1, sysdate(), null, null, '停用状态');
- insert into sys_dict_data values(12, '000000', 1, '是', 'Y', 'sys_yes_no', '', 'primary', 'Y', 103, 1, sysdate(), null, null, '系统默认是');
- insert into sys_dict_data values(13, '000000', 2, '否', 'N', 'sys_yes_no', '', 'danger', 'N', 103, 1, sysdate(), null, null, '系统默认否');
- insert into sys_dict_data values(14, '000000', 1, '通知', '1', 'sys_notice_type', '', 'warning', 'Y', 103, 1, sysdate(), null, null, '通知');
- insert into sys_dict_data values(15, '000000', 2, '公告', '2', 'sys_notice_type', '', 'success', 'N', 103, 1, sysdate(), null, null, '公告');
- insert into sys_dict_data values(16, '000000', 1, '正常', '0', 'sys_notice_status', '', 'primary', 'Y', 103, 1, sysdate(), null, null, '正常状态');
- insert into sys_dict_data values(17, '000000', 2, '关闭', '1', 'sys_notice_status', '', 'danger', 'N', 103, 1, sysdate(), null, null, '关闭状态');
- insert into sys_dict_data values(29, '000000', 99, '其他', '0', 'sys_oper_type', '', 'info', 'N', 103, 1, sysdate(), null, null, '其他操作');
- insert into sys_dict_data values(18, '000000', 1, '新增', '1', 'sys_oper_type', '', 'info', 'N', 103, 1, sysdate(), null, null, '新增操作');
- insert into sys_dict_data values(19, '000000', 2, '修改', '2', 'sys_oper_type', '', 'info', 'N', 103, 1, sysdate(), null, null, '修改操作');
- insert into sys_dict_data values(20, '000000', 3, '删除', '3', 'sys_oper_type', '', 'danger', 'N', 103, 1, sysdate(), null, null, '删除操作');
- insert into sys_dict_data values(21, '000000', 4, '授权', '4', 'sys_oper_type', '', 'primary', 'N', 103, 1, sysdate(), null, null, '授权操作');
- insert into sys_dict_data values(22, '000000', 5, '导出', '5', 'sys_oper_type', '', 'warning', 'N', 103, 1, sysdate(), null, null, '导出操作');
- insert into sys_dict_data values(23, '000000', 6, '导入', '6', 'sys_oper_type', '', 'warning', 'N', 103, 1, sysdate(), null, null, '导入操作');
- insert into sys_dict_data values(24, '000000', 7, '强退', '7', 'sys_oper_type', '', 'danger', 'N', 103, 1, sysdate(), null, null, '强退操作');
- insert into sys_dict_data values(25, '000000', 8, '生成代码', '8', 'sys_oper_type', '', 'warning', 'N', 103, 1, sysdate(), null, null, '生成操作');
- insert into sys_dict_data values(26, '000000', 9, '清空数据', '9', 'sys_oper_type', '', 'danger', 'N', 103, 1, sysdate(), null, null, '清空操作');
- insert into sys_dict_data values(27, '000000', 1, '成功', '0', 'sys_common_status', '', 'primary', 'N', 103, 1, sysdate(), null, null, '正常状态');
- insert into sys_dict_data values(28, '000000', 2, '失败', '1', 'sys_common_status', '', 'danger', 'N', 103, 1, sysdate(), null, null, '停用状态');
- insert into sys_dict_data values(30, '000000', 0, '密码认证', 'password', 'sys_grant_type', 'el-check-tag', 'default', 'N', 103, 1, sysdate(), null, null, '密码认证');
- insert into sys_dict_data values(31, '000000', 0, '短信认证', 'sms', 'sys_grant_type', 'el-check-tag', 'default', 'N', 103, 1, sysdate(), null, null, '短信认证');
- insert into sys_dict_data values(32, '000000', 0, '邮件认证', 'email', 'sys_grant_type', 'el-check-tag', 'default', 'N', 103, 1, sysdate(), null, null, '邮件认证');
- insert into sys_dict_data values(33, '000000', 0, '小程序认证', 'xcx', 'sys_grant_type', 'el-check-tag', 'default', 'N', 103, 1, sysdate(), null, null, '小程序认证');
- insert into sys_dict_data values(34, '000000', 0, '三方登录认证', 'social', 'sys_grant_type', 'el-check-tag', 'default', 'N', 103, 1, sysdate(), null, null, '三方登录认证');
- insert into sys_dict_data values(35, '000000', 0, 'PC', 'pc', 'sys_device_type', '', 'default', 'N', 103, 1, sysdate(), null, null, 'PC');
- insert into sys_dict_data values(36, '000000', 0, '安卓', 'android', 'sys_device_type', '', 'default', 'N', 103, 1, sysdate(), null, null, '安卓');
- insert into sys_dict_data values(37, '000000', 0, 'iOS', 'ios', 'sys_device_type', '', 'default', 'N', 103, 1, sysdate(), null, null, 'iOS');
- insert into sys_dict_data values(38, '000000', 0, '小程序', 'xcx', 'sys_device_type', '', 'default', 'N', 103, 1, sysdate(), null, null, '小程序');
- -- ----------------------------
- -- 13、参数配置表
- -- ----------------------------
- drop table if exists sys_config;
- create table sys_config (
- config_id bigint(20) not null comment '参数主键',
- tenant_id varchar(20) default '000000' 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_dept bigint(20) default null comment '创建部门',
- create_by bigint(20) default null comment '创建者',
- create_time datetime comment '创建时间',
- update_by bigint(20) default null comment '更新者',
- update_time datetime comment '更新时间',
- remark varchar(500) default null comment '备注',
- primary key (config_id)
- ) engine=innodb DEFAULT CHARSET=utf8mb4 comment = '参数配置表';
- insert into sys_config values(1, '000000', '主框架页-默认皮肤样式名称', 'sys.index.skinName', 'skin-blue', 'Y', 103, 1, sysdate(), null, null, '蓝色 skin-blue、绿色 skin-green、紫色 skin-purple、红色 skin-red、黄色 skin-yellow' );
- insert into sys_config values(2, '000000', '用户管理-账号初始密码', 'sys.user.initPassword', '123456', 'Y', 103, 1, sysdate(), null, null, '初始化密码 123456' );
- insert into sys_config values(3, '000000', '主框架页-侧边栏主题', 'sys.index.sideTheme', 'theme-dark', 'Y', 103, 1, sysdate(), null, null, '深色主题theme-dark,浅色主题theme-light' );
- insert into sys_config values(5, '000000', '账号自助-是否开启用户注册功能', 'sys.account.registerUser', 'false', 'Y', 103, 1, sysdate(), null, null, '是否开启注册用户功能(true开启,false关闭)');
- insert into sys_config values(11, '000000', 'OSS预览列表资源开关', 'sys.oss.previewListResource', 'true', 'Y', 103, 1, sysdate(), null, null, 'true:开启, false:关闭');
- -- ----------------------------
- -- 14、系统访问记录
- -- ----------------------------
- drop table if exists sys_logininfor;
- create table sys_logininfor (
- info_id bigint(20) not null comment '访问ID',
- tenant_id varchar(20) default '000000' comment '租户编号',
- user_name varchar(50) default '' comment '用户账号',
- client_key varchar(32) default '' comment '客户端',
- device_type varchar(32) 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 DEFAULT CHARSET=utf8mb4 comment = '系统访问记录';
- -- ----------------------------
- -- 17、通知公告表
- -- ----------------------------
- drop table if exists sys_notice;
- create table sys_notice (
- notice_id bigint(20) not null comment '公告ID',
- tenant_id varchar(20) default '000000' comment '租户编号',
- 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_dept bigint(20) default null comment '创建部门',
- create_by bigint(20) default null comment '创建者',
- create_time datetime comment '创建时间',
- update_by bigint(20) default null comment '更新者',
- update_time datetime comment '更新时间',
- remark varchar(255) default null comment '备注',
- primary key (notice_id)
- ) engine=innodb DEFAULT CHARSET=utf8mb4 comment = '通知公告表';
- -- ----------------------------
- -- 初始化-公告信息表数据
- -- ----------------------------
- insert into sys_notice values('1', '000000', '温馨提醒:2018-07-01 新版本发布啦', '2', '新版本内容', '0', 103, 1, sysdate(), null, null, '管理员');
- insert into sys_notice values('2', '000000', '维护通知:2018-07-01 系统凌晨维护', '1', '维护内容', '0', 103, 1, sysdate(), null, null, '管理员');
- -- ----------------------------
- -- 18、代码生成业务表
- -- ----------------------------
- drop table if exists gen_table;
- create table gen_table (
- table_id bigint(20) not null comment '编号',
- data_name varchar(200) default '' 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树表操作)',
- 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_dept bigint(20) default null comment '创建部门',
- create_by bigint(20) default null comment '创建者',
- create_time datetime comment '创建时间',
- update_by bigint(20) default null comment '更新者',
- update_time datetime comment '更新时间',
- remark varchar(500) default null comment '备注',
- primary key (table_id)
- ) engine=innodb DEFAULT CHARSET=utf8mb4 comment = '代码生成业务表';
- -- ----------------------------
- -- 19、代码生成业务表字段
- -- ----------------------------
- drop table if exists gen_table_column;
- create table gen_table_column (
- column_id bigint(20) not null 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_dept bigint(20) default null comment '创建部门',
- create_by bigint(20) default null comment '创建者',
- create_time datetime comment '创建时间',
- update_by bigint(20) default null comment '更新者',
- update_time datetime comment '更新时间',
- primary key (column_id)
- ) engine=innodb DEFAULT CHARSET=utf8mb4 comment = '代码生成业务表字段';
- -- ----------------------------
- -- OSS对象存储表
- -- ----------------------------
- drop table if exists sys_oss;
- create table sys_oss (
- oss_id bigint(20) not null comment '对象存储主键',
- tenant_id varchar(20) default '000000' comment '租户编号',
- file_name varchar(255) not null default '' comment '文件名',
- original_name varchar(255) not null default '' comment '原名',
- file_suffix varchar(10) not null default '' comment '文件后缀名',
- url varchar(500) not null comment 'URL地址',
- ext1 text default null comment '扩展字段',
- create_dept bigint(20) default null comment '创建部门',
- create_time datetime default null comment '创建时间',
- create_by bigint(20) default null comment '上传人',
- update_time datetime default null comment '更新时间',
- update_by bigint(20) default null comment '更新人',
- service varchar(20) not null default 'minio' comment '服务商',
- primary key (oss_id)
- ) engine=innodb DEFAULT CHARSET=utf8mb4 comment='OSS对象存储表';
- -- ----------------------------
- -- OSS对象存储动态配置表
- -- ----------------------------
- drop table if exists sys_oss_config;
- create table sys_oss_config (
- oss_config_id bigint(20) not null comment '主键',
- tenant_id varchar(20) default '000000'comment '租户编号',
- config_key varchar(20) not null default '' comment '配置key',
- access_key varchar(255) default '' comment 'accessKey',
- secret_key varchar(255) default '' comment '秘钥',
- bucket_name varchar(255) default '' comment '桶名称',
- prefix varchar(255) default '' comment '前缀',
- endpoint varchar(255) default '' comment '访问站点',
- domain varchar(255) default '' comment '自定义域名',
- is_https char(1) default 'N' comment '是否https(Y=是,N=否)',
- region varchar(255) default '' comment '域',
- access_policy char(1) not null default '1' comment '桶权限类型(0=private 1=public 2=custom)',
- status char(1) default '1' comment '是否默认(0=是,1=否)',
- ext1 varchar(255) default '' comment '扩展字段',
- create_dept bigint(20) default null comment '创建部门',
- create_by bigint(20) default null comment '创建者',
- create_time datetime default null comment '创建时间',
- update_by bigint(20) default null comment '更新者',
- update_time datetime default null comment '更新时间',
- remark varchar(500) default null comment '备注',
- primary key (oss_config_id)
- ) engine=innodb DEFAULT CHARSET=utf8mb4 comment='对象存储配置表';
- insert into sys_oss_config values (1, '000000', 'minio', 'rjzytest', 'rjzytest', 'rjzytest', '', '106.55.100.207:9000', '','N', '', '1' ,'0', '', 103, 1, sysdate(), 1, sysdate(), null);
- insert into sys_oss_config values (2, '000000', 'qiniu', 'XXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXX', 'ruoyi', '', 's3-cn-north-1.qiniucs.com', '','N', '', '1' ,'1', '', 103, 1, sysdate(), 1, sysdate(), null);
- insert into sys_oss_config values (3, '000000', 'aliyun', 'XXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXX', 'ruoyi', '', 'oss-cn-beijing.aliyuncs.com', '','N', '', '1' ,'1', '', 103, 1, sysdate(), 1, sysdate(), null);
- insert into sys_oss_config values (4, '000000', 'qcloud', 'XXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXX', 'ruoyi-1240000000', '', 'cos.ap-beijing.myqcloud.com', '','N', 'ap-beijing', '1' ,'1', '', 103, 1, sysdate(), 1, sysdate(), null);
- insert into sys_oss_config values (5, '000000', 'image', 'rjzytest', 'rjzytest', 'rjzytest', 'image', '106.55.100.207:9000', '','N', '', '1' ,'1', '', 103, 1, sysdate(), 1, sysdate(), null);
- -- ----------------------------
- -- 系统授权表
- -- ----------------------------
- drop table if exists sys_client;
- create table sys_client (
- id bigint(20) not null comment 'id',
- client_id varchar(64) default null comment '客户端id',
- client_key varchar(32) default null comment '客户端key',
- client_secret varchar(255) default null comment '客户端秘钥',
- grant_type varchar(255) default null comment '授权类型',
- device_type varchar(32) default null comment '设备类型',
- active_timeout int(11) default 1800 comment 'token活跃超时时间',
- timeout int(11) default 604800 comment 'token固定超时',
- status char(1) default '0' comment '状态(0正常 1停用)',
- del_flag char(1) default '0' comment '删除标志(0代表存在 1代表删除)',
- create_dept bigint(20) default null comment '创建部门',
- create_by bigint(20) default null comment '创建者',
- create_time datetime default null comment '创建时间',
- update_by bigint(20) default null comment '更新者',
- update_time datetime default null comment '更新时间',
- primary key (id)
- ) engine=innodb DEFAULT CHARSET=utf8mb4 comment='系统授权表';
- insert into sys_client values (1, 'e5cd7e4891bf95d1d19206ce24a7b32e', 'pc', 'pc123', 'password,social', 'pc', 1800, 604800, 0, 0, 103, 1, sysdate(), 1, sysdate());
- insert into sys_client values (2, '428a8310cd442757ae699df5d894f051', 'app', 'app123', 'password,sms,social', 'android', 1800, 604800, 0, 0, 103, 1, sysdate(), 1, sysdate());
- DROP TABLE IF EXISTS test_demo;
- CREATE TABLE test_demo
- (
- id bigint(0) NOT NULL COMMENT '主键',
- tenant_id varchar(20) NULL DEFAULT '000000' COMMENT '租户编号',
- dept_id bigint(0) NULL DEFAULT NULL COMMENT '部门id',
- user_id bigint(0) NULL DEFAULT NULL COMMENT '用户id',
- order_num int(0) NULL DEFAULT 0 COMMENT '排序号',
- test_key varchar(255) NULL DEFAULT NULL COMMENT 'key键',
- value varchar(255) NULL DEFAULT NULL COMMENT '值',
- version int(0) NULL DEFAULT 0 COMMENT '版本',
- create_dept bigint(0) NULL DEFAULT NULL COMMENT '创建部门',
- create_time datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
- create_by bigint(0) NULL DEFAULT NULL COMMENT '创建人',
- update_time datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
- update_by bigint(0) NULL DEFAULT NULL COMMENT '更新人',
- del_flag int(0) NULL DEFAULT 0 COMMENT '删除标志',
- PRIMARY KEY (id) USING BTREE
- ) ENGINE = InnoDB COMMENT = '测试单表';
- DROP TABLE IF EXISTS test_tree;
- CREATE TABLE test_tree
- (
- id bigint(0) NOT NULL COMMENT '主键',
- tenant_id varchar(20) NULL DEFAULT '000000' COMMENT '租户编号',
- parent_id bigint(0) NULL DEFAULT 0 COMMENT '父id',
- dept_id bigint(0) NULL DEFAULT NULL COMMENT '部门id',
- user_id bigint(0) NULL DEFAULT NULL COMMENT '用户id',
- tree_name varchar(255) NULL DEFAULT NULL COMMENT '值',
- version int(0) NULL DEFAULT 0 COMMENT '版本',
- create_dept bigint(0) NULL DEFAULT NULL COMMENT '创建部门',
- create_time datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
- create_by bigint(0) NULL DEFAULT NULL COMMENT '创建人',
- update_time datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
- update_by bigint(0) NULL DEFAULT NULL COMMENT '更新人',
- del_flag int(0) NULL DEFAULT 0 COMMENT '删除标志',
- PRIMARY KEY (id) USING BTREE
- ) ENGINE = InnoDB COMMENT = '测试树表';
- INSERT INTO test_demo VALUES (1, '000000', 102, 4, 1, '测试数据权限', '测试', 0, 103, sysdate(), 1, NULL, NULL, 0);
- INSERT INTO test_demo VALUES (2, '000000', 102, 3, 2, '子节点1', '111', 0, 103, sysdate(), 1, NULL, NULL, 0);
- INSERT INTO test_demo VALUES (3, '000000', 102, 3, 3, '子节点2', '222', 0, 103, sysdate(), 1, NULL, NULL, 0);
- INSERT INTO test_demo VALUES (4, '000000', 108, 4, 4, '测试数据', 'demo', 0, 103, sysdate(), 1, NULL, NULL, 0);
- INSERT INTO test_demo VALUES (5, '000000', 108, 3, 13, '子节点11', '1111', 0, 103, sysdate(), 1, NULL, NULL, 0);
- INSERT INTO test_demo VALUES (6, '000000', 108, 3, 12, '子节点22', '2222', 0, 103, sysdate(), 1, NULL, NULL, 0);
- INSERT INTO test_demo VALUES (7, '000000', 108, 3, 11, '子节点33', '3333', 0, 103, sysdate(), 1, NULL, NULL, 0);
- INSERT INTO test_demo VALUES (8, '000000', 108, 3, 10, '子节点44', '4444', 0, 103, sysdate(), 1, NULL, NULL, 0);
- INSERT INTO test_demo VALUES (9, '000000', 108, 3, 9, '子节点55', '5555', 0, 103, sysdate(), 1, NULL, NULL, 0);
- INSERT INTO test_demo VALUES (10, '000000', 108, 3, 8, '子节点66', '6666', 0, 103, sysdate(), 1, NULL, NULL, 0);
- INSERT INTO test_demo VALUES (11, '000000', 108, 3, 7, '子节点77', '7777', 0, 103, sysdate(), 1, NULL, NULL, 0);
- INSERT INTO test_demo VALUES (12, '000000', 108, 3, 6, '子节点88', '8888', 0, 103, sysdate(), 1, NULL, NULL, 0);
- INSERT INTO test_demo VALUES (13, '000000', 108, 3, 5, '子节点99', '9999', 0, 103, sysdate(), 1, NULL, NULL, 0);
- INSERT INTO test_tree VALUES (1, '000000', 0, 102, 4, '测试数据权限', 0, 103, sysdate(), 1, NULL, NULL, 0);
- INSERT INTO test_tree VALUES (2, '000000', 1, 102, 3, '子节点1', 0, 103, sysdate(), 1, NULL, NULL, 0);
- INSERT INTO test_tree VALUES (3, '000000', 2, 102, 3, '子节点2', 0, 103, sysdate(), 1, NULL, NULL, 0);
- INSERT INTO test_tree VALUES (4, '000000', 0, 108, 4, '测试树1', 0, 103, sysdate(), 1, NULL, NULL, 0);
- INSERT INTO test_tree VALUES (5, '000000', 4, 108, 3, '子节点11', 0, 103, sysdate(), 1, NULL, NULL, 0);
- INSERT INTO test_tree VALUES (6, '000000', 4, 108, 3, '子节点22', 0, 103, sysdate(), 1, NULL, NULL, 0);
- INSERT INTO test_tree VALUES (7, '000000', 4, 108, 3, '子节点33', 0, 103, sysdate(), 1, NULL, NULL, 0);
- INSERT INTO test_tree VALUES (8, '000000', 5, 108, 3, '子节点44', 0, 103, sysdate(), 1, NULL, NULL, 0);
- INSERT INTO test_tree VALUES (9, '000000', 6, 108, 3, '子节点55', 0, 103, sysdate(), 1, NULL, NULL, 0);
- INSERT INTO test_tree VALUES (10, '000000', 7, 108, 3, '子节点66', 0, 103, sysdate(), 1, NULL, NULL, 0);
- INSERT INTO test_tree VALUES (11, '000000', 7, 108, 3, '子节点77', 0, 103, sysdate(), 1, NULL, NULL, 0);
- INSERT INTO test_tree VALUES (12, '000000', 10, 108, 3, '子节点88', 0, 103, sysdate(), 1, NULL, NULL, 0);
- INSERT INTO test_tree VALUES (13, '000000', 10, 108, 3, '子节点99', 0, 103, sysdate(), 1, NULL, NULL, 0);
- -- ============================================================
- -- 任务调度模块(SnailJob)
- -- ============================================================
- SET NAMES utf8mb4;
- DROP TABLE IF EXISTS `sj_namespace`;
- drop table if exists sj_namespace;
- CREATE TABLE `sj_namespace`
- (
- `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
- `name` varchar(64) NOT NULL COMMENT '名称',
- `unique_id` varchar(64) NOT NULL COMMENT '唯一id',
- `description` varchar(256) NOT NULL DEFAULT '' COMMENT '描述',
- `deleted` tinyint(4) NOT NULL DEFAULT 0 COMMENT '逻辑删除 1、删除',
- `create_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- `update_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
- PRIMARY KEY (`id`),
- KEY `idx_name` (`name`),
- UNIQUE KEY `uk_unique_id` (`unique_id`)
- ) ENGINE = InnoDB
- DEFAULT CHARSET = utf8mb4 COMMENT ='命名空间';
- INSERT INTO `sj_namespace` VALUES (1, 'Development', 'dev', '', 0, now(), now());
- INSERT INTO `sj_namespace` VALUES (2, 'Production', 'prod', '', 0, now(), now());
- DROP TABLE IF EXISTS `sj_group_config`;
- drop table if exists sj_group_config;
- CREATE TABLE `sj_group_config`
- (
- `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
- `namespace_id` varchar(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a' COMMENT '命名空间id',
- `group_name` varchar(64) NOT NULL DEFAULT '' COMMENT '组名称',
- `description` varchar(256) NOT NULL DEFAULT '' COMMENT '组描述',
- `token` varchar(64) NOT NULL DEFAULT 'SJ_cKqBTPzCsWA3VyuCfFoccmuIEGXjr5KT' COMMENT 'token',
- `group_status` tinyint(4) NOT NULL DEFAULT 0 COMMENT '组状态 0、未启用 1、启用',
- `version` int(11) NOT NULL COMMENT '版本号',
- `group_partition` int(11) NOT NULL COMMENT '分区',
- `id_generator_mode` tinyint(4) NOT NULL DEFAULT 1 COMMENT '唯一id生成模式 默认号段模式',
- `init_scene` tinyint(4) NOT NULL DEFAULT 0 COMMENT '是否初始化场景 0:否 1:是',
- `create_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- `update_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
- PRIMARY KEY (`id`),
- UNIQUE KEY `uk_namespace_id_group_name` (`namespace_id`, `group_name`)
- ) ENGINE = InnoDB
- AUTO_INCREMENT = 0
- DEFAULT CHARSET = utf8mb4 COMMENT ='组配置';
- INSERT INTO `sj_group_config` VALUES (1, 'dev', 'ruoyi_group', '', 'SJ_cKqBTPzCsWA3VyuCfFoccmuIEGXjr5KT', 1, 1, 0, 1, 1, now(), now());
- INSERT INTO `sj_group_config` VALUES (2, 'prod', 'ruoyi_group', '', 'SJ_cKqBTPzCsWA3VyuCfFoccmuIEGXjr5KT', 1, 1, 0, 1, 1, now(), now());
- DROP TABLE IF EXISTS `sj_notify_config`;
- drop table if exists sj_notify_config;
- CREATE TABLE `sj_notify_config`
- (
- `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
- `namespace_id` varchar(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a' COMMENT '命名空间id',
- `group_name` varchar(64) NOT NULL COMMENT '组名称',
- `notify_name` varchar(64) NOT NULL DEFAULT '' COMMENT '通知名称',
- `system_task_type` tinyint(4) NOT NULL DEFAULT 3 COMMENT '任务类型 1. 重试任务 2. 重试回调 3、JOB任务 4、WORKFLOW任务',
- `notify_status` tinyint(4) NOT NULL DEFAULT 0 COMMENT '通知状态 0、未启用 1、启用',
- `recipient_ids` varchar(128) NOT NULL COMMENT '接收人id列表',
- `notify_threshold` int(11) NOT NULL DEFAULT 0 COMMENT '通知阈值',
- `notify_scene` tinyint(4) NOT NULL DEFAULT 0 COMMENT '通知场景',
- `rate_limiter_status` tinyint(4) NOT NULL DEFAULT 0 COMMENT '限流状态 0、未启用 1、启用',
- `rate_limiter_threshold` int(11) NOT NULL DEFAULT 0 COMMENT '每秒限流阈值',
- `description` varchar(256) NOT NULL DEFAULT '' COMMENT '描述',
- `create_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- `update_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
- PRIMARY KEY (`id`),
- KEY `idx_namespace_id_group_name_scene_name` (`namespace_id`, `group_name`)
- ) ENGINE = InnoDB
- AUTO_INCREMENT = 0
- DEFAULT CHARSET = utf8mb4 COMMENT ='通知配置';
- DROP TABLE IF EXISTS `sj_notify_recipient`;
- drop table if exists sj_notify_recipient;
- CREATE TABLE `sj_notify_recipient`
- (
- `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
- `namespace_id` varchar(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a' COMMENT '命名空间id',
- `recipient_name` varchar(64) NOT NULL COMMENT '接收人名称',
- `notify_type` tinyint(4) NOT NULL DEFAULT 0 COMMENT '通知类型 1、钉钉 2、邮件 3、企业微信 4 飞书 5 webhook',
- `notify_attribute` varchar(512) NOT NULL COMMENT '配置属性',
- `description` varchar(256) NOT NULL DEFAULT '' COMMENT '描述',
- `create_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- `update_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
- PRIMARY KEY (`id`),
- KEY `idx_namespace_id` (`namespace_id`)
- ) ENGINE = InnoDB
- AUTO_INCREMENT = 0
- DEFAULT CHARSET = utf8mb4 COMMENT ='告警通知接收人';
- DROP TABLE IF EXISTS `sj_retry_dead_letter`;
- drop table if exists sj_retry_dead_letter;
- CREATE TABLE `sj_retry_dead_letter`
- (
- `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
- `namespace_id` varchar(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a' COMMENT '命名空间id',
- `group_name` varchar(64) NOT NULL COMMENT '组名称',
- `group_id` bigint(20) NOT NULL COMMENT '组Id',
- `scene_name` varchar(64) NOT NULL COMMENT '场景名称',
- `scene_id` bigint(20) NOT NULL COMMENT '场景ID',
- `idempotent_id` varchar(64) NOT NULL COMMENT '幂等id',
- `biz_no` varchar(64) NOT NULL DEFAULT '' COMMENT '业务编号',
- `executor_name` varchar(512) NOT NULL DEFAULT '' COMMENT '执行器名称',
- -- jackson 兼容历史数据 预计1.8.0默认改为fury
- `serializer_name` varchar(32) NOT NULL DEFAULT 'jackson' COMMENT '执行方法参数序列化器名称',
- `args_str` text NOT NULL COMMENT '执行方法参数',
- `ext_attrs` text NOT NULL COMMENT '扩展字段',
- `create_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- PRIMARY KEY (`id`),
- KEY `idx_namespace_id_group_name_scene_name` (`namespace_id`, `group_name`, `scene_name`),
- KEY `idx_idempotent_id` (`idempotent_id`),
- KEY `idx_biz_no` (`biz_no`),
- KEY `idx_create_dt` (`create_dt`)
- ) ENGINE = InnoDB
- AUTO_INCREMENT = 0
- DEFAULT CHARSET = utf8mb4 COMMENT ='死信队列表';
- DROP TABLE IF EXISTS `sj_retry`;
- drop table if exists sj_retry;
- CREATE TABLE `sj_retry`
- (
- `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
- `namespace_id` varchar(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a' COMMENT '命名空间id',
- `group_name` varchar(64) NOT NULL COMMENT '组名称',
- `group_id` bigint(20) NOT NULL COMMENT '组Id',
- `scene_name` varchar(64) NOT NULL COMMENT '场景名称',
- `scene_id` bigint(20) NOT NULL COMMENT '场景ID',
- `idempotent_id` varchar(64) NOT NULL COMMENT '幂等id',
- `biz_no` varchar(64) NOT NULL DEFAULT '' COMMENT '业务编号',
- `executor_name` varchar(512) NOT NULL DEFAULT '' COMMENT '执行器名称',
- `args_str` text NOT NULL COMMENT '执行方法参数',
- `ext_attrs` text NOT NULL COMMENT '扩展字段',
- -- jackson 兼容历史数据 预计1.8.0默认改为fury
- `serializer_name` varchar(32) NOT NULL DEFAULT 'jackson' COMMENT '执行方法参数序列化器名称',
- `next_trigger_at` bigint(13) NOT NULL COMMENT '下次触发时间',
- `retry_count` int(11) NOT NULL DEFAULT 0 COMMENT '重试次数',
- `retry_status` tinyint(4) NOT NULL DEFAULT 0 COMMENT '重试状态 0、重试中 1、成功 2、最大重试次数',
- `task_type` tinyint(4) NOT NULL DEFAULT 1 COMMENT '任务类型 1、重试数据 2、回调数据',
- `bucket_index` int(11) NOT NULL DEFAULT 0 COMMENT 'bucket',
- `parent_id` bigint(20) NOT NULL DEFAULT 0 COMMENT '父节点id',
- `deleted` bigint(20) NOT NULL DEFAULT 0 COMMENT '逻辑删除',
- `create_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- `update_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
- PRIMARY KEY (`id`),
- KEY `idx_biz_no` (`biz_no`),
- KEY `idx_idempotent_id` (`idempotent_id`),
- KEY `idx_retry_status_bucket_index` (`retry_status`, `bucket_index`),
- KEY `idx_parent_id` (`parent_id`),
- KEY `idx_create_dt` (`create_dt`),
- UNIQUE KEY `uk_scene_tasktype_idempotentid_deleted` (`scene_id`, `task_type`, `idempotent_id`, `deleted`)
- ) ENGINE = InnoDB
- AUTO_INCREMENT = 0
- DEFAULT CHARSET = utf8mb4 COMMENT ='重试信息表';
- DROP TABLE IF EXISTS `sj_retry_task`;
- drop table if exists sj_retry_task;
- CREATE TABLE `sj_retry_task`
- (
- `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
- `namespace_id` varchar(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a' COMMENT '命名空间id',
- `group_name` varchar(64) NOT NULL COMMENT '组名称',
- `scene_name` varchar(64) NOT NULL COMMENT '场景名称',
- `retry_id` bigint(20) NOT NULL COMMENT '重试信息Id',
- `ext_attrs` text NOT NULL COMMENT '扩展字段',
- `task_status` tinyint(4) NOT NULL DEFAULT 1 COMMENT '重试状态',
- `task_type` tinyint(4) NOT NULL DEFAULT 1 COMMENT '任务类型 1、重试数据 2、回调数据',
- `operation_reason` tinyint(4) NOT NULL DEFAULT 0 COMMENT '操作原因',
- `client_info` varchar(128) DEFAULT NULL COMMENT '客户端地址 clientId#ip:port',
- `create_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- `update_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
- PRIMARY KEY (`id`),
- KEY `idx_group_name_scene_name` (`namespace_id`, `group_name`, `scene_name`),
- KEY `task_status` (`task_status`),
- KEY `idx_create_dt` (`create_dt`),
- KEY `idx_retry_id` (`retry_id`)
- ) ENGINE = InnoDB
- AUTO_INCREMENT = 0
- DEFAULT CHARSET = utf8mb4 COMMENT ='重试任务表';
- DROP TABLE IF EXISTS `sj_retry_task_log_message`;
- drop table if exists sj_retry_task_log_message;
- CREATE TABLE `sj_retry_task_log_message`
- (
- `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
- `namespace_id` varchar(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a' COMMENT '命名空间id',
- `group_name` varchar(64) NOT NULL COMMENT '组名称',
- `retry_id` bigint(20) NOT NULL COMMENT '重试信息Id',
- `retry_task_id` bigint(20) NOT NULL COMMENT '重试任务Id',
- `message` longtext NOT NULL COMMENT '异常信息',
- `log_num` int(11) NOT NULL DEFAULT 1 COMMENT '日志数量',
- `real_time` bigint(13) NOT NULL DEFAULT 0 COMMENT '上报时间',
- `create_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- PRIMARY KEY (`id`),
- KEY `idx_namespace_id_group_name_retry_task_id` (`namespace_id`, `group_name`, `retry_task_id`),
- KEY `idx_create_dt` (`create_dt`)
- ) ENGINE = InnoDB
- AUTO_INCREMENT = 0
- DEFAULT CHARSET = utf8mb4 COMMENT ='任务调度日志信息记录表';
- DROP TABLE IF EXISTS `sj_retry_scene_config`;
- drop table if exists sj_retry_scene_config;
- CREATE TABLE `sj_retry_scene_config`
- (
- `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
- `namespace_id` varchar(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a' COMMENT '命名空间id',
- `scene_name` varchar(64) NOT NULL COMMENT '场景名称',
- `group_name` varchar(64) NOT NULL COMMENT '组名称',
- `scene_status` tinyint(4) NOT NULL DEFAULT 0 COMMENT '组状态 0、未启用 1、启用',
- `max_retry_count` int(11) NOT NULL DEFAULT 5 COMMENT '最大重试次数',
- `back_off` tinyint(4) NOT NULL DEFAULT 1 COMMENT '1、默认等级 2、固定间隔时间 3、CRON 表达式',
- `trigger_interval` varchar(16) NOT NULL DEFAULT '' COMMENT '间隔时长',
- `notify_ids` varchar(128) NOT NULL DEFAULT '' COMMENT '通知告警场景配置id列表',
- `deadline_request` bigint(20) unsigned NOT NULL DEFAULT 60000 COMMENT 'Deadline Request 调用链超时 单位毫秒',
- `executor_timeout` int(11) unsigned NOT NULL DEFAULT 5 COMMENT '任务执行超时时间,单位秒',
- `route_key` tinyint(4) NOT NULL DEFAULT 4 COMMENT '路由策略',
- `block_strategy` tinyint(4) NOT NULL DEFAULT 1 COMMENT '阻塞策略 1、丢弃 2、覆盖 3、并行',
- `cb_status` tinyint(4) NOT NULL DEFAULT 0 COMMENT '回调状态 0、不开启 1、开启',
- `cb_trigger_type` tinyint(4) NOT NULL DEFAULT 1 COMMENT '1、默认等级 2、固定间隔时间 3、CRON 表达式',
- `cb_max_count` int(11) NOT NULL DEFAULT 16 COMMENT '回调的最大执行次数',
- `cb_trigger_interval` varchar(16) NOT NULL DEFAULT '' COMMENT '回调的最大执行次数',
- `owner_id` bigint(20) NULL DEFAULT NULL COMMENT '负责人id',
- `labels` varchar(512) NULL DEFAULT '' COMMENT '标签',
- `description` varchar(256) NOT NULL DEFAULT '' COMMENT '描述',
- `create_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- `update_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
- PRIMARY KEY (`id`),
- UNIQUE KEY `uk_namespace_id_group_name_scene_name` (`namespace_id`, `group_name`, `scene_name`)
- ) ENGINE = InnoDB
- AUTO_INCREMENT = 0
- DEFAULT CHARSET = utf8mb4 COMMENT ='场景配置';
- DROP TABLE IF EXISTS `sj_server_node`;
- drop table if exists sj_server_node;
- CREATE TABLE `sj_server_node`
- (
- `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
- `namespace_id` varchar(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a' COMMENT '命名空间id',
- `group_name` varchar(64) NOT NULL COMMENT '组名称',
- `host_id` varchar(64) NOT NULL COMMENT '主机id',
- `host_ip` varchar(64) NOT NULL COMMENT '机器ip',
- `host_port` int(16) NOT NULL COMMENT '机器端口',
- `expire_at` datetime NOT NULL COMMENT '过期时间',
- `node_type` tinyint(4) NOT NULL COMMENT '节点类型 1、客户端 2、是服务端',
- `ext_attrs` varchar(256) NULL DEFAULT '' COMMENT '扩展字段',
- `labels` varchar(512) NULL DEFAULT '' COMMENT '标签',
- `create_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- `update_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
- PRIMARY KEY (`id`),
- KEY `idx_namespace_id_group_name` (`namespace_id`, `group_name`),
- KEY `idx_expire_at_node_type` (`expire_at`, `node_type`),
- UNIQUE KEY `uk_host_id_host_ip` (`host_id`, `host_ip`)
- ) ENGINE = InnoDB
- AUTO_INCREMENT = 0
- DEFAULT CHARSET = utf8mb4 COMMENT ='服务器节点';
- DROP TABLE IF EXISTS `sj_distributed_lock`;
- drop table if exists sj_distributed_lock;
- CREATE TABLE `sj_distributed_lock`
- (
- `name` varchar(64) NOT NULL COMMENT '锁名称',
- `lock_until` timestamp(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3) COMMENT '锁定时长',
- `locked_at` timestamp(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) COMMENT '锁定时间',
- `locked_by` varchar(255) NOT NULL COMMENT '锁定者',
- `create_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- `update_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间',
- PRIMARY KEY (`name`)
- ) ENGINE = InnoDB
- AUTO_INCREMENT = 0
- DEFAULT CHARSET = utf8mb4 COMMENT ='锁定表';
- DROP TABLE IF EXISTS `sj_system_user`;
- drop table if exists sj_system_user;
- CREATE TABLE `sj_system_user`
- (
- `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
- `username` varchar(64) NOT NULL COMMENT '账号',
- `password` varchar(128) NOT NULL COMMENT '密码',
- `role` tinyint(4) NOT NULL DEFAULT 0 COMMENT '角色:1-普通用户、2-管理员',
- `create_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- `update_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
- PRIMARY KEY (`id`),
- UNIQUE KEY `uk_username` (`username`) USING BTREE
- ) ENGINE = InnoDB
- DEFAULT CHARSET = utf8mb4 COMMENT ='系统用户表';
- -- pwd: admin
- INSERT INTO `sj_system_user` (username, password, role)
- VALUES ('admin', '465c194afb65670f38322df087f0a9bb225cc257e43eb4ac5a0c98ef5b3173ac', 2);
- DROP TABLE IF EXISTS `sj_system_user_permission`;
- drop table if exists sj_system_user_permission;
- CREATE TABLE `sj_system_user_permission`
- (
- `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
- `group_name` varchar(64) NOT NULL COMMENT '组名称',
- `namespace_id` varchar(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a' COMMENT '命名空间id',
- `system_user_id` bigint(20) NOT NULL COMMENT '系统用户id',
- `create_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- `update_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
- PRIMARY KEY (`id`),
- UNIQUE KEY `uk_namespace_id_group_name_system_user_id` (`namespace_id`, `group_name`, `system_user_id`)
- ) ENGINE = InnoDB
- DEFAULT CHARSET = utf8mb4 COMMENT ='系统用户权限表';
- -- 分布式调度DDL
- DROP TABLE IF EXISTS `sj_job`;
- drop table if exists sj_job;
- CREATE TABLE `sj_job`
- (
- `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
- `namespace_id` varchar(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a' COMMENT '命名空间id',
- `biz_id` varchar(64) NOT NULL COMMENT '业务ID',
- `group_name` varchar(64) NOT NULL COMMENT '组名称',
- `job_name` varchar(64) NOT NULL COMMENT '名称',
- `args_str` text DEFAULT NULL COMMENT '执行方法参数',
- `args_type` tinyint(4) NOT NULL DEFAULT 1 COMMENT '参数类型 ',
- `next_trigger_at` bigint(13) NOT NULL COMMENT '下次触发时间',
- `job_status` tinyint(4) NOT NULL DEFAULT 1 COMMENT '任务状态 0、关闭、1、开启',
- `task_type` tinyint(4) NOT NULL DEFAULT 1 COMMENT '任务类型 1、集群 2、广播 3、切片',
- `route_key` tinyint(4) NOT NULL DEFAULT 4 COMMENT '路由策略',
- `executor_type` tinyint(4) NOT NULL DEFAULT 1 COMMENT '执行器类型',
- `executor_info` varchar(255) DEFAULT NULL COMMENT '执行器名称',
- `trigger_type` tinyint(4) NOT NULL COMMENT '触发类型 1.CRON 表达式 2. 固定时间',
- `trigger_interval` varchar(255) NOT NULL COMMENT '间隔时长',
- `block_strategy` tinyint(4) NOT NULL DEFAULT 1 COMMENT '阻塞策略 1、丢弃 2、覆盖 3、并行 4、恢复',
- `executor_timeout` int(11) NOT NULL DEFAULT 0 COMMENT '任务执行超时时间,单位秒',
- `max_retry_times` int(11) NOT NULL DEFAULT 0 COMMENT '最大重试次数',
- `parallel_num` int(11) NOT NULL DEFAULT 1 COMMENT '并行数',
- `retry_interval` int(11) NOT NULL DEFAULT 0 COMMENT '重试间隔(s)',
- `bucket_index` int(11) NOT NULL DEFAULT 0 COMMENT 'bucket',
- `resident` tinyint(4) NOT NULL DEFAULT 0 COMMENT '是否是常驻任务',
- `notify_ids` varchar(128) NOT NULL DEFAULT '' COMMENT '通知告警场景配置id列表',
- `owner_id` bigint(20) NULL DEFAULT NULL COMMENT '负责人id',
- `labels` varchar(512) NULL DEFAULT '' COMMENT '标签',
- `description` varchar(256) NOT NULL DEFAULT '' COMMENT '描述',
- `ext_attrs` varchar(256) NULL DEFAULT '' COMMENT '扩展字段',
- `deleted` tinyint(4) NOT NULL DEFAULT 0 COMMENT '逻辑删除 1、删除',
- `create_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- `update_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
- PRIMARY KEY (`id`),
- KEY `idx_namespace_id_group_name` (`namespace_id`, `group_name`),
- KEY `idx_job_status_bucket_index` (`job_status`, `bucket_index`),
- KEY `idx_create_dt` (`create_dt`),
- UNIQUE KEY `uk_sj_job_01` (`namespace_id`, `biz_id`)
- ) ENGINE = InnoDB
- AUTO_INCREMENT = 0
- DEFAULT CHARSET = utf8mb4 COMMENT ='任务信息';
- INSERT INTO `sj_job` VALUES (1, 'dev', 'demo-job', 'ruoyi_group', 'demo-job', null, 1, 1710344035622, 1, 1, 4, 1, 'testJobExecutor', 2, '60', 1, 60, 3, 1, 1, 116, 0, '', 1, '','', '', 0 , now(), now());
- DROP TABLE IF EXISTS `sj_job_log_message`;
- drop table if exists sj_job_log_message;
- CREATE TABLE `sj_job_log_message`
- (
- `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
- `namespace_id` varchar(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a' COMMENT '命名空间id',
- `group_name` varchar(64) NOT NULL COMMENT '组名称',
- `job_id` bigint(20) NOT NULL COMMENT '任务信息id',
- `task_batch_id` bigint(20) NOT NULL COMMENT '任务批次id',
- `task_id` bigint(20) NOT NULL COMMENT '调度任务id',
- `message` longtext NOT NULL COMMENT '调度信息',
- `log_num` int(11) NOT NULL DEFAULT 1 COMMENT '日志数量',
- `real_time` bigint(13) NOT NULL DEFAULT 0 COMMENT '上报时间',
- `ext_attrs` varchar(256) NULL DEFAULT '' COMMENT '扩展字段',
- `create_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- PRIMARY KEY (`id`),
- KEY `idx_task_batch_id_task_id` (`task_batch_id`, `task_id`),
- KEY `idx_create_dt` (`create_dt`),
- KEY `idx_namespace_id_group_name` (`namespace_id`, `group_name`)
- ) ENGINE = InnoDB
- AUTO_INCREMENT = 0
- DEFAULT CHARSET = utf8mb4 COMMENT ='调度日志';
- DROP TABLE IF EXISTS `sj_job_task`;
- drop table if exists sj_job_task;
- CREATE TABLE `sj_job_task`
- (
- `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
- `namespace_id` varchar(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a' COMMENT '命名空间id',
- `group_name` varchar(64) NOT NULL COMMENT '组名称',
- `job_id` bigint(20) NOT NULL COMMENT '任务信息id',
- `task_batch_id` bigint(20) NOT NULL COMMENT '调度任务id',
- `parent_id` bigint(20) NOT NULL DEFAULT 0 COMMENT '父执行器id',
- `task_status` tinyint NOT NULL DEFAULT 0 COMMENT '执行的状态 0、失败 1、成功',
- `retry_count` int(11) NOT NULL DEFAULT 0 COMMENT '重试次数',
- `mr_stage` tinyint DEFAULT NULL COMMENT '动态分片所处阶段 1:map 2:reduce 3:mergeReduce',
- `leaf` tinyint NOT NULL DEFAULT '1' COMMENT '叶子节点',
- `task_name` varchar(255) NOT NULL DEFAULT '' COMMENT '任务名称',
- `client_info` varchar(128) DEFAULT NULL COMMENT '客户端地址 clientId#ip:port',
- `wf_context` text DEFAULT NULL COMMENT '工作流全局上下文',
- `result_message` text NOT NULL COMMENT '执行结果',
- `args_str` text DEFAULT NULL COMMENT '执行方法参数',
- `args_type` tinyint NOT NULL DEFAULT 1 COMMENT '参数类型 ',
- `ext_attrs` varchar(256) NULL DEFAULT '' COMMENT '扩展字段',
- `create_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- `update_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
- PRIMARY KEY (`id`),
- KEY `idx_task_batch_id_task_status` (`task_batch_id`, `task_status`),
- KEY `idx_create_dt` (`create_dt`),
- KEY `idx_namespace_id_group_name` (`namespace_id`, `group_name`)
- ) ENGINE = InnoDB
- AUTO_INCREMENT = 0
- DEFAULT CHARSET = utf8mb4 COMMENT ='任务实例';
- DROP TABLE IF EXISTS `sj_job_task_batch`;
- drop table if exists sj_job_task_batch;
- CREATE TABLE `sj_job_task_batch`
- (
- `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
- `namespace_id` varchar(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a' COMMENT '命名空间id',
- `group_name` varchar(64) NOT NULL COMMENT '组名称',
- `job_id` bigint(20) NOT NULL COMMENT '任务id',
- `workflow_node_id` bigint(20) NOT NULL DEFAULT 0 COMMENT '工作流节点id',
- `parent_workflow_node_id` bigint(20) NOT NULL DEFAULT 0 COMMENT '工作流任务父批次id',
- `workflow_task_batch_id` bigint(20) NOT NULL DEFAULT 0 COMMENT '工作流任务批次id',
- `task_batch_status` tinyint(4) NOT NULL DEFAULT 0 COMMENT '任务批次状态 0、失败 1、成功',
- `operation_reason` tinyint(4) NOT NULL DEFAULT 0 COMMENT '操作原因',
- `execution_at` bigint(13) NOT NULL DEFAULT 0 COMMENT '任务执行时间',
- `system_task_type` tinyint(4) NOT NULL DEFAULT 3 COMMENT '任务类型 3、JOB任务 4、WORKFLOW任务',
- `parent_id` varchar(64) NOT NULL DEFAULT '' COMMENT '父节点',
- `ext_attrs` varchar(256) NULL DEFAULT '' COMMENT '扩展字段',
- `deleted` tinyint(4) NOT NULL DEFAULT 0 COMMENT '逻辑删除 1、删除',
- `create_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- `update_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
- PRIMARY KEY (`id`),
- KEY `idx_job_id_task_batch_status` (`job_id`, `task_batch_status`),
- KEY `idx_create_dt` (`create_dt`),
- KEY `idx_namespace_id_group_name` (`namespace_id`, `group_name`),
- KEY `idx_workflow_task_batch_id_workflow_node_id` (`workflow_task_batch_id`, `workflow_node_id`)
- ) ENGINE = InnoDB
- AUTO_INCREMENT = 0
- DEFAULT CHARSET = utf8mb4 COMMENT ='任务批次';
- DROP TABLE IF EXISTS `sj_job_summary`;
- drop table if exists sj_job_summary;
- CREATE TABLE `sj_job_summary`
- (
- `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
- `namespace_id` VARCHAR(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a' COMMENT '命名空间id',
- `group_name` VARCHAR(64) NOT NULL DEFAULT '' COMMENT '组名称',
- `business_id` bigint NOT NULL COMMENT '业务id (job_id或workflow_id)',
- `system_task_type` tinyint(4) NOT NULL DEFAULT 3 COMMENT '任务类型 3、JOB任务 4、WORKFLOW任务',
- `trigger_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '统计时间',
- `success_num` int NOT NULL DEFAULT 0 COMMENT '执行成功-日志数量',
- `fail_num` int NOT NULL DEFAULT 0 COMMENT '执行失败-日志数量',
- `fail_reason` varchar(512) NOT NULL DEFAULT '' COMMENT '失败原因',
- `stop_num` int NOT NULL DEFAULT 0 COMMENT '执行失败-日志数量',
- `stop_reason` varchar(512) NOT NULL DEFAULT '' COMMENT '失败原因',
- `cancel_num` int NOT NULL DEFAULT 0 COMMENT '执行失败-日志数量',
- `cancel_reason` varchar(512) NOT NULL DEFAULT '' COMMENT '失败原因',
- `create_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- `update_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
- PRIMARY KEY (`id`),
- KEY `idx_namespace_id_group_name_business_id` (`namespace_id`, `group_name`, business_id),
- UNIQUE KEY `uk_trigger_at_system_task_type_business_id` (`trigger_at`, `system_task_type`, `business_id`) USING BTREE
- ) ENGINE = InnoDB
- AUTO_INCREMENT = 1
- DEFAULT CHARSET = utf8mb4 COMMENT ='DashBoard_Job';
- DROP TABLE IF EXISTS `sj_retry_summary`;
- drop table if exists sj_retry_summary;
- CREATE TABLE `sj_retry_summary`
- (
- `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
- `namespace_id` VARCHAR(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a' COMMENT '命名空间id',
- `group_name` VARCHAR(64) NOT NULL DEFAULT '' COMMENT '组名称',
- `scene_name` VARCHAR(64) NOT NULL DEFAULT '' COMMENT '场景名称',
- `trigger_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '统计时间',
- `running_num` int NOT NULL DEFAULT 0 COMMENT '重试中-日志数量',
- `finish_num` int NOT NULL DEFAULT 0 COMMENT '重试完成-日志数量',
- `max_count_num` int NOT NULL DEFAULT 0 COMMENT '重试到达最大次数-日志数量',
- `suspend_num` int NOT NULL DEFAULT 0 COMMENT '暂停重试-日志数量',
- `create_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- `update_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
- PRIMARY KEY (`id`),
- KEY `idx_trigger_at` (`trigger_at`),
- UNIQUE KEY `uk_scene_name_trigger_at` (`namespace_id`, `group_name`, `scene_name`, `trigger_at`) USING BTREE
- ) ENGINE = InnoDB
- AUTO_INCREMENT = 1
- DEFAULT CHARSET = utf8mb4 COMMENT ='DashBoard_Retry';
- DROP TABLE IF EXISTS `sj_workflow`;
- drop table if exists sj_workflow;
- CREATE TABLE `sj_workflow`
- (
- `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
- `workflow_name` varchar(64) NOT NULL COMMENT '工作流名称',
- `namespace_id` varchar(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a' COMMENT '命名空间id',
- `biz_id` varchar(64) NOT NULL COMMENT '业务ID',
- `group_name` varchar(64) NOT NULL COMMENT '组名称',
- `workflow_status` tinyint(4) NOT NULL DEFAULT 1 COMMENT '工作流状态 0、关闭、1、开启',
- `trigger_type` tinyint(4) NOT NULL COMMENT '触发类型 1.CRON 表达式 2. 固定时间',
- `trigger_interval` varchar(255) NOT NULL COMMENT '间隔时长',
- `next_trigger_at` bigint NOT NULL COMMENT '下次触发时间',
- `block_strategy` tinyint(4) NOT NULL DEFAULT 1 COMMENT '阻塞策略 1、丢弃 2、覆盖 3、并行',
- `executor_timeout` int(11) NOT NULL DEFAULT 0 COMMENT '任务执行超时时间,单位秒',
- `description` varchar(256) NOT NULL DEFAULT '' COMMENT '描述',
- `flow_info` text DEFAULT NULL COMMENT '流程信息',
- `wf_context` text DEFAULT NULL COMMENT '上下文',
- `notify_ids` varchar(128) NOT NULL DEFAULT '' COMMENT '通知告警场景配置id列表',
- `bucket_index` int(11) NOT NULL DEFAULT 0 COMMENT 'bucket',
- `version` int(11) NOT NULL COMMENT '版本号',
- `owner_id` bigint(20) NULL DEFAULT NULL COMMENT '负责人id',
- `ext_attrs` varchar(256) NULL DEFAULT '' COMMENT '扩展字段',
- `deleted` tinyint(4) NOT NULL DEFAULT 0 COMMENT '逻辑删除 1、删除',
- `create_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- `update_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
- PRIMARY KEY (`id`),
- KEY `idx_create_dt` (`create_dt`),
- KEY `idx_namespace_id_group_name` (`namespace_id`, `group_name`),
- UNIQUE KEY `uk_sj_workflow_01` (`namespace_id`, `biz_id`)
- ) ENGINE = InnoDB
- AUTO_INCREMENT = 0
- DEFAULT CHARSET = utf8mb4 COMMENT ='工作流';
- DROP TABLE IF EXISTS `sj_workflow_node`;
- drop table if exists sj_workflow_node;
- CREATE TABLE `sj_workflow_node`
- (
- `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
- `namespace_id` varchar(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a' COMMENT '命名空间id',
- `node_name` varchar(64) NOT NULL COMMENT '节点名称',
- `group_name` varchar(64) NOT NULL COMMENT '组名称',
- `job_id` bigint(20) NOT NULL COMMENT '任务信息id',
- `workflow_id` bigint(20) NOT NULL COMMENT '工作流ID',
- `node_type` tinyint(4) NOT NULL DEFAULT 1 COMMENT '1、任务节点 2、条件节点',
- `expression_type` tinyint(4) NOT NULL DEFAULT 0 COMMENT '1、SpEl、2、Aviator 3、QL',
- `fail_strategy` tinyint(4) NOT NULL DEFAULT 1 COMMENT '失败策略 1、跳过 2、阻塞',
- `workflow_node_status` tinyint(4) NOT NULL DEFAULT 1 COMMENT '工作流节点状态 0、关闭、1、开启',
- `priority_level` int(11) NOT NULL DEFAULT 1 COMMENT '优先级',
- `node_info` text DEFAULT NULL COMMENT '节点信息 ',
- `version` int(11) NOT NULL COMMENT '版本号',
- `ext_attrs` varchar(256) NULL DEFAULT '' COMMENT '扩展字段',
- `deleted` tinyint(4) NOT NULL DEFAULT 0 COMMENT '逻辑删除 1、删除',
- `create_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- `update_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
- PRIMARY KEY (`id`),
- KEY `idx_create_dt` (`create_dt`),
- KEY `idx_namespace_id_group_name` (`namespace_id`, `group_name`)
- ) ENGINE = InnoDB
- AUTO_INCREMENT = 0
- DEFAULT CHARSET = utf8mb4 COMMENT ='工作流节点';
- DROP TABLE IF EXISTS `sj_workflow_task_batch`;
- drop table if exists sj_workflow_task_batch;
- CREATE TABLE `sj_workflow_task_batch`
- (
- `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
- `namespace_id` varchar(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a' COMMENT '命名空间id',
- `group_name` varchar(64) NOT NULL COMMENT '组名称',
- `workflow_id` bigint(20) NOT NULL COMMENT '工作流任务id',
- `task_batch_status` tinyint(4) NOT NULL DEFAULT 0 COMMENT '任务批次状态 0、失败 1、成功',
- `operation_reason` tinyint(4) NOT NULL DEFAULT 0 COMMENT '操作原因',
- `flow_info` text DEFAULT NULL COMMENT '流程信息',
- `wf_context` text DEFAULT NULL COMMENT '全局上下文',
- `execution_at` bigint(13) NOT NULL DEFAULT 0 COMMENT '任务执行时间',
- `ext_attrs` varchar(256) NULL DEFAULT '' COMMENT '扩展字段',
- `version` int(11) NOT NULL DEFAULT 1 COMMENT '版本号',
- `deleted` tinyint(4) NOT NULL DEFAULT 0 COMMENT '逻辑删除 1、删除',
- `create_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- `update_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
- PRIMARY KEY (`id`),
- KEY `idx_job_id_task_batch_status` (`workflow_id`, `task_batch_status`),
- KEY `idx_create_dt` (`create_dt`),
- KEY `idx_namespace_id_group_name` (`namespace_id`, `group_name`)
- ) ENGINE = InnoDB
- AUTO_INCREMENT = 0
- DEFAULT CHARSET = utf8mb4 COMMENT ='工作流批次';
- DROP TABLE IF EXISTS `sj_job_executor`;
- drop table if exists sj_job_executor;
- CREATE TABLE `sj_job_executor`
- (
- `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
- `namespace_id` varchar(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a' COMMENT '命名空间id',
- `group_name` varchar(64) NOT NULL COMMENT '组名称',
- `executor_info` varchar(256) NOT NULL COMMENT '任务执行器名称',
- `executor_type` varchar(3) NOT NULL COMMENT '1:java 2:python 3:go',
- `create_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- `update_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
- PRIMARY KEY (`id`),
- KEY `idx_namespace_id_group_name` (`namespace_id`, `group_name`),
- KEY `idx_create_dt` (`create_dt`)
- ) ENGINE = InnoDB
- AUTO_INCREMENT = 0
- DEFAULT CHARSET = utf8mb4 COMMENT ='任务执行器信息';
- -- ============================================================
- -- 工作流模块(Warm-Flow)
- -- ============================================================
- -- ----------------------------
- -- 0、warm-flow-all.sql,地址:https://gitee.com/dromara/warm-flow/blob/master/sql/mysql/warm-flow-all.sql
- -- ----------------------------
- DROP TABLE IF EXISTS `flow_definition`;
- drop table if exists flow_definition;
- CREATE TABLE `flow_definition`
- (
- `id` bigint NOT NULL COMMENT '主键id',
- `flow_code` varchar(40) NOT NULL COMMENT '流程编码',
- `flow_name` varchar(100) NOT NULL COMMENT '流程名称',
- `model_value` varchar(40) NOT NULL DEFAULT 'CLASSICS' COMMENT '设计器模型(CLASSICS经典模型 MIMIC仿钉钉模型)',
- `category` varchar(100) DEFAULT NULL COMMENT '流程类别',
- `version` varchar(20) NOT NULL COMMENT '流程版本',
- `is_publish` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否发布(0未发布 1已发布 9失效)',
- `form_custom` char(1) DEFAULT 'N' COMMENT '审批表单是否自定义(Y是 N否)',
- `form_path` varchar(100) DEFAULT NULL COMMENT '审批表单路径',
- `activity_status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '流程激活状态(0挂起 1激活)',
- `listener_type` varchar(100) DEFAULT NULL COMMENT '监听器类型',
- `listener_path` varchar(400) DEFAULT NULL COMMENT '监听器路径',
- `ext` varchar(500) DEFAULT NULL COMMENT '业务详情 存业务表对象json字符串',
- `create_time` datetime DEFAULT NULL COMMENT '创建时间',
- `create_by` varchar(64) DEFAULT '' COMMENT '创建人',
- `update_time` datetime DEFAULT NULL COMMENT '更新时间',
- `update_by` varchar(64) DEFAULT '' COMMENT '更新人',
- `del_flag` char(1) DEFAULT '0' COMMENT '删除标志',
- `tenant_id` varchar(40) DEFAULT NULL COMMENT '租户id',
- PRIMARY KEY (`id`) USING BTREE
- ) ENGINE = InnoDB COMMENT ='流程定义表';
- DROP TABLE IF EXISTS `flow_node`;
- drop table if exists flow_node;
- CREATE TABLE `flow_node`
- (
- `id` bigint NOT NULL COMMENT '主键id',
- `node_type` tinyint(1) NOT NULL COMMENT '节点类型(0开始节点 1中间节点 2结束节点 3互斥网关 4并行网关)',
- `definition_id` bigint NOT NULL COMMENT '流程定义id',
- `node_code` varchar(100) NOT NULL COMMENT '流程节点编码',
- `node_name` varchar(100) DEFAULT NULL COMMENT '流程节点名称',
- `permission_flag` varchar(200) DEFAULT NULL COMMENT '权限标识(权限类型:权限标识,可以多个,用@@隔开)',
- `node_ratio` varchar(200) DEFAULT NULL COMMENT '流程签署比例值',
- `coordinate` varchar(100) DEFAULT NULL COMMENT '坐标',
- `any_node_skip` varchar(100) DEFAULT NULL COMMENT '任意结点跳转',
- `listener_type` varchar(100) DEFAULT NULL COMMENT '监听器类型',
- `listener_path` varchar(400) DEFAULT NULL COMMENT '监听器路径',
- `form_custom` char(1) DEFAULT 'N' COMMENT '审批表单是否自定义(Y是 N否)',
- `form_path` varchar(100) DEFAULT NULL COMMENT '审批表单路径',
- `version` varchar(20) NOT NULL COMMENT '版本',
- `create_time` datetime DEFAULT NULL COMMENT '创建时间',
- `create_by` varchar(64) DEFAULT '' COMMENT '创建人',
- `update_time` datetime DEFAULT NULL COMMENT '更新时间',
- `update_by` varchar(64) DEFAULT '' COMMENT '更新人',
- `ext` text COMMENT '节点扩展属性',
- `del_flag` char(1) DEFAULT '0' COMMENT '删除标志',
- `tenant_id` varchar(40) DEFAULT NULL COMMENT '租户id',
- PRIMARY KEY (`id`) USING BTREE
- ) ENGINE = InnoDB COMMENT ='流程节点表';
- DROP TABLE IF EXISTS `flow_skip`;
- drop table if exists flow_skip;
- CREATE TABLE `flow_skip`
- (
- `id` bigint NOT NULL COMMENT '主键id',
- `definition_id` bigint NOT NULL COMMENT '流程定义id',
- `now_node_code` varchar(100) NOT NULL COMMENT '当前流程节点的编码',
- `now_node_type` tinyint(1) DEFAULT NULL COMMENT '当前节点类型(0开始节点 1中间节点 2结束节点 3互斥网关 4并行网关)',
- `next_node_code` varchar(100) NOT NULL COMMENT '下一个流程节点的编码',
- `next_node_type` tinyint(1) DEFAULT NULL COMMENT '下一个节点类型(0开始节点 1中间节点 2结束节点 3互斥网关 4并行网关)',
- `skip_name` varchar(100) DEFAULT NULL COMMENT '跳转名称',
- `skip_type` varchar(40) DEFAULT NULL COMMENT '跳转类型(PASS审批通过 REJECT退回)',
- `skip_condition` varchar(200) DEFAULT NULL COMMENT '跳转条件',
- `coordinate` varchar(100) DEFAULT NULL COMMENT '坐标',
- `create_time` datetime DEFAULT NULL COMMENT '创建时间',
- `create_by` varchar(64) DEFAULT '' COMMENT '创建人',
- `update_time` datetime DEFAULT NULL COMMENT '更新时间',
- `update_by` varchar(64) DEFAULT '' COMMENT '更新人',
- `del_flag` char(1) DEFAULT '0' COMMENT '删除标志',
- `tenant_id` varchar(40) DEFAULT NULL COMMENT '租户id',
- PRIMARY KEY (`id`) USING BTREE
- ) ENGINE = InnoDB COMMENT ='节点跳转关联表';
- DROP TABLE IF EXISTS `flow_instance`;
- drop table if exists flow_instance;
- CREATE TABLE `flow_instance`
- (
- `id` bigint NOT NULL COMMENT '主键id',
- `definition_id` bigint NOT NULL COMMENT '对应flow_definition表的id',
- `business_id` varchar(40) NOT NULL COMMENT '业务id',
- `node_type` tinyint(1) NOT NULL COMMENT '节点类型(0开始节点 1中间节点 2结束节点 3互斥网关 4并行网关)',
- `node_code` varchar(40) NOT NULL COMMENT '流程节点编码',
- `node_name` varchar(100) DEFAULT NULL COMMENT '流程节点名称',
- `variable` text COMMENT '任务变量',
- `flow_status` varchar(20) NOT NULL COMMENT '流程状态(0待提交 1审批中 2审批通过 4终止 5作废 6撤销 8已完成 9已退回 10失效 11拿回)',
- `activity_status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '流程激活状态(0挂起 1激活)',
- `def_json` text COMMENT '流程定义json',
- `create_time` datetime DEFAULT NULL COMMENT '创建时间',
- `create_by` varchar(64) DEFAULT '' COMMENT '创建人',
- `update_time` datetime DEFAULT NULL COMMENT '更新时间',
- `update_by` varchar(64) DEFAULT '' COMMENT '更新人',
- `ext` varchar(500) DEFAULT NULL COMMENT '扩展字段,预留给业务系统使用',
- `del_flag` char(1) DEFAULT '0' COMMENT '删除标志',
- `tenant_id` varchar(40) DEFAULT NULL COMMENT '租户id',
- PRIMARY KEY (`id`) USING BTREE
- ) ENGINE = InnoDB COMMENT ='流程实例表';
- DROP TABLE IF EXISTS `flow_task`;
- drop table if exists flow_task;
- CREATE TABLE `flow_task`
- (
- `id` bigint NOT NULL COMMENT '主键id',
- `definition_id` bigint NOT NULL COMMENT '对应flow_definition表的id',
- `instance_id` bigint NOT NULL COMMENT '对应flow_instance表的id',
- `node_code` varchar(100) NOT NULL COMMENT '节点编码',
- `node_name` varchar(100) DEFAULT NULL COMMENT '节点名称',
- `node_type` tinyint(1) NOT NULL COMMENT '节点类型(0开始节点 1中间节点 2结束节点 3互斥网关 4并行网关)',
- `flow_status` varchar(20) NOT NULL COMMENT '流程状态(0待提交 1审批中 2审批通过 4终止 5作废 6撤销 8已完成 9已退回 10失效 11拿回)',
- `form_custom` char(1) DEFAULT 'N' COMMENT '审批表单是否自定义(Y是 N否)',
- `form_path` varchar(100) DEFAULT NULL COMMENT '审批表单路径',
- `create_time` datetime DEFAULT NULL COMMENT '创建时间',
- `create_by` varchar(64) DEFAULT '' COMMENT '创建人',
- `update_time` datetime DEFAULT NULL COMMENT '更新时间',
- `update_by` varchar(64) DEFAULT '' COMMENT '更新人',
- `del_flag` char(1) DEFAULT '0' COMMENT '删除标志',
- `tenant_id` varchar(40) DEFAULT NULL COMMENT '租户id',
- PRIMARY KEY (`id`) USING BTREE
- ) ENGINE = InnoDB COMMENT ='待办任务表';
- DROP TABLE IF EXISTS `flow_his_task`;
- drop table if exists flow_his_task;
- CREATE TABLE `flow_his_task`
- (
- `id` bigint(20) NOT NULL COMMENT '主键id',
- `definition_id` bigint(20) NOT NULL COMMENT '对应flow_definition表的id',
- `instance_id` bigint(20) NOT NULL COMMENT '对应flow_instance表的id',
- `task_id` bigint(20) NOT NULL COMMENT '对应flow_task表的id',
- `node_code` varchar(100) DEFAULT NULL COMMENT '开始节点编码',
- `node_name` varchar(100) DEFAULT NULL COMMENT '开始节点名称',
- `node_type` tinyint(1) DEFAULT NULL COMMENT '开始节点类型(0开始节点 1中间节点 2结束节点 3互斥网关 4并行网关)',
- `target_node_code` varchar(200) DEFAULT NULL COMMENT '目标节点编码',
- `target_node_name` varchar(200) DEFAULT NULL COMMENT '结束节点名称',
- `approver` varchar(40) DEFAULT NULL COMMENT '审批人',
- `cooperate_type` tinyint(1) NOT NULL DEFAULT '0' COMMENT '协作方式(1审批 2转办 3委派 4会签 5票签 6加签 7减签)',
- `collaborator` varchar(500) DEFAULT NULL COMMENT '协作人',
- `skip_type` varchar(10) NOT NULL COMMENT '流转类型(PASS通过 REJECT退回 NONE无动作)',
- `flow_status` varchar(20) NOT NULL COMMENT '流程状态(0待提交 1审批中 2审批通过 4终止 5作废 6撤销 8已完成 9已退回 10失效 11拿回)',
- `form_custom` char(1) DEFAULT 'N' COMMENT '审批表单是否自定义(Y是 N否)',
- `form_path` varchar(100) DEFAULT NULL COMMENT '审批表单路径',
- `message` varchar(500) DEFAULT NULL COMMENT '审批意见',
- `variable` TEXT DEFAULT NULL COMMENT '任务变量',
- `ext` TEXT DEFAULT NULL COMMENT '业务详情 存业务表对象json字符串',
- `create_time` datetime DEFAULT NULL COMMENT '任务开始时间',
- `update_time` datetime DEFAULT NULL COMMENT '审批完成时间',
- `del_flag` char(1) DEFAULT '0' COMMENT '删除标志',
- `tenant_id` varchar(40) DEFAULT NULL COMMENT '租户id',
- PRIMARY KEY (`id`) USING BTREE
- ) ENGINE = InnoDB COMMENT ='历史任务记录表';
- DROP TABLE IF EXISTS `flow_user`;
- drop table if exists flow_user;
- CREATE TABLE `flow_user`
- (
- `id` bigint NOT NULL COMMENT '主键id',
- `type` char(1) NOT NULL COMMENT '人员类型(1待办任务的审批人权限 2待办任务的转办人权限 3待办任务的委托人权限)',
- `processed_by` varchar(80) DEFAULT NULL COMMENT '权限人',
- `associated` bigint NOT NULL COMMENT '任务表id',
- `create_time` datetime DEFAULT NULL COMMENT '创建时间',
- `create_by` varchar(80) DEFAULT NULL COMMENT '创建人',
- `update_time` datetime DEFAULT NULL COMMENT '更新时间',
- `update_by` varchar(64) DEFAULT '' COMMENT '创建人',
- `del_flag` char(1) DEFAULT '0' COMMENT '删除标志',
- `tenant_id` varchar(40) DEFAULT NULL COMMENT '租户id',
- PRIMARY KEY (`id`) USING BTREE,
- KEY `user_processed_type` (`processed_by`, `type`),
- KEY `user_associated` (`associated`) USING BTREE
- ) ENGINE = InnoDB COMMENT ='流程用户表';
- -- ----------------------------
- -- 流程分类表
- -- ----------------------------
- drop table if exists flow_category;
- create table flow_category
- (
- category_id bigint(20) not null comment '流程分类ID',
- tenant_id varchar(20) default '000000' comment '租户编号',
- parent_id bigint(20) default 0 comment '父流程分类id',
- ancestors varchar(500) default '' comment '祖级列表',
- category_name varchar(30) not null comment '流程分类名称',
- order_num int(4) default 0 comment '显示顺序',
- del_flag char(1) default '0' comment '删除标志(0代表存在 1代表删除)',
- create_dept bigint(20) null comment '创建部门',
- create_by bigint(20) null comment '创建者',
- create_time datetime null comment '创建时间',
- update_by bigint(20) null comment '更新者',
- update_time datetime null comment '更新时间',
- primary key (category_id)
- ) engine = innodb comment = '流程分类';
- INSERT INTO flow_category values (100, '000000', 0, '0', 'OA审批', 0, '0', 103, 1, sysdate(), null, null);
- INSERT INTO flow_category values (101, '000000', 100, '0,100', '假勤管理', 0, '0', 103, 1, sysdate(), null, null);
- INSERT INTO flow_category values (102, '000000', 100, '0,100', '人事管理', 1, '0', 103, 1, sysdate(), null, null);
- INSERT INTO flow_category values (103, '000000', 101, '0,100,101', '请假', 0, '0', 103, 1, sysdate(), null, null);
- INSERT INTO flow_category values (104, '000000', 101, '0,100,101', '出差', 1, '0', 103, 1, sysdate(), null, null);
- INSERT INTO flow_category values (105, '000000', 101, '0,100,101', '加班', 2, '0', 103, 1, sysdate(), null, null);
- INSERT INTO flow_category values (106, '000000', 101, '0,100,101', '换班', 3, '0', 103, 1, sysdate(), null, null);
- INSERT INTO flow_category values (107, '000000', 101, '0,100,101', '外出', 4, '0', 103, 1, sysdate(), null, null);
- INSERT INTO flow_category values (108, '000000', 102, '0,100,102', '转正', 1, '0', 103, 1, sysdate(), null, null);
- INSERT INTO flow_category values (109, '000000', 102, '0,100,102', '离职', 2, '0', 103, 1, sysdate(), null, null);
- -- ----------------------------
- -- 流程spel表达式定义表
- -- ----------------------------
- drop table if exists flow_spel;
- CREATE TABLE flow_spel (
- id bigint(20) NOT NULL COMMENT '主键id',
- component_name varchar(255) DEFAULT NULL COMMENT '组件名称',
- method_name varchar(255) DEFAULT NULL COMMENT '方法名',
- method_params varchar(255) DEFAULT NULL COMMENT '参数',
- view_spel varchar(255) DEFAULT NULL COMMENT '预览spel表达式',
- remark varchar(255) DEFAULT NULL COMMENT '备注',
- status char(1) DEFAULT '0' COMMENT '状态(0正常 1停用)',
- del_flag char(1) DEFAULT '0' COMMENT '删除标志',
- create_dept bigint(20) DEFAULT NULL COMMENT '创建部门',
- create_by bigint(20) DEFAULT NULL COMMENT '创建者',
- create_time datetime DEFAULT NULL COMMENT '创建时间',
- update_by bigint(20) DEFAULT NULL COMMENT '更新者',
- update_time datetime DEFAULT NULL COMMENT '更新时间',
- PRIMARY KEY (id)
- ) ENGINE = InnoDB COMMENT='流程spel表达式定义表';
- INSERT INTO flow_spel VALUES (1, 'spelRuleComponent', 'selectDeptLeaderById', 'initiatorDeptId', '#{@spelRuleComponent.selectDeptLeaderById(#initiatorDeptId)}', '根据部门id获取部门负责人', '0', '0', 103, 1, sysdate(), 1, sysdate());
- INSERT INTO flow_spel VALUES (2, NULL, NULL, 'initiator', '${initiator}', '流程发起人', '0', '0', 103, 1, sysdate(), 1, sysdate());
- -- ----------------------------
- -- 流程实例业务扩展表
- -- ----------------------------
- drop table if exists flow_instance_biz_ext;
- create table flow_instance_biz_ext (
- id bigint not null comment '主键id',
- tenant_id varchar(20) default '000000' null comment '租户编号',
- create_dept bigint null comment '创建部门',
- create_by bigint null comment '创建者',
- create_time datetime null comment '创建时间',
- update_by bigint null comment '更新者',
- update_time datetime null comment '更新时间',
- business_code varchar(255) null comment '业务编码',
- business_title varchar(1000) null comment '业务标题',
- del_flag char default '0' null comment '删除标志(0代表存在 1代表删除)',
- instance_id bigint null comment '流程实例Id',
- business_id varchar(255) null comment '业务Id',
- PRIMARY KEY (id)
- ) ENGINE = InnoDB COMMENT '流程实例业务扩展表';
- -- ----------------------------
- -- 请假单信息
- -- ----------------------------
- drop table if exists test_leave;
- create table test_leave
- (
- id bigint(20) not null comment 'id',
- tenant_id varchar(20) default '000000' comment '租户编号',
- apply_code varchar(50) not null comment '申请编号',
- leave_type varchar(255) not null comment '请假类型',
- start_date datetime not null comment '开始时间',
- end_date datetime not null comment '结束时间',
- leave_days int(10) not null comment '请假天数',
- remark varchar(255) null comment '请假原因',
- status varchar(255) null comment '状态',
- create_dept bigint null comment '创建部门',
- create_by bigint null comment '创建者',
- create_time datetime null comment '创建时间',
- update_by bigint null comment '更新者',
- update_time datetime null comment '更新时间',
- PRIMARY KEY (id) USING BTREE
- ) ENGINE = InnoDB COMMENT = '请假申请表';
- insert into sys_menu values ('11616', '工作流', '0', '6', 'workflow', '', '', '1', '0', 'M', '0', '0', '', 'workflow', 103, 1, sysdate(),NULL, NULL, '');
- insert into sys_menu values ('11618', '我的任务', '0', '7', 'task', '', '', '1', '0', 'M', '0', '0', '', 'my-task', 103, 1, sysdate(), NULL, NULL, '');
- insert into sys_menu values ('11619', '我的待办', '11618', '2', 'taskWaiting', 'workflow/task/taskWaiting', '', '1', '1', 'C', '0', '0', '', 'waiting', 103, 1, sysdate(), NULL, NULL, '');
- insert into sys_menu values ('11632', '我的已办', '11618', '3', 'taskFinish', 'workflow/task/taskFinish', '', '1', '1', 'C', '0', '0', '', 'finish', 103, 1, sysdate(), NULL, NULL, '');
- insert into sys_menu values ('11633', '我的抄送', '11618', '4', 'taskCopyList', 'workflow/task/taskCopyList', '', '1', '1', 'C', '0', '0', '', 'my-copy', 103, 1, sysdate(), NULL, NULL, '');
- insert into sys_menu values ('11620', '流程定义', '11616', '3', 'processDefinition', 'workflow/processDefinition/index', '', '1', '1', 'C', '0', '0', 'workflow:definition:list', 'process-definition', 103, 1, sysdate(), NULL, NULL, '');
- insert into sys_menu values ('11621', '流程实例', '11630', '1', 'processInstance', 'workflow/processInstance/index', '', '1', '1', 'C', '0', '0', 'workflow:instance:list', 'tree-table', 103, 1, sysdate(), NULL, NULL, '');
- insert into sys_menu values ('11622', '流程分类', '11616', '1', 'category', 'workflow/category/index', '', '1', '0', 'C', '0', '0', 'workflow:category:list', 'category', 103, 1, sysdate(), NULL, NULL, '');
- INSERT INTO sys_menu VALUES ('11801', '流程表达式', '11616', '2', 'spel', 'workflow/spel/index', '', 1, 0, 'C', '0', '0', 'workflow:spel:list', 'input', 103, 1, sysdate(), 1, sysdate(), '流程达式定义菜单');
- insert into sys_menu values ('11629', '我发起的', '11618', '1', 'myDocument', 'workflow/task/myDocument', '', '1', '1', 'C', '0', '0', 'workflow:instance:currentList', 'guide', 103, 1, sysdate(), NULL, NULL, '');
- insert into sys_menu values ('11630', '流程监控', '11616', '4', 'processMonitor', '', '', '1', '0', 'M', '0', '0', '', 'monitor', 103, 1, sysdate(), NULL, NULL, '');
- insert into sys_menu values ('11631', '待办任务', '11630', '2', 'allTaskWaiting', 'workflow/task/allTaskWaiting', '', '1', '1', 'C', '0', '0', '', 'waiting', 103, 1, sysdate(), NULL, NULL, '');
- insert into sys_menu values ('11700', '流程设计', '11616', '5', 'design/index', 'workflow/processDefinition/design', '', 1, 1, 'C', '1', '0', 'workflow:leave:edit', '#', 103, 1, sysdate(), null, null, '/workflow/processDefinition');
- insert into sys_menu values ('11701', '请假申请', '11616', '6', 'leaveEdit/index', 'workflow/leave/leaveEdit', '', 1, 1, 'C', '1', '0', 'workflow:leave:edit', '#', 103, 1, sysdate(), null, null, '');
- -- 流程分类管理相关按钮
- insert into sys_menu values ('11623', '流程分类查询', '11622', '1', '#', '', '', 1, 0, 'F', '0', '0', 'workflow:category:query', '#', 103, 1,sysdate(), null, null, '');
- insert into sys_menu values ('11624', '流程分类新增', '11622', '2', '#', '', '', 1, 0, 'F', '0', '0', 'workflow:category:add', '#', 103, 1,sysdate(), null, null, '');
- insert into sys_menu values ('11625', '流程分类修改', '11622', '3', '#', '', '', 1, 0, 'F', '0', '0', 'workflow:category:edit', '#', 103, 1,sysdate(), null, null, '');
- insert into sys_menu values ('11626', '流程分类删除', '11622', '4', '#', '', '', 1, 0, 'F', '0', '0', 'workflow:category:remove', '#', 103,1, sysdate(), null, null, '');
- insert into sys_menu values ('11627', '流程分类导出', '11622', '5', '#', '', '', 1, 0, 'F', '0', '0', 'workflow:category:export', '#', 103,1, sysdate(), null, null, '');
- -- 流程实例管理相关按钮
- insert into sys_menu values ('11653', '流程实例查询', '11621', '1', '#', '', '', 1, 0, 'F', '0', '0', 'workflow:instance:query', '#', 103, 1, sysdate(), null, null, '');
- insert into sys_menu values ('11654', '流程变量查询', '11621', '2', '#', '', '', 1, 0, 'F', '0', '0', 'workflow:instance:variableQuery', '#', 103, 1, sysdate(), null, null, '');
- insert into sys_menu values ('11655', '流程变量修改', '11621', '3', '#', '', '', 1, 0, 'F', '0', '0', 'workflow:instance:variable', '#', 103, 1, sysdate(), null, null, '');
- insert into sys_menu values ('11656', '流程实例激活/挂起', '11621', '4', '#', '', '', 1, 0, 'F', '0', '0', 'workflow:instance:active', '#', 103, 1, sysdate(), null, null, '');
- insert into sys_menu values ('11657', '流程实例删除', '11621', '5', '#', '', '', 1, 0, 'F', '0', '0', 'workflow:instance:remove', '#', 103, 1, sysdate(), null, null, '');
- insert into sys_menu values ('11658', '流程实例作废', '11621', '6', '#', '', '', 1, 0, 'F', '0', '0', 'workflow:instance:invalid', '#', 103, 1, sysdate(), null, null, '');
- insert into sys_menu values ('11659', '流程实例撤销', '11621', '7', '#', '', '', 1, 0, 'F', '0', '0', 'workflow:instance:cancel', '#', 103, 1, sysdate(), null, null, '');
- -- 流程定义管理相关按钮
- insert into sys_menu values ('11644', '流程定义查询', '11620', '1', '#', '', '', 1, 0, 'F', '0', '0', 'workflow:definition:query', '#', 103, 1, sysdate(), null, null, '');
- insert into sys_menu values ('11645', '流程定义新增', '11620', '2', '#', '', '', 1, 0, 'F', '0', '0', 'workflow:definition:add', '#', 103, 1, sysdate(), null, null, '');
- insert into sys_menu values ('11646', '流程定义修改', '11620', '3', '#', '', '', 1, 0, 'F', '0', '0', 'workflow:definition:edit', '#', 103, 1, sysdate(), null, null, '');
- insert into sys_menu values ('11647', '流程定义删除', '11620', '4', '#', '', '', 1, 0, 'F', '0', '0', 'workflow:definition:remove', '#', 103, 1, sysdate(), null, null, '');
- insert into sys_menu values ('11648', '流程定义导出', '11620', '5', '#', '', '', 1, 0, 'F', '0', '0', 'workflow:definition:export', '#', 103, 1, sysdate(), null, null, '');
- insert into sys_menu values ('11649', '流程定义导入', '11620', '6', '#', '', '', 1, 0, 'F', '0', '0', 'workflow:definition:import', '#', 103, 1, sysdate(), null, null, '');
- insert into sys_menu values ('11650', '流程定义发布/取消发布', '11620', '7', '#', '', '', 1, 0, 'F', '0', '0', 'workflow:definition:publish', '#', 103, 1, sysdate(), null, null, '');
- insert into sys_menu values ('11651', '流程定义复制', '11620', '8', '#', '', '', 1, 0, 'F', '0', '0', 'workflow:definition:copy', '#', 103, 1, sysdate(), null, null, '');
- insert into sys_menu values ('11652', '流程定义激活/挂起', '11620', '9', '#', '', '', 1, 0, 'F', '0', '0', 'workflow:definition:active', '#', 103, 1, sysdate(), null, null, '');
- -- 流程表达式管理相关按钮
- INSERT INTO sys_menu VALUES ('11802', '流程达式定义查询', '11801', 1, '#', '', NULL, 1, 0, 'F', '0', '0', 'workflow:spel:query', '#', 103, 1, sysdate(), NULL, NULL, '');
- INSERT INTO sys_menu VALUES ('11803', '流程达式定义新增', '11801', 2, '#', '', NULL, 1, 0, 'F', '0', '0', 'workflow:spel:add', '#', 103, 1, sysdate(), NULL, NULL, '');
- INSERT INTO sys_menu VALUES ('11804', '流程达式定义修改', '11801', 3, '#', '', NULL, 1, 0, 'F', '0', '0', 'workflow:spel:edit', '#', 103, 1, sysdate(), NULL, NULL, '');
- INSERT INTO sys_menu VALUES ('11805', '流程达式定义删除', '11801', 4, '#', '', NULL, 1, 0, 'F', '0', '0', 'workflow:spel:remove', '#', 103, 1, sysdate(), NULL, NULL, '');
- INSERT INTO sys_menu VALUES ('11806', '流程达式定义导出', '11801', 5, '#', '', NULL, 1, 0, 'F', '0', '0', 'workflow:spel:export', '#', 103, 1, sysdate(), NULL, NULL, '');
- -- 请假测试相关按钮
- insert into sys_menu VALUES ('11638', '请假申请', 5, 1, 'leave', 'workflow/leave/index', '', 1, 0, 'C', '0', '0', 'workflow:leave:list', '#', 103, 1, sysdate(), NULL, NULL, '请假申请菜单');
- insert into sys_menu VALUES ('11639', '请假申请查询', '11638', 1, '#', '', '', 1, 0, 'F', '0', '0', 'workflow:leave:query', '#', 103, 1, sysdate(), NULL, NULL, '');
- insert into sys_menu VALUES ('11640', '请假申请新增', '11638', 2, '#', '', '', 1, 0, 'F', '0', '0', 'workflow:leave:add', '#', 103, 1, sysdate(), NULL, NULL, '');
- insert into sys_menu VALUES ('11641', '请假申请修改', '11638', 3, '#', '', '', 1, 0, 'F', '0', '0', 'workflow:leave:edit', '#', 103, 1, sysdate(), NULL, NULL, '');
- insert into sys_menu VALUES ('11642', '请假申请删除', '11638', 4, '#', '', '', 1, 0, 'F', '0', '0', 'workflow:leave:remove', '#', 103, 1, sysdate(), NULL, NULL, '');
- insert into sys_menu VALUES ('11643', '请假申请导出', '11638', 5, '#', '', '', 1, 0, 'F', '0', '0', 'workflow:leave:export', '#', 103, 1, sysdate(), NULL, NULL, '');
- INSERT INTO sys_dict_type VALUES (13, '000000', '业务状态', 'wf_business_status', 103, 1, sysdate(), NULL, NULL, '业务状态列表');
- INSERT INTO sys_dict_type VALUES (14, '000000', '表单类型', 'wf_form_type', 103, 1, sysdate(), NULL, NULL, '表单类型列表');
- INSERT INTO sys_dict_type VALUES (15, '000000', '任务状态', 'wf_task_status', 103, 1, sysdate(), NULL, NULL, '任务状态');
- INSERT INTO sys_dict_data VALUES (39, '000000', 1, '已撤销', 'cancel', 'wf_business_status', '', 'danger', 'N', 103, 1, sysdate(), NULL, NULL,'已撤销');
- INSERT INTO sys_dict_data VALUES (40, '000000', 2, '草稿', 'draft', 'wf_business_status', '', 'info', 'N', 103, 1, sysdate(), NULL, NULL, '草稿');
- INSERT INTO sys_dict_data VALUES (41, '000000', 3, '待审核', 'waiting', 'wf_business_status', '', 'primary', 'N', 103, 1, sysdate(), NULL, NULL,'待审核');
- INSERT INTO sys_dict_data VALUES (42, '000000', 4, '已完成', 'finish', 'wf_business_status', '', 'success', 'N', 103, 1, sysdate(), NULL, NULL,'已完成');
- INSERT INTO sys_dict_data VALUES (43, '000000', 5, '已作废', 'invalid', 'wf_business_status', '', 'danger', 'N', 103, 1, sysdate(), NULL, NULL,'已作废');
- INSERT INTO sys_dict_data VALUES (44, '000000', 6, '已退回', 'back', 'wf_business_status', '', 'danger', 'N', 103, 1, sysdate(), NULL, NULL,'已退回');
- INSERT INTO sys_dict_data VALUES (45, '000000', 7, '已终止', 'termination', 'wf_business_status', '', 'danger', 'N', 103, 1, sysdate(), NULL,NULL, '已终止');
- INSERT INTO sys_dict_data VALUES (46, '000000', 1, '自定义表单', 'static', 'wf_form_type', '', 'success', 'N', 103, 1, sysdate(), NULL, NULL,'自定义表单');
- INSERT INTO sys_dict_data VALUES (47, '000000', 2, '动态表单', 'dynamic', 'wf_form_type', '', 'primary', 'N', 103, 1, sysdate(), NULL, NULL,'动态表单');
- INSERT INTO sys_dict_data VALUES (48, '000000', 1, '撤销', 'cancel', 'wf_task_status', '', 'danger', 'N', 103, 1, sysdate(), NULL, NULL, '撤销');
- INSERT INTO sys_dict_data VALUES (49, '000000', 2, '通过', 'pass', 'wf_task_status', '', 'success', 'N', 103, 1, sysdate(), NULL, NULL, '通过');
- INSERT INTO sys_dict_data VALUES (50, '000000', 3, '待审核', 'waiting', 'wf_task_status', '', 'primary', 'N', 103, 1, sysdate(), NULL, NULL, '待审核');
- INSERT INTO sys_dict_data VALUES (51, '000000', 4, '作废', 'invalid', 'wf_task_status', '', 'danger', 'N', 103, 1, sysdate(), NULL, NULL, '作废');
- INSERT INTO sys_dict_data VALUES (52, '000000', 5, '退回', 'back', 'wf_task_status', '', 'danger', 'N', 103, 1, sysdate(), NULL, NULL, '退回');
- INSERT INTO sys_dict_data VALUES (53, '000000', 6, '终止', 'termination', 'wf_task_status', '', 'danger', 'N', 103, 1, sysdate(), NULL, NULL, '终止');
- INSERT INTO sys_dict_data VALUES (54, '000000', 7, '转办', 'transfer', 'wf_task_status', '', 'primary', 'N', 103, 1, sysdate(), NULL, NULL, '转办');
- INSERT INTO sys_dict_data VALUES (55, '000000', 8, '委托', 'depute', 'wf_task_status', '', 'primary', 'N', 103, 1, sysdate(), NULL, NULL, '委托');
- INSERT INTO sys_dict_data VALUES (56, '000000', 9, '抄送', 'copy', 'wf_task_status', '', 'primary', 'N', 103, 1, sysdate(), NULL, NULL, '抄送');
- INSERT INTO sys_dict_data VALUES (57, '000000', 10, '加签', 'sign', 'wf_task_status', '', 'primary', 'N', 103, 1, sysdate(), NULL, NULL, '加签');
- INSERT INTO sys_dict_data VALUES (58, '000000', 11, '减签', 'sign_off', 'wf_task_status', '', 'danger', 'N', 103, 1, sysdate(), NULL, NULL, '减签');
- INSERT INTO sys_dict_data VALUES (59, '000000', 11, '超时', 'timeout', 'wf_task_status', '', 'danger', 'N', 103, 1, sysdate(), NULL, NULL, '超时');
- -- ============================================================
- -- 风控业务模块
- -- ============================================================
- -- 风控模块建表语句
- -- ----------------------------
- -- 风控规则表
- -- ----------------------------
- drop table if exists risk_rule;
- create table risk_rule (
- rule_id bigint(20) not null auto_increment comment '规则ID',
- rule_name varchar(100) not null comment '规则名称',
- rule_code varchar(64) not null comment '规则编码',
- rule_type varchar(20) not null comment '规则类型(1交易规则 2登录规则 3设备规则 4行为规则)',
- rule_desc varchar(500) default null comment '规则描述',
- rule_script text default null comment '规则脚本/条件',
- risk_level varchar(20) not null comment '风险等级(1低风险 2中风险 3高风险 4极高风险)',
- rule_score decimal(10,2) default 0.00 comment '规则分值',
- action_type varchar(20) not null comment '触发动作(1预警 2拦截 3人工审核 4记录日志)',
- status char(1) default '0' comment '规则状态(0正常 1停用)',
- priority int(11) default 0 comment '优先级',
- del_flag char(1) default '0' comment '删除标志(0代表存在 1代表删除)',
- remark varchar(500) default null comment '备注',
- create_by bigint(20) default null comment '创建者',
- create_time datetime default null comment '创建时间',
- update_by bigint(20) default null comment '更新者',
- update_time datetime default null comment '更新时间',
- primary key (rule_id),
- unique key uk_rule_code (rule_code)
- ) engine=innodb auto_increment=1 DEFAULT CHARSET=utf8mb4 comment = '风控规则表';
- -- ----------------------------
- -- 风控事件表
- -- ----------------------------
- drop table if exists risk_event;
- create table risk_event (
- event_id bigint(20) not null auto_increment comment '事件ID',
- event_no varchar(64) not null comment '事件编号',
- event_type varchar(20) not null comment '事件类型',
- event_source varchar(50) default null comment '事件来源',
- user_id bigint(20) default null comment '用户ID',
- user_name varchar(50) default null comment '用户名称',
- device_id varchar(100) default null comment '设备ID',
- ip_address varchar(50) default null comment 'IP地址',
- location varchar(100) default null comment '地理位置',
- event_data text default null comment '事件数据',
- risk_level varchar(20) default null comment '风险等级',
- risk_score decimal(10,2) default 0.00 comment '风险分值',
- hit_rules varchar(500) default null comment '命中规则',
- action_taken varchar(20) default null comment '已执行动作',
- status char(1) default '0' comment '状态(0待处理 1已处理 2已忽略)',
- remark varchar(500) default null comment '备注',
- event_time datetime default null comment '事件发生时间',
- del_flag char(1) default '0' comment '删除标志(0代表存在 1代表删除)',
- create_by bigint(20) default null comment '创建者',
- create_time datetime default null comment '创建时间',
- update_by bigint(20) default null comment '更新者',
- update_time datetime default null comment '更新时间',
- primary key (event_id),
- unique key uk_event_no (event_no)
- ) engine=innodb auto_increment=1 DEFAULT CHARSET=utf8mb4 comment = '风控事件表';
- -- ----------------------------
- -- 风控案例表
- -- ----------------------------
- drop table if exists risk_case;
- create table risk_case (
- case_id bigint(20) not null auto_increment comment '案例ID',
- case_no varchar(64) not null comment '案例编号',
- case_name varchar(100) not null comment '案例名称',
- case_type varchar(20) not null comment '案例类型',
- case_desc text default null comment '案例描述',
- event_id bigint(20) default null comment '关联事件ID',
- event_no varchar(64) default null comment '关联事件编号',
- user_id bigint(20) default null comment '用户ID',
- user_name varchar(50) default null comment '用户名称',
- risk_level varchar(20) default null comment '风险等级',
- risk_score decimal(10,2) default 0.00 comment '风险分值',
- hit_rules varchar(500) default null comment '命中规则',
- case_result varchar(20) default null comment '案例结果',
- status char(1) default '0' comment '状态(0待处理 1已处理 2已归档)',
- remark varchar(500) default null comment '备注',
- del_flag char(1) default '0' comment '删除标志(0代表存在 1代表删除)',
- create_by bigint(20) default null comment '创建者',
- create_time datetime default null comment '创建时间',
- update_by bigint(20) default null comment '更新者',
- update_time datetime default null comment '更新时间',
- primary key (case_id),
- unique key uk_case_no (case_no)
- ) engine=innodb auto_increment=1 DEFAULT CHARSET=utf8mb4 comment = '风控案例表';
- -- ----------------------------
- -- 黑名单表
- -- ----------------------------
- drop table if exists risk_blacklist;
- create table risk_blacklist (
- black_id bigint(20) not null auto_increment comment '黑名单ID',
- black_type varchar(20) not null comment '黑名单类型(1IP 2手机号 3设备 4用户 5邮箱)',
- black_value varchar(200) not null comment '黑名单值',
- black_name varchar(100) default null comment '黑名单名称',
- reason varchar(500) default null comment '加入原因',
- source varchar(50) default null comment '来源',
- expire_time datetime default null comment '过期时间',
- status char(1) default '0' comment '状态(0正常 1停用)',
- remark varchar(500) default null comment '备注',
- del_flag char(1) default '0' comment '删除标志(0代表存在 1代表删除)',
- create_by bigint(20) default null comment '创建者',
- create_time datetime default null comment '创建时间',
- update_by bigint(20) default null comment '更新者',
- update_time datetime default null comment '更新时间',
- primary key (black_id),
- unique key uk_black_value (black_type, black_value)
- ) engine=innodb auto_increment=1 DEFAULT CHARSET=utf8mb4 comment = '黑名单表';
- -- ----------------------------
- -- 白名单表
- -- ----------------------------
- drop table if exists risk_whitelist;
- create table risk_whitelist (
- white_id bigint(20) not null auto_increment comment '白名单ID',
- white_type varchar(20) not null comment '白名单类型(1IP 2手机号 3设备 4用户 5邮箱)',
- white_value varchar(200) not null comment '白名单值',
- white_name varchar(100) default null comment '白名单名称',
- reason varchar(500) default null comment '加入原因',
- source varchar(50) default null comment '来源',
- expire_time datetime default null comment '过期时间',
- status char(1) default '0' comment '状态(0正常 1停用)',
- remark varchar(500) default null comment '备注',
- del_flag char(1) default '0' comment '删除标志(0代表存在 1代表删除)',
- create_by bigint(20) default null comment '创建者',
- create_time datetime default null comment '创建时间',
- update_by bigint(20) default null comment '更新者',
- update_time datetime default null comment '更新时间',
- primary key (white_id),
- unique key uk_white_value (white_type, white_value)
- ) engine=innodb auto_increment=1 DEFAULT CHARSET=utf8mb4 comment = '白名单表';
- -- ----------------------------
- -- 风险评分表
- -- ----------------------------
- drop table if exists risk_score;
- create table risk_score (
- score_id bigint(20) not null auto_increment comment '评分ID',
- score_no varchar(64) not null comment '评分编号',
- user_id bigint(20) default null comment '用户ID',
- user_name varchar(50) default null comment '用户名称',
- score_type varchar(20) default null comment '评分类型',
- total_score decimal(10,2) default 0.00 comment '总分',
- base_score decimal(10,2) default 0.00 comment '基础分',
- rule_score decimal(10,2) default 0.00 comment '规则分',
- behavior_score decimal(10,2) default 0.00 comment '行为分',
- credit_score decimal(10,2) default 0.00 comment '信用分',
- risk_level varchar(20) default null comment '风险等级',
- evaluation text default null comment '评估说明',
- status char(1) default '0' comment '状态(0正常 1失效)',
- remark varchar(500) default null comment '备注',
- evaluate_time datetime default null comment '评估时间',
- del_flag char(1) default '0' comment '删除标志(0代表存在 1代表删除)',
- create_by bigint(20) default null comment '创建者',
- create_time datetime default null comment '创建时间',
- update_by bigint(20) default null comment '更新者',
- update_time datetime default null comment '更新时间',
- primary key (score_id),
- unique key uk_score_no (score_no)
- ) engine=innodb auto_increment=1 DEFAULT CHARSET=utf8mb4 comment = '风险评分表';
|