概述
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 Plus代码方式实现多表关联查询所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复