像这样的sql一般都在mapper里通过@select注解来做吧,如下:
持久层:
@Select(“select * from role where role_code in(select role_code from user_role where username = #{username})”)
List getUserRoles(String username);
业务处理:
List list = userMapper.getUserRoles(username);
mybatis-plus复杂sql语句编写
最新推荐文章于 2024-06-20 11:56:07 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)