Commit 8a4d1579 by naan1993

更新sql,菜单增加一个字段pcodes

parent a1a79246
/* /*
Navicat MySQL Data Transfer Navicat MySQL Data Transfer
Source Server : 本地 Source Server : 本地
Source Server Version : 50621 Source Server Version : 50621
Source Host : localhost:3306 Source Host : localhost:3306
Source Database : guns Source Database : guns
...@@ -10,7 +10,7 @@ Target Server Type : MYSQL ...@@ -10,7 +10,7 @@ Target Server Type : MYSQL
Target Server Version : 50621 Target Server Version : 50621
File Encoding : 65001 File Encoding : 65001
Date: 2017-06-04 10:24:24 Date: 2017-06-13 21:58:58
*/ */
SET FOREIGN_KEY_CHECKS=0; SET FOREIGN_KEY_CHECKS=0;
...@@ -96,6 +96,7 @@ CREATE TABLE `menu` ( ...@@ -96,6 +96,7 @@ CREATE TABLE `menu` (
`id` int(65) NOT NULL AUTO_INCREMENT, `id` int(65) NOT NULL AUTO_INCREMENT,
`code` varchar(255) DEFAULT NULL COMMENT '菜单编号', `code` varchar(255) DEFAULT NULL COMMENT '菜单编号',
`pcode` varchar(255) DEFAULT NULL COMMENT '菜单父编号', `pcode` varchar(255) DEFAULT NULL COMMENT '菜单父编号',
`pcodes` varchar(255) DEFAULT NULL,
`name` varchar(255) DEFAULT NULL COMMENT '菜单名称', `name` varchar(255) DEFAULT NULL COMMENT '菜单名称',
`icon` varchar(255) DEFAULT NULL COMMENT '菜单图标', `icon` varchar(255) DEFAULT NULL COMMENT '菜单图标',
`url` varchar(255) DEFAULT NULL COMMENT 'url地址', `url` varchar(255) DEFAULT NULL COMMENT 'url地址',
...@@ -111,61 +112,61 @@ CREATE TABLE `menu` ( ...@@ -111,61 +112,61 @@ CREATE TABLE `menu` (
-- ---------------------------- -- ----------------------------
-- Records of menu -- Records of menu
-- ---------------------------- -- ----------------------------
INSERT INTO `menu` VALUES ('105', 'system', '0', '系统管理', 'fa-user', '', '3', '1', '1', null, '1', '1'); INSERT INTO `menu` VALUES ('105', 'system', '0', '[0],', '系统管理', 'fa-user', '', '3', '1', '1', null, '1', '1');
INSERT INTO `menu` VALUES ('106', 'mgr', 'system', '用户管理', '', '/mgr', '1', '2', '1', null, '1', '0'); INSERT INTO `menu` VALUES ('106', 'mgr', 'system', '[0],[system],', '用户管理', '', '/mgr', '1', '2', '1', null, '1', '0');
INSERT INTO `menu` VALUES ('107', 'mgr_add', 'mgr', '添加用户', null, '/mgr/add', '1', '3', '0', null, '1', '0'); INSERT INTO `menu` VALUES ('107', 'mgr_add', 'mgr', '[0],[system],[mgr],', '添加用户', null, '/mgr/add', '1', '3', '0', null, '1', '0');
INSERT INTO `menu` VALUES ('108', 'mgr_edit', 'mgr', '修改用户', null, '/mgr/edit', '2', '3', '0', null, '1', '0'); INSERT INTO `menu` VALUES ('108', 'mgr_edit', 'mgr', '[0],[system],[mgr],', '修改用户', null, '/mgr/edit', '2', '3', '0', null, '1', '0');
INSERT INTO `menu` VALUES ('109', 'mgr_delete', 'mgr', '删除用户', null, '/mgr/delete', '3', '3', '0', null, '1', '0'); INSERT INTO `menu` VALUES ('109', 'mgr_delete', 'mgr', '[0],[system],[mgr],', '删除用户', null, '/mgr/delete', '3', '3', '0', null, '1', '0');
INSERT INTO `menu` VALUES ('110', 'mgr_reset', 'mgr', '重置密码', null, '/mgr/reset', '4', '3', '0', null, '1', '0'); INSERT INTO `menu` VALUES ('110', 'mgr_reset', 'mgr', '[0],[system],[mgr],', '重置密码', null, '/mgr/reset', '4', '3', '0', null, '1', '0');
INSERT INTO `menu` VALUES ('111', 'mgr_freeze', 'mgr', '冻结用户', null, '/mgr/freeze', '5', '3', '0', null, '1', '0'); INSERT INTO `menu` VALUES ('111', 'mgr_freeze', 'mgr', '[0],[system],[mgr],', '冻结用户', null, '/mgr/freeze', '5', '3', '0', null, '1', '0');
INSERT INTO `menu` VALUES ('112', 'mgr_unfreeze', 'mgr', '解除冻结用户', null, '/mgr/unfreeze', '6', '3', '0', null, '1', '0'); INSERT INTO `menu` VALUES ('112', 'mgr_unfreeze', 'mgr', '[0],[system],[mgr],', '解除冻结用户', null, '/mgr/unfreeze', '6', '3', '0', null, '1', '0');
INSERT INTO `menu` VALUES ('113', 'mgr_setRole', 'mgr', '分配角色', null, '/mgr/setRole', '7', '3', '0', null, '1', '0'); INSERT INTO `menu` VALUES ('113', 'mgr_setRole', 'mgr', '[0],[system],[mgr],', '分配角色', null, '/mgr/setRole', '7', '3', '0', null, '1', '0');
INSERT INTO `menu` VALUES ('114', 'role', 'system', '角色管理', null, '/role', '2', '2', '1', null, '1', '0'); INSERT INTO `menu` VALUES ('114', 'role', 'system', '[0],[system],', '角色管理', null, '/role', '2', '2', '1', null, '1', '0');
INSERT INTO `menu` VALUES ('115', 'role_add', 'role', '添加角色', null, '/role/add', '1', '3', '0', null, '1', '0'); INSERT INTO `menu` VALUES ('115', 'role_add', 'role', '[0],[system],[role],', '添加角色', null, '/role/add', '1', '3', '0', null, '1', '0');
INSERT INTO `menu` VALUES ('116', 'role_edit', 'role', '修改角色', null, '/role/edit', '2', '3', '0', null, '1', '0'); INSERT INTO `menu` VALUES ('116', 'role_edit', 'role', '[0],[system],[role],', '修改角色', null, '/role/edit', '2', '3', '0', null, '1', '0');
INSERT INTO `menu` VALUES ('117', 'role_remove', 'role', '删除角色', null, '/role/remove', '3', '3', '0', null, '1', '0'); INSERT INTO `menu` VALUES ('117', 'role_remove', 'role', '[0],[system],[role],', '删除角色', null, '/role/remove', '3', '3', '0', null, '1', '0');
INSERT INTO `menu` VALUES ('118', 'role_setAuthority', 'role', '配置权限', null, '/role/setAuthority', '4', '3', '0', null, '1', '0'); INSERT INTO `menu` VALUES ('118', 'role_setAuthority', 'role', '[0],[system],[role],', '配置权限', null, '/role/setAuthority', '4', '3', '0', null, '1', '0');
INSERT INTO `menu` VALUES ('119', 'menu', 'system', '菜单管理', null, '/menu', '4', '2', '1', null, '1', '0'); INSERT INTO `menu` VALUES ('119', 'menu', 'system', '[0],[system],', '菜单管理', null, '/menu', '4', '2', '1', null, '1', '0');
INSERT INTO `menu` VALUES ('120', 'menu_add', 'menu', '添加菜单', null, '/menu/add', '1', '3', '0', null, '1', '0'); INSERT INTO `menu` VALUES ('120', 'menu_add', 'menu', '[0],[system],[menu],', '添加菜单', null, '/menu/add', '1', '3', '0', null, '1', '0');
INSERT INTO `menu` VALUES ('121', 'menu_edit', 'menu', '修改菜单', null, '/menu/edit', '2', '3', '0', null, '1', '0'); INSERT INTO `menu` VALUES ('121', 'menu_edit', 'menu', '[0],[system],[menu],', '修改菜单', null, '/menu/edit', '2', '3', '0', null, '1', '0');
INSERT INTO `menu` VALUES ('122', 'menu_remove', 'menu', '删除菜单', null, '/menu/remove', '3', '3', '0', null, '1', '0'); INSERT INTO `menu` VALUES ('122', 'menu_remove', 'menu', '[0],[system],[menu],', '删除菜单', null, '/menu/remove', '3', '3', '0', null, '1', '0');
INSERT INTO `menu` VALUES ('128', 'log', 'system', '业务日志', null, '/log', '6', '2', '1', null, '1', '0'); INSERT INTO `menu` VALUES ('128', 'log', 'system', '[0],[system],', '业务日志', null, '/log', '6', '2', '1', null, '1', '0');
INSERT INTO `menu` VALUES ('130', 'druid', 'system', '监控管理', null, '/druid', '7', '2', '1', null, '1', null); INSERT INTO `menu` VALUES ('130', 'druid', 'system', '[0],[system],', '监控管理', null, '/druid', '7', '2', '1', null, '1', null);
INSERT INTO `menu` VALUES ('131', 'dept', 'system', '部门管理', null, '/dept', '3', '2', '1', null, '1', null); INSERT INTO `menu` VALUES ('131', 'dept', 'system', '[0],[system],', '部门管理', null, '/dept', '3', '2', '1', null, '1', null);
INSERT INTO `menu` VALUES ('132', 'dict', 'system', '字典管理', null, '/dict', '4', '2', '1', null, '1', null); INSERT INTO `menu` VALUES ('132', 'dict', 'system', '[0],[system],', '字典管理', null, '/dict', '4', '2', '1', null, '1', null);
INSERT INTO `menu` VALUES ('133', 'loginLog', 'system', '登录日志', null, '/loginLog', '6', '2', '1', null, '1', null); INSERT INTO `menu` VALUES ('133', 'loginLog', 'system', '[0],[system],', '登录日志', null, '/loginLog', '6', '2', '1', null, '1', null);
INSERT INTO `menu` VALUES ('134', 'log_clean', 'log', '清空日志', null, '/log/delLog', '3', '3', '0', null, '1', null); INSERT INTO `menu` VALUES ('134', 'log_clean', 'log', '[0],[system],[log],', '清空日志', null, '/log/delLog', '3', '3', '0', null, '1', null);
INSERT INTO `menu` VALUES ('135', 'dept_add', 'dept', '添加部门', null, '/dept/add', '1', '3', '0', null, '1', null); INSERT INTO `menu` VALUES ('135', 'dept_add', 'dept', '[0],[system],[dept],', '添加部门', null, '/dept/add', '1', '3', '0', null, '1', null);
INSERT INTO `menu` VALUES ('136', 'dept_update', 'dept', '修改部门', null, '/dept/update', '1', '3', '0', null, '1', null); INSERT INTO `menu` VALUES ('136', 'dept_update', 'dept', '[0],[system],[dept],', '修改部门', null, '/dept/update', '1', '3', '0', null, '1', null);
INSERT INTO `menu` VALUES ('137', 'dept_delete', 'dept', '删除部门', null, '/dept/delete', '1', '3', '0', null, '1', null); INSERT INTO `menu` VALUES ('137', 'dept_delete', 'dept', '[0],[system],[dept],', '删除部门', null, '/dept/delete', '1', '3', '0', null, '1', null);
INSERT INTO `menu` VALUES ('138', 'dict_add', 'dict', '添加字典', null, '/dict/add', '1', '3', '0', null, '1', null); INSERT INTO `menu` VALUES ('138', 'dict_add', 'dict', '[0],[system],[dict],', '添加字典', null, '/dict/add', '1', '3', '0', null, '1', null);
INSERT INTO `menu` VALUES ('139', 'dict_update', 'dict', '修改字典', null, '/dict/update', '1', '3', '0', null, '1', null); INSERT INTO `menu` VALUES ('139', 'dict_update', 'dict', '[0],[system],[dict],', '修改字典', null, '/dict/update', '1', '3', '0', null, '1', null);
INSERT INTO `menu` VALUES ('140', 'dict_delete', 'dict', '删除字典', null, '/dict/delete', '1', '3', '0', null, '1', null); INSERT INTO `menu` VALUES ('140', 'dict_delete', 'dict', '[0],[system],[dict],', '删除字典', null, '/dict/delete', '1', '3', '0', null, '1', null);
INSERT INTO `menu` VALUES ('141', 'notice', 'system', '通知管理', null, '/notice', '9', '2', '1', null, '1', null); INSERT INTO `menu` VALUES ('141', 'notice', 'system', '[0],[system],', '通知管理', null, '/notice', '9', '2', '1', null, '1', null);
INSERT INTO `menu` VALUES ('142', 'notice_add', 'notice', '添加通知', null, '/notice/add', '1', '3', '0', null, '1', null); INSERT INTO `menu` VALUES ('142', 'notice_add', 'notice', '[0],[system],[notice],', '添加通知', null, '/notice/add', '1', '3', '0', null, '1', null);
INSERT INTO `menu` VALUES ('143', 'notice_update', 'notice', '修改通知', null, '/notice/update', '2', '3', '0', null, '1', null); INSERT INTO `menu` VALUES ('143', 'notice_update', 'notice', '[0],[system],[notice],', '修改通知', null, '/notice/update', '2', '3', '0', null, '1', null);
INSERT INTO `menu` VALUES ('144', 'notice_delete', 'notice', '删除通知', null, '/notice/delete', '3', '3', '0', null, '1', null); INSERT INTO `menu` VALUES ('144', 'notice_delete', 'notice', '[0],[system],[notice],', '删除通知', null, '/notice/delete', '3', '3', '0', null, '1', null);
INSERT INTO `menu` VALUES ('145', 'hello', '0', '通知', 'fa-rocket', '/notice/hello', '1', '1', '1', null, '1', null); INSERT INTO `menu` VALUES ('145', 'hello', '0', '[0],', '通知', 'fa-rocket', '/notice/hello', '1', '1', '1', null, '1', null);
INSERT INTO `menu` VALUES ('148', 'code', 'system', '代码生成', 'fa-user', '/code', '10', '2', '1', null, '1', null); INSERT INTO `menu` VALUES ('148', 'code', 'system', '[0],[system],', '代码生成', 'fa-user', '/code', '10', '2', '1', null, '1', null);
INSERT INTO `menu` VALUES ('149', 'api_mgr', '0', '接口文档', 'fa-leaf', '/swagger-ui.html', '2', '1', '1', null, '1', null); INSERT INTO `menu` VALUES ('149', 'api_mgr', '0', '[0],', '接口文档', 'fa-leaf', '/swagger-ui.html', '2', '1', '1', null, '1', null);
INSERT INTO `menu` VALUES ('150', 'to_menu_edit', 'menu', '菜单编辑跳转', '', '/menu/menu_edit', '4', '3', '0', null, '1', null); INSERT INTO `menu` VALUES ('150', 'to_menu_edit', 'menu', '[0],[system],[menu],', '菜单编辑跳转', '', '/menu/menu_edit', '4', '3', '0', null, '1', null);
INSERT INTO `menu` VALUES ('151', 'menu_list', 'menu', '菜单列表', '', '/menu/list', '5', '3', '0', null, '1', null); INSERT INTO `menu` VALUES ('151', 'menu_list', 'menu', '[0],[system],[menu],', '菜单列表', '', '/menu/list', '5', '3', '0', null, '1', null);
INSERT INTO `menu` VALUES ('152', 'to_dept_update', 'dept', '修改部门跳转', '', '/dept/dept_update', '4', '3', '0', null, '1', null); INSERT INTO `menu` VALUES ('152', 'to_dept_update', 'dept', '[0],[system],[dept],', '修改部门跳转', '', '/dept/dept_update', '4', '3', '0', null, '1', null);
INSERT INTO `menu` VALUES ('153', 'dept_list', 'dept', '部门列表', '', '/dept/list', '5', '3', '0', null, '1', null); INSERT INTO `menu` VALUES ('153', 'dept_list', 'dept', '[0],[system],[dept],', '部门列表', '', '/dept/list', '5', '3', '0', null, '1', null);
INSERT INTO `menu` VALUES ('154', 'dept_detail', 'dept', '部门详情', '', '/dept/detail', '6', '3', '0', null, '1', null); INSERT INTO `menu` VALUES ('154', 'dept_detail', 'dept', '[0],[system],[dept],', '部门详情', '', '/dept/detail', '6', '3', '0', null, '1', null);
INSERT INTO `menu` VALUES ('155', 'to_dict_edit', 'dict', '修改菜单跳转', '', '/dict/dict_edit', '4', '3', '0', null, '1', null); INSERT INTO `menu` VALUES ('155', 'to_dict_edit', 'dict', '[0],[system],[dict],', '修改菜单跳转', '', '/dict/dict_edit', '4', '3', '0', null, '1', null);
INSERT INTO `menu` VALUES ('156', 'dict_list', 'dict', '字典列表', '', '/dict/list', '5', '3', '0', null, '1', null); INSERT INTO `menu` VALUES ('156', 'dict_list', 'dict', '[0],[system],[dict],', '字典列表', '', '/dict/list', '5', '3', '0', null, '1', null);
INSERT INTO `menu` VALUES ('157', 'dict_detail', 'dict', '字典详情', '', '/dict/detail', '6', '3', '0', null, '1', null); INSERT INTO `menu` VALUES ('157', 'dict_detail', 'dict', '[0],[system],[dict],', '字典详情', '', '/dict/detail', '6', '3', '0', null, '1', null);
INSERT INTO `menu` VALUES ('158', 'log_list', 'log', '日志列表', '', '/log/list', '2', '3', '0', null, '1', null); INSERT INTO `menu` VALUES ('158', 'log_list', 'log', '[0],[system],[log],', '日志列表', '', '/log/list', '2', '3', '0', null, '1', null);
INSERT INTO `menu` VALUES ('159', 'log_detail', 'log', '日志详情', '', '/log/detail', '3', '3', '0', null, '1', null); INSERT INTO `menu` VALUES ('159', 'log_detail', 'log', '[0],[system],[log],', '日志详情', '', '/log/detail', '3', '3', '0', null, '1', null);
INSERT INTO `menu` VALUES ('160', 'del_login_log', 'loginLog', '清空登录日志', '', '/loginLog/delLoginLog', '1', '3', '0', null, '1', null); INSERT INTO `menu` VALUES ('160', 'del_login_log', 'loginLog', '[0],[system],[loginLog],', '清空登录日志', '', '/loginLog/delLoginLog', '1', '3', '0', null, '1', null);
INSERT INTO `menu` VALUES ('161', 'login_log_list', 'loginLog', '登录日志列表', '', '/loginLog/list', '2', '3', '0', null, '1', null); INSERT INTO `menu` VALUES ('161', 'login_log_list', 'loginLog', '[0],[system],[loginLog],', '登录日志列表', '', '/loginLog/list', '2', '3', '0', null, '1', null);
INSERT INTO `menu` VALUES ('162', 'to_role_edit', 'role', '修改角色跳转', '', '/role/role_edit', '5', '3', '0', null, '1', null); INSERT INTO `menu` VALUES ('162', 'to_role_edit', 'role', '[0],[system],[role],', '修改角色跳转', '', '/role/role_edit', '5', '3', '0', null, '1', null);
INSERT INTO `menu` VALUES ('163', 'to_role_assign', 'role', '角色分配跳转', '', '/role/role_assign', '6', '3', '0', null, '1', null); INSERT INTO `menu` VALUES ('163', 'to_role_assign', 'role', '[0],[system],[role],', '角色分配跳转', '', '/role/role_assign', '6', '3', '0', null, '1', null);
INSERT INTO `menu` VALUES ('164', 'role_list', 'role', '角色列表', '', '/role/list', '7', '3', '0', null, '1', null); INSERT INTO `menu` VALUES ('164', 'role_list', 'role', '[0],[system],[role],', '角色列表', '', '/role/list', '7', '3', '0', null, '1', null);
INSERT INTO `menu` VALUES ('165', 'to_role_assign', 'mgr', '分配角色跳转', '', '/mgr/role_assign', '8', '3', '0', null, '1', null); INSERT INTO `menu` VALUES ('165', 'to_role_assign', 'mgr', '[0],[system],[role],', '分配角色跳转', '', '/mgr/role_assign', '8', '3', '0', null, '1', null);
INSERT INTO `menu` VALUES ('166', 'to_user_edit', 'mgr', '编辑用户跳转', '', '/mgr/user_edit', '9', '3', '0', null, '1', null); INSERT INTO `menu` VALUES ('166', 'to_user_edit', 'mgr', '[0],[system],[mgr],', '编辑用户跳转', '', '/mgr/user_edit', '9', '3', '0', null, '1', null);
INSERT INTO `menu` VALUES ('167', 'mgr_list', 'mgr', '用户列表', '', '/mgr/list', '10', '3', '0', null, '1', null); INSERT INTO `menu` VALUES ('167', 'mgr_list', 'mgr', '[0],[system],[mgr],', '用户列表', '', '/mgr/list', '10', '3', '0', null, '1', null);
-- ---------------------------- -- ----------------------------
-- Table structure for notice -- Table structure for notice
......
...@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.mapper.BaseMapper; ...@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.mapper.BaseMapper;
* </p> * </p>
* *
* @author stylefeng * @author stylefeng
* @since 2017-06-01 * @since 2017-06-13
*/ */
public interface DeptMapper extends BaseMapper<Dept> { public interface DeptMapper extends BaseMapper<Dept> {
......
...@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.mapper.BaseMapper; ...@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.mapper.BaseMapper;
* </p> * </p>
* *
* @author stylefeng * @author stylefeng
* @since 2017-06-01 * @since 2017-06-13
*/ */
public interface DictMapper extends BaseMapper<Dict> { public interface DictMapper extends BaseMapper<Dict> {
......
...@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.mapper.BaseMapper; ...@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.mapper.BaseMapper;
* </p> * </p>
* *
* @author stylefeng * @author stylefeng
* @since 2017-06-01 * @since 2017-06-13
*/ */
public interface LoginLogMapper extends BaseMapper<LoginLog> { public interface LoginLogMapper extends BaseMapper<LoginLog> {
......
...@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.mapper.BaseMapper; ...@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.mapper.BaseMapper;
* </p> * </p>
* *
* @author stylefeng * @author stylefeng
* @since 2017-06-01 * @since 2017-06-13
*/ */
public interface MenuMapper extends BaseMapper<Menu> { public interface MenuMapper extends BaseMapper<Menu> {
......
...@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.mapper.BaseMapper; ...@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.mapper.BaseMapper;
* </p> * </p>
* *
* @author stylefeng * @author stylefeng
* @since 2017-06-01 * @since 2017-06-13
*/ */
public interface NoticeMapper extends BaseMapper<Notice> { public interface NoticeMapper extends BaseMapper<Notice> {
......
...@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.mapper.BaseMapper; ...@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.mapper.BaseMapper;
* </p> * </p>
* *
* @author stylefeng * @author stylefeng
* @since 2017-06-01 * @since 2017-06-13
*/ */
public interface OperationLogMapper extends BaseMapper<OperationLog> { public interface OperationLogMapper extends BaseMapper<OperationLog> {
......
...@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.mapper.BaseMapper; ...@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.mapper.BaseMapper;
* </p> * </p>
* *
* @author stylefeng * @author stylefeng
* @since 2017-06-01 * @since 2017-06-13
*/ */
public interface RelationMapper extends BaseMapper<Relation> { public interface RelationMapper extends BaseMapper<Relation> {
......
...@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.mapper.BaseMapper; ...@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.mapper.BaseMapper;
* </p> * </p>
* *
* @author stylefeng * @author stylefeng
* @since 2017-06-01 * @since 2017-06-13
*/ */
public interface RoleMapper extends BaseMapper<Role> { public interface RoleMapper extends BaseMapper<Role> {
......
...@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.mapper.BaseMapper; ...@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.mapper.BaseMapper;
* </p> * </p>
* *
* @author stylefeng * @author stylefeng
* @since 2017-06-01 * @since 2017-06-13
*/ */
public interface UserMapper extends BaseMapper<User> { public interface UserMapper extends BaseMapper<User> {
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
<id column="id" property="id" /> <id column="id" property="id" />
<result column="code" property="code" /> <result column="code" property="code" />
<result column="pcode" property="pcode" /> <result column="pcode" property="pcode" />
<result column="pcodes" property="pcodes" />
<result column="name" property="name" /> <result column="name" property="name" />
<result column="icon" property="icon" /> <result column="icon" property="icon" />
<result column="url" property="url" /> <result column="url" property="url" />
......
...@@ -11,7 +11,7 @@ import java.io.Serializable; ...@@ -11,7 +11,7 @@ import java.io.Serializable;
* </p> * </p>
* *
* @author stylefeng * @author stylefeng
* @since 2017-06-01 * @since 2017-06-13
*/ */
public class Dept extends Model<Dept> { public class Dept extends Model<Dept> {
......
...@@ -11,7 +11,7 @@ import java.io.Serializable; ...@@ -11,7 +11,7 @@ import java.io.Serializable;
* </p> * </p>
* *
* @author stylefeng * @author stylefeng
* @since 2017-06-01 * @since 2017-06-13
*/ */
public class Dict extends Model<Dict> { public class Dict extends Model<Dict> {
......
...@@ -13,7 +13,7 @@ import java.io.Serializable; ...@@ -13,7 +13,7 @@ import java.io.Serializable;
* </p> * </p>
* *
* @author stylefeng * @author stylefeng
* @since 2017-06-01 * @since 2017-06-13
*/ */
@TableName("login_log") @TableName("login_log")
public class LoginLog extends Model<LoginLog> { public class LoginLog extends Model<LoginLog> {
......
...@@ -11,7 +11,7 @@ import java.io.Serializable; ...@@ -11,7 +11,7 @@ import java.io.Serializable;
* </p> * </p>
* *
* @author stylefeng * @author stylefeng
* @since 2017-06-01 * @since 2017-06-13
*/ */
public class Menu extends Model<Menu> { public class Menu extends Model<Menu> {
...@@ -27,6 +27,7 @@ public class Menu extends Model<Menu> { ...@@ -27,6 +27,7 @@ public class Menu extends Model<Menu> {
* 菜单父编号 * 菜单父编号
*/ */
private String pcode; private String pcode;
private String pcodes;
/** /**
* 菜单名称 * 菜单名称
*/ */
...@@ -47,9 +48,6 @@ public class Menu extends Model<Menu> { ...@@ -47,9 +48,6 @@ public class Menu extends Model<Menu> {
* 菜单层级 * 菜单层级
*/ */
private Integer levels; private Integer levels;
/**
* 是否是菜单(1:是 0:不是(为按钮))
*/
private Integer ismenu; private Integer ismenu;
/** /**
* 备注 * 备注
...@@ -89,6 +87,14 @@ public class Menu extends Model<Menu> { ...@@ -89,6 +87,14 @@ public class Menu extends Model<Menu> {
this.pcode = pcode; this.pcode = pcode;
} }
public String getPcodes() {
return pcodes;
}
public void setPcodes(String pcodes) {
this.pcodes = pcodes;
}
public String getName() { public String getName() {
return name; return name;
} }
......
...@@ -13,7 +13,7 @@ import java.util.Date; ...@@ -13,7 +13,7 @@ import java.util.Date;
* </p> * </p>
* *
* @author stylefeng * @author stylefeng
* @since 2017-06-01 * @since 2017-06-13
*/ */
public class Notice extends Model<Notice> { public class Notice extends Model<Notice> {
......
package com.stylefeng.guns.common.persistence.model; package com.stylefeng.guns.common.persistence.model;
import com.baomidou.mybatisplus.activerecord.Model; import com.baomidou.mybatisplus.enums.IdType;
import java.util.Date;
import com.baomidou.mybatisplus.annotations.TableId; import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableName; import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date;
/** /**
* <p> * <p>
...@@ -14,7 +13,7 @@ import java.util.Date; ...@@ -14,7 +13,7 @@ import java.util.Date;
* </p> * </p>
* *
* @author stylefeng * @author stylefeng
* @since 2017-06-01 * @since 2017-06-13
*/ */
@TableName("operation_log") @TableName("operation_log")
public class OperationLog extends Model<OperationLog> { public class OperationLog extends Model<OperationLog> {
......
...@@ -11,7 +11,7 @@ import java.io.Serializable; ...@@ -11,7 +11,7 @@ import java.io.Serializable;
* </p> * </p>
* *
* @author stylefeng * @author stylefeng
* @since 2017-06-01 * @since 2017-06-13
*/ */
public class Relation extends Model<Relation> { public class Relation extends Model<Relation> {
......
...@@ -11,7 +11,7 @@ import java.io.Serializable; ...@@ -11,7 +11,7 @@ import java.io.Serializable;
* </p> * </p>
* *
* @author stylefeng * @author stylefeng
* @since 2017-06-01 * @since 2017-06-13
*/ */
public class Role extends Model<Role> { public class Role extends Model<Role> {
......
...@@ -12,7 +12,7 @@ import java.io.Serializable; ...@@ -12,7 +12,7 @@ import java.io.Serializable;
* </p> * </p>
* *
* @author stylefeng * @author stylefeng
* @since 2017-06-01 * @since 2017-06-13
*/ */
public class User extends Model<User> { public class User extends Model<User> {
......
package com.stylefeng.guns.system;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.stylefeng.guns.base.BaseJunit;
import com.stylefeng.guns.common.persistence.dao.MenuMapper;
import com.stylefeng.guns.common.persistence.model.Menu;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
import java.util.Stack;
/**
* 菜单测试
*
* @author fengshuonan
* @date 2017-06-13 21:23
*/
public class MenuTest extends BaseJunit {
@Autowired
MenuMapper menuMapper;
/**
* 初始化pcodes
*
* @author stylefeng
* @Date 2017/6/13 21:24
*/
@Test
public void generatePcodes() {
List<Menu> menus = menuMapper.selectList(null);
for (Menu menu : menus) {
if ("0".equals(menu.getPcode()) || null == menu.getPcode()) {
menu.setPcodes("[0],");
} else {
StringBuffer sb = new StringBuffer();
Menu parentMenu = getParentMenu(menu.getCode());
sb.append("[0],");
Stack<String> pcodes = new Stack<>();
while (null != parentMenu.getPcode()) {
pcodes.push(parentMenu.getCode());
parentMenu = getParentMenu(parentMenu.getPcode());
}
for(int i = 0 ;i<pcodes.size();i++){
String code = pcodes.pop();
sb.append("[" + code + "],");
}
menu.setPcodes(sb.toString());
}
menu.updateById();
}
}
private Menu getParentMenu(String code) {
Wrapper<Menu> wrapper = new EntityWrapper<Menu>();
wrapper = wrapper.eq("code", code);
List<Menu> menus = menuMapper.selectList(wrapper);
if (menus == null || menus.size() == 0) {
return new Menu();
} else {
return menus.get(0);
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment