Comments (3)
这个方法输出的日志如下:
DEBUG [main] - ==> Preparing: select u.id, u.user_name, u.user_password, u.user_email, u.user_info, u.head_img, u.create_time, r.id role_id, r.role_name role_role_name, r.enabled role_enabled, r.create_by role_create_by, r.create_time role_create_time, p.id role_privilege_id, p.privilege_name role_privilege_privilege_name, p.privilege_url role_privilege_privilege_url from sys_user u inner join sys_user_role ur on u.id = ur.user_id inner join sys_role r on ur.role_id = r.id inner join sys_role_privilege rp on rp.role_id = r.id inner join sys_privilege p on p.id = rp.privilege_id
DEBUG [main] - ==> Parameters:
TRACE [main] - <== Columns: id, user_name, user_password, user_email, user_info, head_img, create_time, role_id, role_role_name, role_enabled, role_create_by, role_create_time, role_privilege_id, role_privilege_privilege_name, role_privilege_privilege_url
TRACE [main] - <== Row: 1, admin, 123456, [email protected], <<BLOB>>, <<BLOB>>, 2016-06-07 01:11:12.0, 1, 管理员, 1, 1, 2016-04-01 17:02:14.0, 1, 用户管理, /users
TRACE [main] - <== Row: 1, admin, 123456, [email protected], <<BLOB>>, <<BLOB>>, 2016-06-07 01:11:12.0, 1, 管理员, 1, 1, 2016-04-01 17:02:14.0, 3, 系统日志, /logs
TRACE [main] - <== Row: 1, admin, 123456, [email protected], <<BLOB>>, <<BLOB>>, 2016-06-07 01:11:12.0, 1, 管理员, 1, 1, 2016-04-01 17:02:14.0, 2, 角色管理, /roles
TRACE [main] - <== Row: 1, admin, 123456, [email protected], <<BLOB>>, <<BLOB>>, 2016-06-07 01:11:12.0, 2, 普通用户, 1, 1, 2016-04-01 17:02:34.0, 4, 人员维护, /persons
TRACE [main] - <== Row: 1001, test, 123456, [email protected], <<BLOB>>, <<BLOB>>, 2016-06-07 00:00:00.0, 2, 普通用户, 1, 1, 2016-04-01 17:02:34.0, 4, 人员维护, /persons
TRACE [main] - <== Row: 1, admin, 123456, [email protected], <<BLOB>>, <<BLOB>>, 2016-06-07 01:11:12.0, 2, 普通用户, 1, 1, 2016-04-01 17:02:34.0, 5, 单位维护, /companies
TRACE [main] - <== Row: 1001, test, 123456, [email protected], <<BLOB>>, <<BLOB>>, 2016-06-07 00:00:00.0, 2, 普通用户, 1, 1, 2016-04-01 17:02:34.0, 5, 单位维护, /companies
DEBUG [main] - <== Total: 7
用户数:2
用户名:admin
角色名:管理员
权限名:用户管理
权限名:系统日志
权限名:角色管理
角色名:普通用户
权限名:人员维护
权限名:单位维护
用户名:test
角色名:普通用户
权限名:人员维护
权限名:单位维护
from book.
从整体看,就两个结果,admin 和 test 两个用户。
在 admin 中有俩角色 管理员 和 普通用户。
在管理员角色中有3个具体的权限。
从顶层判断就是先看是不是同一个用户,再看是不是同一个角色,最后区分权限。
判断用户的时候不会考虑角色和权限信息(这是由映射中的 <id>
决定的),判断角色也不会受权限影响。
如果你执行的结果和这里的不同,对比上面日志中的数据(7个ROW行)看看。
如果还是不明白,可以把你测试的详细日志发出来。
from book.
from book.
Related Issues (20)
- 《MyBatis从入门到精通》(刘增辉)一书中,第96页代码案例缺失,我贡献一些自己写的案例。 HOT 2
- 可以支持对指定列的结果返回吗
- 建议增加项目mybatis-spring使用的注意事项 HOT 2
- 《MyBatis从入门到精通》(刘增辉)一书中,书签161页第3个存储过程创建是否有误? HOT 3
- 数据库Sqlserver2012 与 PageHelper 报错 HOT 2
- Provider注解 HOT 1
- 第8章 MyBatis插件开发 8.4.1 PageInterceptor拦截器类, 初始化 MappedStatement 报错。
- 批量逻辑删除有现成的方法可用吗?
- 【书籍勘误】第 5 章 MyBatis 代码生成器 中文文档链接失效
- 启动报warn No MyBatis mapper was found in '[com.xxx]' package. Please check your configuration.
- 几点建议
- 达梦数据库使用异常-java.lang.NoSuchMethodError: com.github.pagehelper.PageHelper.startPage(II) HOT 1
- tk.mybatis.mapper 如何查询被逻辑删除的数据
- 数据库结构.SQL的bigint
- Mybatis-book
- MyBatis从入门到精通 第一章的第一个demo 出现以下问题!!!请大佬不吝赐教 HOT 2
- 大神了解过 mybatis-dynamic-sql 这个项目吗 HOT 1
- mapper-spring-boot-starter与mapper HOT 1
- Oracle数据库使用PageHelper报错ORA-00918 HOT 1
- 书中文字勘误 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from book.