Mapper接口如下:
- 例1
@Select("SELECT t_question.*,t_student.`name` FROM t_question,t_student WHERE t_question.student_id=t_student.id")
List<QuestionStudentVO> getQuestionStudent(Pagination page);
- 例2
@Select("SELECT a.id,a.`name`,a.age,b.`describe` FROM USER a LEFT JOIN userinfo b ON a.id = b.user_id where a.id=#{id}")List<Map<String, Object>> dyGetUserList(Page<Map<String,Object>> page,Integer id);
转载于:https://my.oschina.net/u/3734816/blog/3069832
最后
以上就是迷你西牛最近收集整理的关于Mybatis Plus代码方式实现多表关联查询的全部内容,更多相关Mybatis内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复