Mapper接口如下:
- 例1
@Select("SELECT t_question.*,t_student.`name` FROM t_question,t_student WHERE t_question.student_id=t_student.id")
List
例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}")
其实复杂业务逻辑sql还是推荐用xml,更方便些