用户和角色多对多,角色和权限多对多。
用户表、角色表、权限表、加两个中间表。
不用多说,直接上代码
用户表:
1 | public interface UserMapper { |
角色表:
1 | public interface RoleMapper { |
权限表:
1 | public interface PermissionMapper { |
一对多、多对一
把many=@Many替换成one=@One就好了。
用户和角色多对多,角色和权限多对多。
用户表、角色表、权限表、加两个中间表。
1 | public interface UserMapper { |
1 | public interface RoleMapper { |
1 | public interface PermissionMapper { |
把many=@Many替换成one=@One就好了。