ry_20210210.sql 64 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089
  1. -- ----------------------------
  2. -- 1、部门表
  3. -- ----------------------------
  4. create sequence seq_sys_dept
  5. increment by 1
  6. start with 200
  7. nomaxvalue
  8. nominvalue
  9. cache 20;
  10. create table sys_dept (
  11. dept_id number(20) not null,
  12. parent_id number(20) default 0,
  13. ancestors varchar2(50) default '',
  14. dept_name varchar2(30) default '',
  15. order_num number(4) default 0,
  16. leader varchar2(20) default null,
  17. phone varchar2(11) default null,
  18. email varchar2(50) default null,
  19. status char(1) default '0',
  20. del_flag char(1) default '0',
  21. create_by varchar2(64) default '',
  22. create_time date,
  23. update_by varchar2(64) default '',
  24. update_time date
  25. );
  26. alter table sys_dept add constraint pk_sys_dept primary key (dept_id);
  27. comment on table sys_dept is '部门信息表';
  28. comment on column sys_dept.dept_id is '部门主键seq_sys_dept.nextval';
  29. comment on column sys_dept.parent_id is '父部门id';
  30. comment on column sys_dept.ancestors is '祖级列表';
  31. comment on column sys_dept.dept_name is '部门名称';
  32. comment on column sys_dept.order_num is '显示顺序';
  33. comment on column sys_dept.leader is '负责人';
  34. comment on column sys_dept.phone is '联系电话';
  35. comment on column sys_dept.email is '邮箱';
  36. comment on column sys_dept.status is '部门状态(0正常 1停用)';
  37. comment on column sys_dept.del_flag is '删除标志(0代表存在 2代表删除)';
  38. comment on column sys_dept.create_by is '创建者';
  39. comment on column sys_dept.create_time is '创建时间';
  40. comment on column sys_dept.update_by is '更新者';
  41. comment on column sys_dept.update_time is '更新时间';
  42. -- ----------------------------
  43. -- 初始化-部门表数据
  44. -- ----------------------------
  45. insert into sys_dept values(100, 0, '0', '若依科技', 0, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate, '', null);
  46. insert into sys_dept values(101, 100, '0,100', '深圳总公司', 1, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate, '', null);
  47. insert into sys_dept values(102, 100, '0,100', '长沙分公司', 2, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate, '', null);
  48. insert into sys_dept values(103, 101, '0,100,101', '研发部门', 1, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate, '', null);
  49. insert into sys_dept values(104, 101, '0,100,101', '市场部门', 2, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate, '', null);
  50. insert into sys_dept values(105, 101, '0,100,101', '测试部门', 3, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate, '', null);
  51. insert into sys_dept values(106, 101, '0,100,101', '财务部门', 4, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate, '', null);
  52. insert into sys_dept values(107, 101, '0,100,101', '运维部门', 5, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate, '', null);
  53. insert into sys_dept values(108, 102, '0,100,102', '市场部门', 1, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate, '', null);
  54. insert into sys_dept values(109, 102, '0,100,102', '财务部门', 2, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate, '', null);
  55. -- ----------------------------
  56. -- 2、用户信息表
  57. -- ----------------------------
  58. create sequence seq_sys_user
  59. increment by 1
  60. start with 100
  61. nomaxvalue
  62. nominvalue
  63. cache 20;
  64. create table sys_user (
  65. user_id number(20) not null,
  66. dept_id number(20) default null,
  67. login_name varchar2(30) not null,
  68. user_name varchar2(30) default '',
  69. user_type varchar2(2) default '00',
  70. email varchar2(50) default '',
  71. phonenumber varchar2(11) default '',
  72. sex char(1) default '0',
  73. avatar varchar2(100) default '',
  74. password varchar2(50) default '',
  75. salt varchar2(20) default '',
  76. status char(1) default '0',
  77. del_flag char(1) default '0',
  78. login_ip varchar2(128) default '',
  79. login_date date,
  80. pwd_update_date date,
  81. create_by varchar2(64),
  82. create_time date,
  83. update_by varchar2(64) default '',
  84. update_time date,
  85. remark varchar2(500) default ''
  86. );
  87. alter table sys_user add constraint pk_sys_user primary key (user_id);
  88. comment on table sys_user is '用户信息表';
  89. comment on column sys_user.user_id is '用户主键seq_sys_user.nextval';
  90. comment on column sys_user.dept_id is '部门ID';
  91. comment on column sys_user.login_name is '登录账号';
  92. comment on column sys_user.user_name is '用户昵称';
  93. comment on column sys_user.user_type is '用户类型(00系统用户 01注册用户)';
  94. comment on column sys_user.email is '用户邮箱';
  95. comment on column sys_user.phonenumber is '手机号码';
  96. comment on column sys_user.sex is '用户性别(0男 1女 2未知)';
  97. comment on column sys_user.avatar is '头像路径';
  98. comment on column sys_user.password is '密码';
  99. comment on column sys_user.salt is '盐加密';
  100. comment on column sys_user.status is '帐号状态(0正常 1停用)';
  101. comment on column sys_user.del_flag is '删除标志(0代表存在 2代表删除)';
  102. comment on column sys_user.login_ip is '最后登录IP';
  103. comment on column sys_user.login_date is '最后登录时间';
  104. comment on column sys_user.pwd_update_date is '密码最后更新时间';
  105. comment on column sys_user.create_by is '创建者';
  106. comment on column sys_user.create_time is '创建时间';
  107. comment on column sys_user.update_by is '更新者';
  108. comment on column sys_user.update_time is '更新时间';
  109. comment on column sys_user.remark is '备注';
  110. -- ----------------------------
  111. -- 初始化-用户信息表数据
  112. -- ----------------------------
  113. insert into sys_user values(1, 103, 'admin', '若依', '00', 'ry@163.com', '15888888888', '1', '', '29c67a30398638269fe600f73a054934', '111111', '0', '0', '127.0.0.1', sysdate, sysdate, 'admin', sysdate, '', null, '管理员');
  114. insert into sys_user values(2, 105, 'ry', '若依', '00', 'ry@qq.com', '15666666666', '1', '', '8e6d98b90472783cc73c17047ddccf36', '222222', '0', '0', '127.0.0.1', sysdate, sysdate, 'admin', sysdate, '', null, '测试员');
  115. -- ----------------------------
  116. -- 3、岗位信息表
  117. -- ----------------------------
  118. create sequence seq_sys_post
  119. increment by 1
  120. start with 10
  121. nomaxvalue
  122. nominvalue
  123. cache 20;
  124. create table sys_post
  125. (
  126. post_id number(20) not null,
  127. post_code varchar2(64) not null,
  128. post_name varchar2(50) not null,
  129. post_sort number(4) not null,
  130. status char(1) not null,
  131. create_by varchar2(64) default '',
  132. create_time date,
  133. update_by varchar2(64) default '',
  134. update_time date,
  135. remark varchar2(500)
  136. );
  137. alter table sys_post add constraint pk_sys_post primary key (post_id);
  138. comment on table sys_post is '岗位信息表';
  139. comment on column sys_post.post_id is '岗位主键seq_sys_post.nextval';
  140. comment on column sys_post.post_code is '岗位编码';
  141. comment on column sys_post.post_name is '岗位名称';
  142. comment on column sys_post.post_sort is '显示顺序';
  143. comment on column sys_post.status is '状态(0正常 1停用)';
  144. comment on column sys_post.create_by is '创建者';
  145. comment on column sys_post.create_time is '创建时间';
  146. comment on column sys_post.update_by is '更新者';
  147. comment on column sys_post.update_time is '更新时间';
  148. comment on column sys_post.remark is '备注';
  149. -- ----------------------------
  150. -- 初始化-岗位信息表数据
  151. -- ----------------------------
  152. insert into sys_post values(1, 'ceo', '董事长', 1, '0', 'admin', sysdate, '', null, '');
  153. insert into sys_post values(2, 'se', '项目经理', 2, '0', 'admin', sysdate, '', null, '');
  154. insert into sys_post values(3, 'hr', '人力资源', 3, '0', 'admin', sysdate, '', null, '');
  155. insert into sys_post values(4, 'user', '普通员工', 4, '0', 'admin', sysdate, '', null, '');
  156. -- ----------------------------
  157. -- 4、角色信息表
  158. -- ----------------------------
  159. create sequence seq_sys_role
  160. increment by 1
  161. start with 100
  162. nomaxvalue
  163. nominvalue
  164. cache 20;
  165. create table sys_role (
  166. role_id number(20) not null,
  167. role_name varchar2(30) not null,
  168. role_key varchar2(100) not null,
  169. role_sort number(4) not null,
  170. data_scope char(1) default '1',
  171. status char(1) not null,
  172. del_flag char(1) default '0',
  173. create_by varchar2(64) default '',
  174. create_time date,
  175. update_by varchar2(64) default '',
  176. update_time date,
  177. remark varchar2(500) default null
  178. );
  179. alter table sys_role add constraint pk_sys_role primary key (role_id);
  180. comment on table sys_role is '角色信息表';
  181. comment on column sys_role.role_id is '角色主键seq_sys_post.nextval';
  182. comment on column sys_role.role_name is '角色名称';
  183. comment on column sys_role.role_key is '角色权限字符串';
  184. comment on column sys_role.role_sort is '显示顺序';
  185. comment on column sys_role.data_scope is '数据范围(1:全部数据权限 2:自定数据权限)';
  186. comment on column sys_role.status is '角色状态(0正常 1停用)';
  187. comment on column sys_role.del_flag is '删除标志(0代表存在 2代表删除)';
  188. comment on column sys_role.create_by is '创建者';
  189. comment on column sys_role.create_time is '创建时间';
  190. comment on column sys_role.update_by is '更新者';
  191. comment on column sys_role.update_time is '更新时间';
  192. comment on column sys_role.remark is '备注';
  193. -- ----------------------------
  194. -- 初始化-角色信息表数据
  195. -- ----------------------------
  196. insert into sys_role values('1', '超级管理员', 'admin', 1, 1, '0', '0', 'admin', sysdate, '', null, '超级管理员');
  197. insert into sys_role values('2', '普通角色', 'common', 2, 2, '0', '0', 'admin', sysdate, '', null, '普通角色');
  198. -- ----------------------------
  199. -- 5、菜单权限表
  200. -- ----------------------------
  201. create sequence seq_sys_menu
  202. increment by 1
  203. start with 2000
  204. nomaxvalue
  205. nominvalue
  206. cache 20;
  207. create table sys_menu (
  208. menu_id number(20) not null,
  209. menu_name varchar2(50) not null,
  210. parent_id number(20) default 0,
  211. order_num number(4) default 0,
  212. url varchar2(200) default '#',
  213. target varchar2(20) default '',
  214. menu_type char(1) default '',
  215. visible char(1) default 0,
  216. is_refresh char(1) default 1,
  217. perms varchar2(100) default null,
  218. icon varchar2(100) default '#',
  219. create_by varchar2(64) default '',
  220. create_time date,
  221. update_by varchar2(64) default '',
  222. update_time date ,
  223. remark varchar2(500) default ''
  224. );
  225. alter table sys_menu add constraint pk_sys_menu primary key (menu_id);
  226. comment on table sys_menu is '菜单权限表';
  227. comment on column sys_menu.menu_id is '菜单主键seq_sys_post.nextval';
  228. comment on column sys_menu.menu_name is '菜单名称';
  229. comment on column sys_menu.parent_id is '父菜单ID';
  230. comment on column sys_menu.order_num is '显示顺序';
  231. comment on column sys_menu.url is '请求地址';
  232. comment on column sys_menu.target is '打开方式(menuItem页签 menuBlank新窗口)';
  233. comment on column sys_menu.menu_type is '菜单类型(M目录 C菜单 F按钮)';
  234. comment on column sys_menu.visible is '菜单状态(0显示 1隐藏)';
  235. comment on column sys_menu.is_refresh is '是否刷新(0刷新 1不刷新)';
  236. comment on column sys_menu.perms is '权限标识';
  237. comment on column sys_menu.icon is '菜单图标';
  238. comment on column sys_menu.create_by is '创建者';
  239. comment on column sys_menu.create_time is '创建时间';
  240. comment on column sys_menu.update_by is '更新者';
  241. comment on column sys_menu.update_time is '更新时间';
  242. comment on column sys_menu.remark is '备注';
  243. -- ----------------------------
  244. -- 初始化-菜单信息表数据
  245. -- ----------------------------
  246. -- 一级菜单
  247. insert into sys_menu values('1', '系统管理', '0', '1', '#', '', 'M', '0', '1', '', 'fa fa-gear', 'admin', sysdate, '', null, '系统管理目录');
  248. insert into sys_menu values('2', '系统监控', '0', '2', '#', '', 'M', '0', '1', '', 'fa fa-video-camera', 'admin', sysdate, '', null, '系统监控目录');
  249. insert into sys_menu values('3', '系统工具', '0', '3', '#', '', 'M', '0', '1', '', 'fa fa-bars', 'admin', sysdate, '', null, '系统工具目录');
  250. insert into sys_menu values('4', '若依官网', '0', '4', 'http://ruoyi.vip', 'menuBlank', 'C', '0', '1', '', 'fa fa-location-arrow', 'admin', sysdate, '', null, '若依官网地址');
  251. -- 二级菜单
  252. insert into sys_menu values('100', '用户管理', '1', '1', '/system/user', '', 'C', '0', '1', 'system:user:view', 'fa fa-user-o', 'admin', sysdate, '', null, '用户管理菜单');
  253. insert into sys_menu values('101', '角色管理', '1', '2', '/system/role', '', 'C', '0', '1', 'system:role:view', 'fa fa-user-secret', 'admin', sysdate, '', null, '角色管理菜单');
  254. insert into sys_menu values('102', '菜单管理', '1', '3', '/system/menu', '', 'C', '0', '1', 'system:menu:view', 'fa fa-th-list', 'admin', sysdate, '', null, '菜单管理菜单');
  255. insert into sys_menu values('103', '部门管理', '1', '4', '/system/dept', '', 'C', '0', '1', 'system:dept:view', 'fa fa-outdent', 'admin', sysdate, '', null, '部门管理菜单');
  256. insert into sys_menu values('104', '岗位管理', '1', '5', '/system/post', '', 'C', '0', '1', 'system:post:view', 'fa fa-address-card-o', 'admin', sysdate, '', null, '岗位管理菜单');
  257. insert into sys_menu values('105', '字典管理', '1', '6', '/system/dict', '', 'C', '0', '1', 'system:dict:view', 'fa fa-bookmark-o', 'admin', sysdate, '', null, '字典管理菜单');
  258. insert into sys_menu values('106', '参数设置', '1', '7', '/system/config', '', 'C', '0', '1', 'system:config:view', 'fa fa-sun-o', 'admin', sysdate, '', null, '参数设置菜单');
  259. insert into sys_menu values('107', '通知公告', '1', '8', '/system/notice', '', 'C', '0', '1', 'system:notice:view', 'fa fa-bullhorn', 'admin', sysdate, '', null, '通知公告菜单');
  260. insert into sys_menu values('108', '日志管理', '1', '9', '#', '', 'M', '0', '1', '', 'fa fa-pencil-square-o', 'admin', sysdate, '', null, '日志管理菜单');
  261. insert into sys_menu values('109', '在线用户', '2', '1', '/monitor/online', '', 'C', '0', '1', 'monitor:online:view', 'fa fa-user-circle', 'admin', sysdate, '', null, '在线用户菜单');
  262. insert into sys_menu values('110', '定时任务', '2', '2', '/monitor/job', '', 'C', '0', '1', 'monitor:job:view', 'fa fa-tasks', 'admin', sysdate, '', null, '定时任务菜单');
  263. insert into sys_menu values('111', '数据监控', '2', '3', '/monitor/data', '', 'C', '0', '1', 'monitor:data:view', 'fa fa-bug', 'admin', sysdate, '', null, '数据监控菜单');
  264. insert into sys_menu values('112', '服务监控', '2', '4', '/monitor/server', '', 'C', '0', '1', 'monitor:server:view', 'fa fa-server', 'admin', sysdate, '', null, '服务监控菜单');
  265. insert into sys_menu values('113', '缓存监控', '2', '5', '/monitor/cache', '', 'C', '0', '1', 'monitor:cache:view', 'fa fa-cube', 'admin', sysdate, '', null, '缓存监控菜单');
  266. insert into sys_menu values('114', '表单构建', '3', '1', '/tool/build', '', 'C', '0', '1', 'tool:build:view', 'fa fa-wpforms', 'admin', sysdate, '', null, '表单构建菜单');
  267. insert into sys_menu values('115', '代码生成', '3', '2', '/tool/gen', '', 'C', '0', '1', 'tool:gen:view', 'fa fa-code', 'admin', sysdate, '', null, '代码生成菜单');
  268. insert into sys_menu values('116', '系统接口', '3', '3', '/tool/swagger', '', 'C', '0', '1', 'tool:swagger:view', 'fa fa-gg', 'admin', sysdate, '', null, '系统接口菜单');
  269. -- 三级菜单
  270. insert into sys_menu values('500', '操作日志', '108', '1', '/monitor/operlog', '', 'C', '0', '1', 'monitor:operlog:view', 'fa fa-address-book', 'admin', sysdate, '', null, '操作日志菜单');
  271. insert into sys_menu values('501', '登录日志', '108', '2', '/monitor/logininfor', '', 'C', '0', '1', 'monitor:logininfor:view', 'fa fa-file-image-o', 'admin', sysdate, '', null, '登录日志菜单');
  272. -- 用户管理按钮
  273. insert into sys_menu values('1000', '用户查询', '100', '1', '#', '', 'F', '0', '1', 'system:user:list', '#', 'admin', sysdate, '', null, '');
  274. insert into sys_menu values('1001', '用户新增', '100', '2', '#', '', 'F', '0', '1', 'system:user:add', '#', 'admin', sysdate, '', null, '');
  275. insert into sys_menu values('1002', '用户修改', '100', '3', '#', '', 'F', '0', '1', 'system:user:edit', '#', 'admin', sysdate, '', null, '');
  276. insert into sys_menu values('1003', '用户删除', '100', '4', '#', '', 'F', '0', '1', 'system:user:remove', '#', 'admin', sysdate, '', null, '');
  277. insert into sys_menu values('1004', '用户导出', '100', '5', '#', '', 'F', '0', '1', 'system:user:export', '#', 'admin', sysdate, '', null, '');
  278. insert into sys_menu values('1005', '用户导入', '100', '6', '#', '', 'F', '0', '1', 'system:user:import', '#', 'admin', sysdate, '', null, '');
  279. insert into sys_menu values('1006', '重置密码', '100', '7', '#', '', 'F', '0', '1', 'system:user:resetPwd', '#', 'admin', sysdate, '', null, '');
  280. -- 角色管理按钮
  281. insert into sys_menu values('1007', '角色查询', '101', '1', '#', '', 'F', '0', '1', 'system:role:list', '#', 'admin', sysdate, '', null, '');
  282. insert into sys_menu values('1008', '角色新增', '101', '2', '#', '', 'F', '0', '1', 'system:role:add', '#', 'admin', sysdate, '', null, '');
  283. insert into sys_menu values('1009', '角色修改', '101', '3', '#', '', 'F', '0', '1', 'system:role:edit', '#', 'admin', sysdate, '', null, '');
  284. insert into sys_menu values('1010', '角色删除', '101', '4', '#', '', 'F', '0', '1', 'system:role:remove', '#', 'admin', sysdate, '', null, '');
  285. insert into sys_menu values('1011', '角色导出', '101', '5', '#', '', 'F', '0', '1', 'system:role:export', '#', 'admin', sysdate, '', null, '');
  286. -- 菜单管理按钮
  287. insert into sys_menu values('1012', '菜单查询', '102', '1', '#', '', 'F', '0', '1', 'system:menu:list', '#', 'admin', sysdate, '', null, '');
  288. insert into sys_menu values('1013', '菜单新增', '102', '2', '#', '', 'F', '0', '1', 'system:menu:add', '#', 'admin', sysdate, '', null, '');
  289. insert into sys_menu values('1014', '菜单修改', '102', '3', '#', '', 'F', '0', '1', 'system:menu:edit', '#', 'admin', sysdate, '', null, '');
  290. insert into sys_menu values('1015', '菜单删除', '102', '4', '#', '', 'F', '0', '1', 'system:menu:remove', '#', 'admin', sysdate, '', null, '');
  291. -- 部门管理按钮
  292. insert into sys_menu values('1016', '部门查询', '103', '1', '#', '', 'F', '0', '1', 'system:dept:list', '#', 'admin', sysdate, '', null, '');
  293. insert into sys_menu values('1017', '部门新增', '103', '2', '#', '', 'F', '0', '1', 'system:dept:add', '#', 'admin', sysdate, '', null, '');
  294. insert into sys_menu values('1018', '部门修改', '103', '3', '#', '', 'F', '0', '1', 'system:dept:edit', '#', 'admin', sysdate, '', null, '');
  295. insert into sys_menu values('1019', '部门删除', '103', '4', '#', '', 'F', '0', '1', 'system:dept:remove', '#', 'admin', sysdate, '', null, '');
  296. -- 岗位管理按钮
  297. insert into sys_menu values('1020', '岗位查询', '104', '1', '#', '', 'F', '0', '1', 'system:post:list', '#', 'admin', sysdate, '', null, '');
  298. insert into sys_menu values('1021', '岗位新增', '104', '2', '#', '', 'F', '0', '1', 'system:post:add', '#', 'admin', sysdate, '', null, '');
  299. insert into sys_menu values('1022', '岗位修改', '104', '3', '#', '', 'F', '0', '1', 'system:post:edit', '#', 'admin', sysdate, '', null, '');
  300. insert into sys_menu values('1023', '岗位删除', '104', '4', '#', '', 'F', '0', '1', 'system:post:remove', '#', 'admin', sysdate, '', null, '');
  301. insert into sys_menu values('1024', '岗位导出', '104', '5', '#', '', 'F', '0', '1', 'system:post:export', '#', 'admin', sysdate, '', null, '');
  302. -- 字典管理按钮
  303. insert into sys_menu values('1025', '字典查询', '105', '1', '#', '', 'F', '0', '1', 'system:dict:list', '#', 'admin', sysdate, '', null, '');
  304. insert into sys_menu values('1026', '字典新增', '105', '2', '#', '', 'F', '0', '1', 'system:dict:add', '#', 'admin', sysdate, '', null, '');
  305. insert into sys_menu values('1027', '字典修改', '105', '3', '#', '', 'F', '0', '1', 'system:dict:edit', '#', 'admin', sysdate, '', null, '');
  306. insert into sys_menu values('1028', '字典删除', '105', '4', '#', '', 'F', '0', '1', 'system:dict:remove', '#', 'admin', sysdate, '', null, '');
  307. insert into sys_menu values('1029', '字典导出', '105', '5', '#', '', 'F', '0', '1', 'system:dict:export', '#', 'admin', sysdate, '', null, '');
  308. -- 参数设置按钮
  309. insert into sys_menu values('1030', '参数查询', '106', '1', '#', '', 'F', '0', '1', 'system:config:list', '#', 'admin', sysdate, '', null, '');
  310. insert into sys_menu values('1031', '参数新增', '106', '2', '#', '', 'F', '0', '1', 'system:config:add', '#', 'admin', sysdate, '', null, '');
  311. insert into sys_menu values('1032', '参数修改', '106', '3', '#', '', 'F', '0', '1', 'system:config:edit', '#', 'admin', sysdate, '', null, '');
  312. insert into sys_menu values('1033', '参数删除', '106', '4', '#', '', 'F', '0', '1', 'system:config:remove', '#', 'admin', sysdate, '', null, '');
  313. insert into sys_menu values('1034', '参数导出', '106', '5', '#', '', 'F', '0', '1', 'system:config:export', '#', 'admin', sysdate, '', null, '');
  314. -- 通知公告按钮
  315. insert into sys_menu values('1035', '公告查询', '107', '1', '#', '', 'F', '0', '1', 'system:notice:list', '#', 'admin', sysdate, '', null, '');
  316. insert into sys_menu values('1036', '公告新增', '107', '2', '#', '', 'F', '0', '1', 'system:notice:add', '#', 'admin', sysdate, '', null, '');
  317. insert into sys_menu values('1037', '公告修改', '107', '3', '#', '', 'F', '0', '1', 'system:notice:edit', '#', 'admin', sysdate, '', null, '');
  318. insert into sys_menu values('1038', '公告删除', '107', '4', '#', '', 'F', '0', '1', 'system:notice:remove', '#', 'admin', sysdate, '', null, '');
  319. -- 操作日志按钮
  320. insert into sys_menu values('1039', '操作查询', '500', '1', '#', '', 'F', '0', '1', 'monitor:operlog:list', '#', 'admin', sysdate, '', null, '');
  321. insert into sys_menu values('1040', '操作删除', '500', '2', '#', '', 'F', '0', '1', 'monitor:operlog:remove', '#', 'admin', sysdate, '', null, '');
  322. insert into sys_menu values('1041', '详细信息', '500', '3', '#', '', 'F', '0', '1', 'monitor:operlog:detail', '#', 'admin', sysdate, '', null, '');
  323. insert into sys_menu values('1042', '日志导出', '500', '4', '#', '', 'F', '0', '1', 'monitor:operlog:export', '#', 'admin', sysdate, '', null, '');
  324. -- 登录日志按钮
  325. insert into sys_menu values('1043', '登录查询', '501', '1', '#', '', 'F', '0', '1', 'monitor:logininfor:list', '#', 'admin', sysdate, '', null, '');
  326. insert into sys_menu values('1044', '登录删除', '501', '2', '#', '', 'F', '0', '1', 'monitor:logininfor:remove', '#', 'admin', sysdate, '', null, '');
  327. insert into sys_menu values('1045', '日志导出', '501', '3', '#', '', 'F', '0', '1', 'monitor:logininfor:export', '#', 'admin', sysdate, '', null, '');
  328. insert into sys_menu values('1046', '账户解锁', '501', '4', '#', '', 'F', '0', '1', 'monitor:logininfor:unlock', '#', 'admin', sysdate, '', null, '');
  329. -- 在线用户按钮
  330. insert into sys_menu values('1047', '在线查询', '109', '1', '#', '', 'F', '0', '1', 'monitor:online:list', '#', 'admin', sysdate, '', null, '');
  331. insert into sys_menu values('1048', '批量强退', '109', '2', '#', '', 'F', '0', '1', 'monitor:online:batchForceLogout', '#', 'admin', sysdate, '', null, '');
  332. insert into sys_menu values('1049', '单条强退', '109', '3', '#', '', 'F', '0', '1', 'monitor:online:forceLogout', '#', 'admin', sysdate, '', null, '');
  333. -- 定时任务按钮
  334. insert into sys_menu values('1050', '任务查询', '110', '1', '#', '', 'F', '0', '1', 'monitor:job:list', '#', 'admin', sysdate, '', null, '');
  335. insert into sys_menu values('1051', '任务新增', '110', '2', '#', '', 'F', '0', '1', 'monitor:job:add', '#', 'admin', sysdate, '', null, '');
  336. insert into sys_menu values('1052', '任务修改', '110', '3', '#', '', 'F', '0', '1', 'monitor:job:edit', '#', 'admin', sysdate, '', null, '');
  337. insert into sys_menu values('1053', '任务删除', '110', '4', '#', '', 'F', '0', '1', 'monitor:job:remove', '#', 'admin', sysdate, '', null, '');
  338. insert into sys_menu values('1054', '状态修改', '110', '5', '#', '', 'F', '0', '1', 'monitor:job:changeStatus', '#', 'admin', sysdate, '', null, '');
  339. insert into sys_menu values('1055', '任务详细', '110', '6', '#', '', 'F', '0', '1', 'monitor:job:detail', '#', 'admin', sysdate, '', null, '');
  340. insert into sys_menu values('1056', '任务导出', '110', '7', '#', '', 'F', '0', '1', 'monitor:job:export', '#', 'admin', sysdate, '', null, '');
  341. -- 代码生成按钮
  342. insert into sys_menu values('1057', '生成查询', '115', '1', '#', '', 'F', '0', '1', 'tool:gen:list', '#', 'admin', sysdate, '', null, '');
  343. insert into sys_menu values('1058', '生成修改', '115', '2', '#', '', 'F', '0', '1', 'tool:gen:edit', '#', 'admin', sysdate, '', null, '');
  344. insert into sys_menu values('1059', '生成删除', '115', '3', '#', '', 'F', '0', '1', 'tool:gen:remove', '#', 'admin', sysdate, '', null, '');
  345. insert into sys_menu values('1060', '预览代码', '115', '4', '#', '', 'F', '0', '1', 'tool:gen:preview', '#', 'admin', sysdate, '', null, '');
  346. insert into sys_menu values('1061', '生成代码', '115', '5', '#', '', 'F', '0', '1', 'tool:gen:code', '#', 'admin', sysdate, '', null, '');
  347. -- ----------------------------
  348. -- 6、用户和角色关联表 用户N-1角色
  349. -- ----------------------------
  350. create table sys_user_role (
  351. user_id number(20) not null,
  352. role_id number(20) not null
  353. );
  354. alter table sys_user_role add constraint pk_sys_user_role primary key (user_id, role_id);
  355. comment on table sys_user_role is '用户和角色关联表';
  356. comment on column sys_user_role.user_id is '用户ID';
  357. comment on column sys_user_role.role_id is '角色ID';
  358. -- ----------------------------
  359. -- 初始化-用户和角色关联表数据
  360. -- ----------------------------
  361. insert into sys_user_role values ('1', '1');
  362. insert into sys_user_role values ('2', '2');
  363. -- ----------------------------
  364. -- 7、角色和菜单关联表 角色1-N菜单
  365. -- ----------------------------
  366. create table sys_role_menu (
  367. role_id number(20) not null,
  368. menu_id number(20) not null
  369. );
  370. alter table sys_role_menu add constraint pk_sys_role_menu primary key (role_id, menu_id);
  371. comment on table sys_role_menu is '角色和菜单关联表';
  372. comment on column sys_role_menu.role_id is '角色ID';
  373. comment on column sys_role_menu.menu_id is '菜单ID';
  374. -- ----------------------------
  375. -- 初始化-角色和菜单关联表数据
  376. -- ----------------------------
  377. insert into sys_role_menu values ('2', '1');
  378. insert into sys_role_menu values ('2', '2');
  379. insert into sys_role_menu values ('2', '3');
  380. insert into sys_role_menu values ('2', '4');
  381. insert into sys_role_menu values ('2', '100');
  382. insert into sys_role_menu values ('2', '101');
  383. insert into sys_role_menu values ('2', '102');
  384. insert into sys_role_menu values ('2', '103');
  385. insert into sys_role_menu values ('2', '104');
  386. insert into sys_role_menu values ('2', '105');
  387. insert into sys_role_menu values ('2', '106');
  388. insert into sys_role_menu values ('2', '107');
  389. insert into sys_role_menu values ('2', '108');
  390. insert into sys_role_menu values ('2', '109');
  391. insert into sys_role_menu values ('2', '110');
  392. insert into sys_role_menu values ('2', '111');
  393. insert into sys_role_menu values ('2', '112');
  394. insert into sys_role_menu values ('2', '113');
  395. insert into sys_role_menu values ('2', '114');
  396. insert into sys_role_menu values ('2', '115');
  397. insert into sys_role_menu values ('2', '116');
  398. insert into sys_role_menu values ('2', '500');
  399. insert into sys_role_menu values ('2', '501');
  400. insert into sys_role_menu values ('2', '1000');
  401. insert into sys_role_menu values ('2', '1001');
  402. insert into sys_role_menu values ('2', '1002');
  403. insert into sys_role_menu values ('2', '1003');
  404. insert into sys_role_menu values ('2', '1004');
  405. insert into sys_role_menu values ('2', '1005');
  406. insert into sys_role_menu values ('2', '1006');
  407. insert into sys_role_menu values ('2', '1007');
  408. insert into sys_role_menu values ('2', '1008');
  409. insert into sys_role_menu values ('2', '1009');
  410. insert into sys_role_menu values ('2', '1010');
  411. insert into sys_role_menu values ('2', '1011');
  412. insert into sys_role_menu values ('2', '1012');
  413. insert into sys_role_menu values ('2', '1013');
  414. insert into sys_role_menu values ('2', '1014');
  415. insert into sys_role_menu values ('2', '1015');
  416. insert into sys_role_menu values ('2', '1016');
  417. insert into sys_role_menu values ('2', '1017');
  418. insert into sys_role_menu values ('2', '1018');
  419. insert into sys_role_menu values ('2', '1019');
  420. insert into sys_role_menu values ('2', '1020');
  421. insert into sys_role_menu values ('2', '1021');
  422. insert into sys_role_menu values ('2', '1022');
  423. insert into sys_role_menu values ('2', '1023');
  424. insert into sys_role_menu values ('2', '1024');
  425. insert into sys_role_menu values ('2', '1025');
  426. insert into sys_role_menu values ('2', '1026');
  427. insert into sys_role_menu values ('2', '1027');
  428. insert into sys_role_menu values ('2', '1028');
  429. insert into sys_role_menu values ('2', '1029');
  430. insert into sys_role_menu values ('2', '1030');
  431. insert into sys_role_menu values ('2', '1031');
  432. insert into sys_role_menu values ('2', '1032');
  433. insert into sys_role_menu values ('2', '1033');
  434. insert into sys_role_menu values ('2', '1034');
  435. insert into sys_role_menu values ('2', '1035');
  436. insert into sys_role_menu values ('2', '1036');
  437. insert into sys_role_menu values ('2', '1037');
  438. insert into sys_role_menu values ('2', '1038');
  439. insert into sys_role_menu values ('2', '1039');
  440. insert into sys_role_menu values ('2', '1040');
  441. insert into sys_role_menu values ('2', '1041');
  442. insert into sys_role_menu values ('2', '1042');
  443. insert into sys_role_menu values ('2', '1043');
  444. insert into sys_role_menu values ('2', '1044');
  445. insert into sys_role_menu values ('2', '1045');
  446. insert into sys_role_menu values ('2', '1046');
  447. insert into sys_role_menu values ('2', '1047');
  448. insert into sys_role_menu values ('2', '1048');
  449. insert into sys_role_menu values ('2', '1049');
  450. insert into sys_role_menu values ('2', '1050');
  451. insert into sys_role_menu values ('2', '1051');
  452. insert into sys_role_menu values ('2', '1052');
  453. insert into sys_role_menu values ('2', '1053');
  454. insert into sys_role_menu values ('2', '1054');
  455. insert into sys_role_menu values ('2', '1055');
  456. insert into sys_role_menu values ('2', '1056');
  457. insert into sys_role_menu values ('2', '1057');
  458. insert into sys_role_menu values ('2', '1058');
  459. insert into sys_role_menu values ('2', '1059');
  460. insert into sys_role_menu values ('2', '1060');
  461. insert into sys_role_menu values ('2', '1061');
  462. -- ----------------------------
  463. -- 8、角色和部门关联表 角色1-N部门
  464. -- ----------------------------
  465. create table sys_role_dept (
  466. role_id number(20) not null,
  467. dept_id number(20) not null
  468. );
  469. alter table sys_role_dept add constraint pk_sys_role_dept primary key (role_id, dept_id);
  470. comment on table sys_role_dept is '角色和部门关联表';
  471. comment on column sys_role_dept.role_id is '角色ID';
  472. comment on column sys_role_dept.dept_id is '部门ID';
  473. -- ----------------------------
  474. -- 初始化-角色和部门关联表数据
  475. -- ----------------------------
  476. insert into sys_role_dept values ('2', '100');
  477. insert into sys_role_dept values ('2', '101');
  478. insert into sys_role_dept values ('2', '105');
  479. -- ----------------------------
  480. -- 9、用户与岗位关联表 用户1-N岗位
  481. -- ----------------------------
  482. create table sys_user_post
  483. (
  484. user_id number(20) not null,
  485. post_id number(20) not null
  486. );
  487. alter table sys_user_post add constraint pk_sys_user_post primary key (user_id, post_id);
  488. comment on table sys_user_post is '用户与岗位关联表';
  489. comment on column sys_user_post.user_id is '用户ID';
  490. comment on column sys_user_post.post_id is '岗位ID';
  491. -- ----------------------------
  492. -- 初始化-用户与岗位关联表数据
  493. -- ----------------------------
  494. insert into sys_user_post values ('1', '1');
  495. insert into sys_user_post values ('2', '2');
  496. -- ----------------------------
  497. -- 10、操作日志记录
  498. -- ----------------------------
  499. create sequence seq_sys_oper_log
  500. increment by 1
  501. start with 100
  502. nomaxvalue
  503. nominvalue
  504. cache 20;
  505. create table sys_oper_log (
  506. oper_id number(20) not null ,
  507. title varchar2(50) default '',
  508. business_type number(2) default 0,
  509. method varchar2(100) default '',
  510. request_method varchar(10) default '',
  511. operator_type number(1) default 0,
  512. oper_name varchar2(50) default '',
  513. dept_name varchar2(50) default '',
  514. oper_url varchar2(255) default '',
  515. oper_ip varchar2(128) default '',
  516. oper_location varchar2(255) default '',
  517. oper_param varchar2(2000) default '',
  518. json_result varchar2(2000) default '',
  519. status number(1) default 0,
  520. error_msg varchar2(2000) default '' ,
  521. oper_time date
  522. );
  523. alter table sys_oper_log add constraint pk_sys_oper_log primary key (oper_id);
  524. comment on table sys_oper_log is '操作日志记录';
  525. comment on column sys_oper_log.oper_id is '日志主键seq_sys_oper_log.nextval';
  526. comment on column sys_oper_log.title is '模块标题';
  527. comment on column sys_oper_log.business_type is '业务类型(0其它 1新增 2修改 3删除)';
  528. comment on column sys_oper_log.method is '方法名称';
  529. comment on column sys_oper_log.request_method is '请求方式';
  530. comment on column sys_oper_log.operator_type is '操作类别(0其它 1后台用户 2手机端用户)';
  531. comment on column sys_oper_log.oper_name is '操作人员';
  532. comment on column sys_oper_log.dept_name is '部门名称';
  533. comment on column sys_oper_log.oper_url is '请求URL';
  534. comment on column sys_oper_log.oper_ip is '主机地址';
  535. comment on column sys_oper_log.oper_location is '操作地点';
  536. comment on column sys_oper_log.oper_param is '请求参数';
  537. comment on column sys_oper_log.json_result is '返回参数';
  538. comment on column sys_oper_log.status is '操作状态(0正常 1异常)';
  539. comment on column sys_oper_log.error_msg is '错误消息';
  540. comment on column sys_oper_log.oper_time is '操作时间';
  541. -- ----------------------------
  542. -- 11、字典类型表
  543. -- ----------------------------
  544. create sequence seq_sys_dict_type
  545. increment by 1
  546. start with 100
  547. nomaxvalue
  548. nominvalue
  549. cache 20;
  550. create table sys_dict_type
  551. (
  552. dict_id number(20) not null,
  553. dict_name varchar2(100) default '',
  554. dict_type varchar2(100) default '',
  555. status char(1) default '0',
  556. create_by varchar2(64) default '',
  557. create_time date,
  558. update_by varchar2(64) default '',
  559. update_time date,
  560. remark varchar2(500) default null
  561. );
  562. alter table sys_dict_type add constraint pk_sys_dict_type primary key (dict_id);
  563. create unique index sys_dict_type_index1 on sys_dict_type (dict_type);
  564. comment on table sys_dict_type is '字典类型表';
  565. comment on column sys_dict_type.dict_id is '字典主键seq_sys_dict_type.nextval';
  566. comment on column sys_dict_type.dict_name is '字典名称';
  567. comment on column sys_dict_type.dict_type is '字典类型';
  568. comment on column sys_dict_type.status is '状态(0正常 1停用)';
  569. comment on column sys_dict_type.create_by is '创建者';
  570. comment on column sys_dict_type.create_time is '创建时间';
  571. comment on column sys_dict_type.update_by is '更新者';
  572. comment on column sys_dict_type.update_time is '更新时间';
  573. comment on column sys_dict_type.remark is '备注';
  574. insert into sys_dict_type values(1, '用户性别', 'sys_user_sex', '0', 'admin', sysdate, '', null, '用户性别列表');
  575. insert into sys_dict_type values(2, '菜单状态', 'sys_show_hide', '0', 'admin', sysdate, '', null, '菜单状态列表');
  576. insert into sys_dict_type values(3, '系统开关', 'sys_normal_disable', '0', 'admin', sysdate, '', null, '系统开关列表');
  577. insert into sys_dict_type values(4, '任务状态', 'sys_job_status', '0', 'admin', sysdate, '', null, '任务状态列表');
  578. insert into sys_dict_type values(5, '任务分组', 'sys_job_group', '0', 'admin', sysdate, '', null, '任务分组列表');
  579. insert into sys_dict_type values(6, '系统是否', 'sys_yes_no', '0', 'admin', sysdate, '', null, '系统是否列表');
  580. insert into sys_dict_type values(7, '通知类型', 'sys_notice_type', '0', 'admin', sysdate, '', null, '通知类型列表');
  581. insert into sys_dict_type values(8, '通知状态', 'sys_notice_status', '0', 'admin', sysdate, '', null, '通知状态列表');
  582. insert into sys_dict_type values(9, '操作类型', 'sys_oper_type', '0', 'admin', sysdate, '', null, '操作类型列表');
  583. insert into sys_dict_type values(10, '系统状态', 'sys_common_status', '0', 'admin', sysdate, '', null, '登录状态列表');
  584. -- ----------------------------
  585. -- 12、字典数据表
  586. -- ----------------------------
  587. create sequence seq_sys_dict_data
  588. increment by 1
  589. start with 100
  590. nomaxvalue
  591. nominvalue
  592. cache 20;
  593. create table sys_dict_data
  594. (
  595. dict_code number(20) not null,
  596. dict_sort number(4) default 0,
  597. dict_label varchar2(100) default '',
  598. dict_value varchar2(100) default '',
  599. dict_type varchar2(100) default '',
  600. css_class varchar2(100) default null,
  601. list_class varchar2(100) default null,
  602. is_default char(1) default 'N',
  603. status char(1) default '0',
  604. create_by varchar2(64) default '',
  605. create_time date,
  606. update_by varchar2(64) default '',
  607. update_time date,
  608. remark varchar2(500) default null
  609. );
  610. alter table sys_dict_data add constraint pk_sys_dict_data primary key (dict_code);
  611. comment on table sys_dict_data is '字典数据表';
  612. comment on column sys_dict_data.dict_code is '字典主键seq_sys_dict_data.nextval';
  613. comment on column sys_dict_data.dict_sort is '字典排序';
  614. comment on column sys_dict_data.dict_label is '字典标签';
  615. comment on column sys_dict_data.dict_value is '字典键值';
  616. comment on column sys_dict_data.dict_type is '字典类型';
  617. comment on column sys_dict_data.css_class is '样式属性(其他样式扩展)';
  618. comment on column sys_dict_data.list_class is '表格回显样式';
  619. comment on column sys_dict_data.is_default is '是否默认(Y是 N否)';
  620. comment on column sys_dict_data.status is '状态(0正常 1停用)';
  621. comment on column sys_dict_data.create_by is '创建者';
  622. comment on column sys_dict_data.create_time is '创建时间';
  623. comment on column sys_dict_data.update_by is '更新者';
  624. comment on column sys_dict_data.update_time is '更新时间';
  625. comment on column sys_dict_data.remark is '备注';
  626. insert into sys_dict_data values(1, 1, '男', '0', 'sys_user_sex', '', '', 'Y', '0', 'admin', sysdate, '', null, '性别男');
  627. insert into sys_dict_data values(2, 2, '女', '1', 'sys_user_sex', '', '', 'N', '0', 'admin', sysdate, '', null, '性别女');
  628. insert into sys_dict_data values(3, 3, '未知', '2', 'sys_user_sex', '', '', 'N', '0', 'admin', sysdate, '', null, '性别未知');
  629. insert into sys_dict_data values(4, 1, '显示', '0', 'sys_show_hide', '', 'primary', 'Y', '0', 'admin', sysdate, '', null, '显示菜单');
  630. insert into sys_dict_data values(5, 2, '隐藏', '1', 'sys_show_hide', '', 'danger', 'N', '0', 'admin', sysdate, '', null, '隐藏菜单');
  631. insert into sys_dict_data values(6, 1, '正常', '0', 'sys_normal_disable', '', 'primary', 'Y', '0', 'admin', sysdate, '', null, '正常状态');
  632. insert into sys_dict_data values(7, 2, '停用', '1', 'sys_normal_disable', '', 'danger', 'N', '0', 'admin', sysdate, '', null, '停用状态');
  633. insert into sys_dict_data values(8, 1, '正常', '0', 'sys_job_status', '', 'primary', 'Y', '0', 'admin', sysdate, '', null, '正常状态');
  634. insert into sys_dict_data values(9, 2, '暂停', '1', 'sys_job_status', '', 'danger', 'N', '0', 'admin', sysdate, '', null, '停用状态');
  635. insert into sys_dict_data values(10, 1, '默认', 'DEFAULT', 'sys_job_group', '', '', 'Y', '0', 'admin', sysdate, '', null, '默认分组');
  636. insert into sys_dict_data values(11, 2, '系统', 'SYSTEM', 'sys_job_group', '', '', 'N', '0', 'admin', sysdate, '', null, '系统分组');
  637. insert into sys_dict_data values(12, 1, '是', 'Y', 'sys_yes_no', '', 'primary', 'Y', '0', 'admin', sysdate, '', null, '系统默认是');
  638. insert into sys_dict_data values(13, 2, '否', 'N', 'sys_yes_no', '', 'danger', 'N', '0', 'admin', sysdate, '', null, '系统默认否');
  639. insert into sys_dict_data values(14, 1, '通知', '1', 'sys_notice_type', '', 'warning', 'Y', '0', 'admin', sysdate, '', null, '通知');
  640. insert into sys_dict_data values(15, 2, '公告', '2', 'sys_notice_type', '', 'success', 'N', '0', 'admin', sysdate, '', null, '公告');
  641. insert into sys_dict_data values(16, 1, '正常', '0', 'sys_notice_status', '', 'primary', 'Y', '0', 'admin', sysdate, '', null, '正常状态');
  642. insert into sys_dict_data values(17, 2, '关闭', '1', 'sys_notice_status', '', 'danger', 'N', '0', 'admin', sysdate, '', null, '关闭状态');
  643. insert into sys_dict_data values(18, 99, '其他', '0', 'sys_oper_type', '', 'info', 'N', '0', 'admin', sysdate, '', null, '其他操作');
  644. insert into sys_dict_data values(19, 1, '新增', '1', 'sys_oper_type', '', 'info', 'N', '0', 'admin', sysdate, '', null, '新增操作');
  645. insert into sys_dict_data values(20, 2, '修改', '2', 'sys_oper_type', '', 'info', 'N', '0', 'admin', sysdate, '', null, '修改操作');
  646. insert into sys_dict_data values(21, 3, '删除', '3', 'sys_oper_type', '', 'danger', 'N', '0', 'admin', sysdate, '', null, '删除操作');
  647. insert into sys_dict_data values(22, 4, '授权', '4', 'sys_oper_type', '', 'primary', 'N', '0', 'admin', sysdate, '', null, '授权操作');
  648. insert into sys_dict_data values(23, 5, '导出', '5', 'sys_oper_type', '', 'warning', 'N', '0', 'admin', sysdate, '', null, '导出操作');
  649. insert into sys_dict_data values(24, 6, '导入', '6', 'sys_oper_type', '', 'warning', 'N', '0', 'admin', sysdate, '', null, '导入操作');
  650. insert into sys_dict_data values(25, 7, '强退', '7', 'sys_oper_type', '', 'danger', 'N', '0', 'admin', sysdate, '', null, '强退操作');
  651. insert into sys_dict_data values(26, 8, '生成代码', '8', 'sys_oper_type', '', 'warning', 'N', '0', 'admin', sysdate, '', null, '生成操作');
  652. insert into sys_dict_data values(27, 9, '清空数据', '9', 'sys_oper_type', '', 'danger', 'N', '0', 'admin', sysdate, '', null, '清空操作');
  653. insert into sys_dict_data values(28, 1, '成功', '0', 'sys_common_status', '', 'primary', 'N', '0', 'admin', sysdate, '', null, '正常状态');
  654. insert into sys_dict_data values(29, 2, '失败', '1', 'sys_common_status', '', 'danger', 'N', '0', 'admin', sysdate, '', null, '停用状态');
  655. -- ----------------------------
  656. -- 13、参数配置表
  657. -- ----------------------------
  658. create sequence seq_sys_config
  659. increment by 1
  660. start with 100
  661. nomaxvalue
  662. nominvalue
  663. cache 20;
  664. create table sys_config (
  665. config_id number(20) not null,
  666. config_name varchar2(100) default '',
  667. config_key varchar2(100) default '',
  668. config_value varchar2(100) default '',
  669. config_type char(1) default 'N',
  670. create_by varchar2(64) default '',
  671. create_time date,
  672. update_by varchar2(64) default '',
  673. update_time date,
  674. remark varchar2(500) default null
  675. );
  676. alter table sys_config add constraint pk_sys_config primary key (config_id);
  677. comment on table sys_config is '参数配置表';
  678. comment on column sys_config.config_id is '参数主键seq_sys_config.nextval';
  679. comment on column sys_config.config_name is '参数名称';
  680. comment on column sys_config.config_key is '参数键名';
  681. comment on column sys_config.config_value is '参数键值';
  682. comment on column sys_config.config_type is '系统内置(Y是 N否)';
  683. comment on column sys_config.create_by is '创建者';
  684. comment on column sys_config.create_time is '创建时间';
  685. comment on column sys_config.update_by is '更新者';
  686. comment on column sys_config.update_time is '更新时间';
  687. comment on column sys_config.remark is '备注';
  688. insert into sys_config values(1, '主框架页-默认皮肤样式名称', 'sys.index.skinName', 'skin-blue', 'Y', 'admin', sysdate, '', null, '蓝色 skin-blue、绿色 skin-green、紫色 skin-purple、红色 skin-red、黄色 skin-yellow');
  689. insert into sys_config values(2, '用户管理-账号初始密码', 'sys.user.initPassword', '123456', 'Y', 'admin', sysdate, '', null, '初始化密码 123456');
  690. insert into sys_config values(3, '主框架页-侧边栏主题', 'sys.index.sideTheme', 'theme-dark', 'Y', 'admin', sysdate, '', null, '深黑主题theme-dark,浅色主题theme-light,深蓝主题theme-blue');
  691. insert into sys_config values(4, '账号自助-是否开启用户注册功能', 'sys.account.registerUser', 'false', 'Y', 'admin', sysdate, '', null, '是否开启注册用户功能(true开启,false关闭)');
  692. insert into sys_config values(5, '用户管理-密码字符范围', 'sys.account.chrtype', '0', 'Y', 'admin', sysdate, '', null, '默认任意字符范围,0任意(密码可以输入任意字符),1数字(密码只能为0-9数字),2英文字母(密码只能为a-z和A-Z字母),3字母和数字(密码必须包含字母,数字),4字母数字和特殊字符(目前支持的特殊字符包括:~!@#$%^&*()-=_+)');
  693. insert into sys_config values(6, '用户管理-初始密码修改策略', 'sys.account.initPasswordModify', '0', 'Y', 'admin', sysdate, '', null, '0:初始密码修改策略关闭,没有任何提示,1:提醒用户,如果未修改初始密码,则在登录时就会提醒修改密码对话框');
  694. insert into sys_config values(7, '用户管理-账号密码更新周期', 'sys.account.passwordValidateDays', '0', 'Y', 'admin', sysdate, '', null, '密码更新周期(填写数字,数据初始化值为0不限制,若修改必须为大于0小于365的正整数),如果超过这个周期登录系统时,则在登录时就会提醒修改密码对话框');
  695. insert into sys_config values(8, '主框架页-菜单导航显示风格', 'sys.index.menuStyle', 'default', 'Y', 'admin', sysdate, '', null, '菜单导航显示风格(default为左侧导航菜单,topnav为顶部导航菜单)');
  696. insert into sys_config values(9, '主框架页-是否开启页脚', 'sys.index.ignoreFooter', 'true', 'Y', 'admin', sysdate, '', null, '是否开启底部页脚显示(true显示,false隐藏)');
  697. -- ----------------------------
  698. -- 14、系统访问记录
  699. -- ----------------------------
  700. create sequence seq_sys_logininfor
  701. increment by 1
  702. start with 100
  703. nomaxvalue
  704. nominvalue
  705. cache 20;
  706. create table sys_logininfor (
  707. info_id number(20) not null,
  708. login_name varchar2(50) default '',
  709. ipaddr varchar2(128) default '',
  710. login_location varchar2(255) default '',
  711. browser varchar2(50) default '',
  712. os varchar2(50) default '',
  713. status char(1) default '0',
  714. msg varchar2(255) default '',
  715. login_time date
  716. );
  717. alter table sys_logininfor add constraint pk_sys_logininfor primary key (info_id);
  718. comment on table sys_logininfor is '系统访问记录';
  719. comment on column sys_logininfor.info_id is '访问主键seq_seq_sys_logininfor.nextval';
  720. comment on column sys_logininfor.login_name is '登录账号';
  721. comment on column sys_logininfor.ipaddr is '登录IP地址';
  722. comment on column sys_logininfor.login_location is '登录地点';
  723. comment on column sys_logininfor.browser is '浏览器类型';
  724. comment on column sys_logininfor.os is '操作系统';
  725. comment on column sys_logininfor.status is '登录状态(0成功 1失败)';
  726. comment on column sys_logininfor.msg is '提示消息';
  727. comment on column sys_logininfor.login_time is '访问时间';
  728. -- ----------------------------
  729. -- 15、在线用户记录
  730. -- ----------------------------
  731. create table sys_user_online (
  732. sessionId varchar2(50) default '',
  733. login_name varchar2(50) default '',
  734. dept_name varchar2(50) default '',
  735. ipaddr varchar2(128) default '',
  736. login_location varchar2(255) default '',
  737. browser varchar2(50) default '',
  738. os varchar2(50) default '',
  739. status varchar2(10) default '',
  740. start_timestamp date,
  741. last_access_time date,
  742. expire_time number(10) default 0
  743. );
  744. alter table sys_user_online add constraint pk_sys_user_online primary key (sessionId);
  745. comment on table sys_user_online is '在线用户记录';
  746. comment on column sys_user_online.sessionId is '用户会话id';
  747. comment on column sys_user_online.login_name is '登录账号';
  748. comment on column sys_user_online.dept_name is '部门名称';
  749. comment on column sys_user_online.ipaddr is '登录IP地址';
  750. comment on column sys_user_online.login_location is '登录地点';
  751. comment on column sys_user_online.browser is '浏览器类型';
  752. comment on column sys_user_online.os is '操作系统';
  753. comment on column sys_user_online.status is '在线状态on_line在线off_line离线';
  754. comment on column sys_user_online.start_timestamp is 'session创建时间';
  755. comment on column sys_user_online.last_access_time is 'session最后访问时间';
  756. comment on column sys_user_online.expire_time is '超时时间,单位为分钟';
  757. -- ----------------------------
  758. -- 16、定时任务调度表
  759. -- ----------------------------
  760. create sequence seq_sys_job
  761. increment by 1
  762. start with 100
  763. nomaxvalue
  764. nominvalue
  765. cache 20;
  766. create table sys_job (
  767. job_id number(20) not null,
  768. job_name varchar2(64) default '',
  769. job_group varchar2(64) default '',
  770. invoke_target varchar2(500) not null ,
  771. cron_expression varchar2(255) default '',
  772. misfire_policy varchar2(20) default '3',
  773. concurrent char(1) default '1',
  774. status char(1) default '0',
  775. create_by varchar2(64) default '',
  776. create_time date,
  777. update_by varchar2(64) default '',
  778. update_time date,
  779. remark varchar2(500) default ''
  780. );
  781. alter table sys_job add constraint pk_sys_job primary key (job_id, job_name, job_group);
  782. comment on table sys_job is '定时任务调度表';
  783. comment on column sys_job.job_id is '任务主键seq_sys_job.nextval';
  784. comment on column sys_job.job_name is '任务名称';
  785. comment on column sys_job.job_group is '任务组名';
  786. comment on column sys_job.invoke_target is '调用目标字符串';
  787. comment on column sys_job.cron_expression is 'cron执行表达式';
  788. comment on column sys_job.misfire_policy is '计划执行错误策略(1立即执行 2执行一次 3放弃执行)';
  789. comment on column sys_job.concurrent is '是否并发执行(0允许 1禁止)';
  790. comment on column sys_job.status is '状态(0正常 1暂停)';
  791. comment on column sys_job.create_by is '创建者';
  792. comment on column sys_job.create_time is '创建时间';
  793. comment on column sys_job.update_by is '更新者';
  794. comment on column sys_job.update_time is '更新时间';
  795. comment on column sys_job.remark is '备注信息';
  796. insert into sys_job values(1, '系统默认(无参)', 'DEFAULT', 'ryTask.ryNoParams', '0/10 * * * * ?', '3', '1', '1', 'admin', sysdate, '', null, '');
  797. insert into sys_job values(2, '系统默认(有参)', 'DEFAULT', 'ryTask.ryParams(''ry'')', '0/15 * * * * ?', '3', '1', '1', 'admin', sysdate, '', null, '');
  798. insert into sys_job values(3, '系统默认(多参)', 'DEFAULT', 'ryTask.ryMultipleParams(''ry'', true, 2000L, 316.50D, 100)', '0/20 * * * * ?', '3', '1', '1', 'admin', sysdate, '', null, '');
  799. -- ----------------------------
  800. -- 17、定时任务调度日志表
  801. -- ----------------------------
  802. create sequence seq_sys_job_log
  803. increment by 1
  804. start with 1
  805. nomaxvalue
  806. nominvalue
  807. cache 20;
  808. create table sys_job_log (
  809. job_log_id number(20) not null,
  810. job_name varchar2(64) not null,
  811. job_group varchar2(64) not null,
  812. invoke_target varchar2(500) not null ,
  813. job_message varchar2(500),
  814. status char(1) default '0',
  815. exception_info varchar2(2000) default '',
  816. create_time date
  817. );
  818. alter table sys_job_log add constraint pk_sys_job_log primary key (job_log_id);
  819. comment on table sys_job_log is '定时任务调度日志表';
  820. comment on column sys_job_log.job_log_id is '日志主键seq_sys_job_log.nextval';
  821. comment on column sys_job_log.job_name is '任务名称';
  822. comment on column sys_job_log.job_group is '任务组名';
  823. comment on column sys_job_log.invoke_target is '调用目标字符串';
  824. comment on column sys_job_log.job_message is '日志信息';
  825. comment on column sys_job_log.status is '执行状态(0正常 1失败)';
  826. comment on column sys_job_log.exception_info is '异常信息';
  827. comment on column sys_job_log.create_time is '创建时间';
  828. -- ----------------------------
  829. -- 18、通知公告表
  830. -- ----------------------------
  831. create sequence seq_sys_notice
  832. increment by 1
  833. start with 100
  834. nomaxvalue
  835. nominvalue
  836. cache 20;
  837. create table sys_notice (
  838. notice_id number(20) not null,
  839. notice_title varchar2(50) not null,
  840. notice_type char(1) not null,
  841. notice_content varchar2(2000) default null,
  842. status char(1) default '0',
  843. create_by varchar2(64) default '',
  844. create_time date,
  845. update_by varchar2(64) default '',
  846. update_time date,
  847. remark varchar2(255) default null
  848. );
  849. alter table sys_notice add constraint pk_sys_notice primary key (notice_id);
  850. comment on table sys_notice is '通知公告表';
  851. comment on column sys_notice.notice_id is '公告主键seq_sys_notice.nextval';
  852. comment on column sys_notice.notice_title is '公告标题';
  853. comment on column sys_notice.notice_type is '公告类型(1通知 2公告)';
  854. comment on column sys_notice.notice_content is '公告内容';
  855. comment on column sys_notice.status is '公告状态(0正常 1关闭)';
  856. comment on column sys_notice.create_by is '创建者';
  857. comment on column sys_notice.create_time is '创建时间';
  858. comment on column sys_notice.update_by is '更新者';
  859. comment on column sys_notice.update_time is '更新时间';
  860. comment on column sys_notice.remark is '备注';
  861. -- ----------------------------
  862. -- 初始化-公告信息表数据
  863. -- ----------------------------
  864. insert into sys_notice values('1', '温馨提醒:2018-07-01 若依新版本发布啦', '2', '新版本内容', '0', 'admin', sysdate, '', null, '管理员');
  865. insert into sys_notice values('2', '维护通知:2018-07-01 若依系统凌晨维护', '1', '维护内容', '0', 'admin', sysdate, '', null, '管理员');
  866. commit;
  867. -- ----------------------------
  868. -- 19、代码生成业务表
  869. -- ----------------------------
  870. create sequence seq_gen_table
  871. increment by 1
  872. start with 100
  873. nomaxvalue
  874. nominvalue
  875. cache 20;
  876. create table gen_table (
  877. table_id number(20) not null,
  878. table_name varchar2(200) default '',
  879. table_comment varchar2(500) default '',
  880. sub_table_name varchar(64) default null,
  881. sub_table_fk_name varchar(64) default null,
  882. class_name varchar2(100) default '',
  883. tpl_category varchar2(200) default 'crud',
  884. package_name varchar2(100),
  885. module_name varchar2(30),
  886. business_name varchar2(30),
  887. function_name varchar2(50),
  888. function_author varchar2(50),
  889. gen_type char(1) default '0',
  890. gen_path varchar2(200) default '/',
  891. options varchar2(1000),
  892. create_by varchar2(64) default '',
  893. create_time date,
  894. update_by varchar2(64) default '',
  895. update_time date,
  896. remark varchar2(500) default null
  897. );
  898. alter table gen_table add constraint pk_gen_table primary key (table_id);
  899. comment on table gen_table is '代码生成业务表';
  900. comment on column gen_table.table_id is '编号';
  901. comment on column gen_table.table_name is '表名称';
  902. comment on column gen_table.table_comment is '表描述';
  903. comment on column gen_table.sub_table_name is '关联子表的表名';
  904. comment on column gen_table.sub_table_fk_name is '子表关联的外键名';
  905. comment on column gen_table.class_name is '实体类名称';
  906. comment on column gen_table.tpl_category is '使用的模板(crud单表操作 tree树表操作 sub主子表操作)';
  907. comment on column gen_table.package_name is '生成包路径';
  908. comment on column gen_table.module_name is '生成模块名';
  909. comment on column gen_table.business_name is '生成业务名';
  910. comment on column gen_table.function_name is '生成功能名';
  911. comment on column gen_table.function_author is '生成功能作者';
  912. comment on column gen_table.gen_type is '生成代码方式(0zip压缩包 1自定义路径)';
  913. comment on column gen_table.gen_path is '生成路径(不填默认项目路径)';
  914. comment on column gen_table.options is '其它生成选项';
  915. comment on column gen_table.create_by is '创建者';
  916. comment on column gen_table.create_time is '创建时间';
  917. comment on column gen_table.update_by is '更新者';
  918. comment on column gen_table.update_time is '更新时间';
  919. comment on column gen_table.remark is '备注';
  920. -- ----------------------------
  921. -- 20、代码生成业务表字段
  922. -- ----------------------------
  923. create sequence seq_gen_table_column
  924. increment by 1
  925. start with 100
  926. nomaxvalue
  927. nominvalue
  928. cache 20;
  929. create table gen_table_column (
  930. column_id number(20) not null,
  931. table_id varchar2(64),
  932. column_name varchar2(200),
  933. column_comment varchar2(500),
  934. column_type varchar2(100),
  935. java_type varchar2(500),
  936. java_field varchar2(200),
  937. is_pk char(1),
  938. is_increment char(1),
  939. is_required char(1),
  940. is_insert char(1),
  941. is_edit char(1),
  942. is_list char(1),
  943. is_query char(1),
  944. query_type varchar(200) default 'EQ',
  945. html_type varchar(200),
  946. dict_type varchar(200) default '',
  947. sort number(4),
  948. create_by varchar(64) default '',
  949. create_time date ,
  950. update_by varchar(64) default '',
  951. update_time date
  952. );
  953. alter table gen_table_column add constraint pk_gen_table_column primary key (column_id);
  954. comment on table gen_table_column is '代码生成业务表字段';
  955. comment on column gen_table_column.column_id is '编号';
  956. comment on column gen_table_column.table_id is '归属表编号';
  957. comment on column gen_table_column.column_name is '列名称';
  958. comment on column gen_table_column.column_comment is '列描述';
  959. comment on column gen_table_column.column_type is '列类型';
  960. comment on column gen_table_column.java_type is 'JAVA类型';
  961. comment on column gen_table_column.java_field is 'JAVA字段名';
  962. comment on column gen_table_column.is_pk is '是否主键(1是)';
  963. comment on column gen_table_column.is_increment is '是否自增(1是)';
  964. comment on column gen_table_column.is_required is '是否必填(1是)';
  965. comment on column gen_table_column.is_insert is '是否为插入字段(1是)';
  966. comment on column gen_table_column.is_edit is '是否编辑字段(1是)';
  967. comment on column gen_table_column.is_list is '是否列表字段(1是)';
  968. comment on column gen_table_column.is_query is '是否查询字段(1是)';
  969. comment on column gen_table_column.query_type is '查询方式(等于、不等于、大于、小于、范围)';
  970. comment on column gen_table_column.html_type is '显示类型(文本框、文本域、下拉框、复选框、单选框、日期控件)';
  971. comment on column gen_table_column.dict_type is '字典类型';
  972. comment on column gen_table_column.sort is '排序';
  973. comment on column gen_table_column.create_by is '创建者';
  974. comment on column gen_table_column.create_time is '创建时间';
  975. comment on column gen_table_column.update_by is '更新者';
  976. comment on column gen_table_column.update_time is '更新时间';
  977. -- ----------------------------
  978. -- 函数 ,代替mysql的find_in_set
  979. -- 例如: select * from sys_dept where FIND_IN_SET (101,ancestors) <> 0
  980. -- mysql可接受0或其它number做为where 条件,oracle只接受表达式做为where 条件
  981. -- ----------------------------
  982. create or replace function find_in_set(arg1 in varchar2,arg2 in varchar)
  983. return number is Result number;
  984. begin
  985. select instr(','||arg2||',' , ','||arg1||',') into Result from dual;
  986. return(Result);
  987. end find_in_set;