mybatis-plus复杂sql语句编写

像这样的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);

你可能感兴趣的:(JAVA,mybatis)