MyBatisPlus实现多表联接、分页查询的方法-创新互联
今天就跟大家聊聊有关MyBatis Plus实现多表联接、分页查询的方法,可能很多人都不太了解,为了让大家更加了解,小编给大家总结了以下内容,希望大家根据这篇文章可以有所收获。

代码实现
entity、mapper、service、controller 使用了 MyBatisPlus 的代码生成器,自动生成大部分基础的代码,操作方法见之前的文章:
在 SpringBoot 中引入 MyBatisPlus 之 常规操作
1.实体
① Question
// import 省略
@TableName("t_question")
public class Question implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "问答主键id")
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
@ApiModelProperty(value = "学生外键id")
@TableField("student_id")
private Integer studentId;
@ApiModelProperty(value = "问题内容")
private String content;
@ApiModelProperty(value = "问题发布时间,发布的时候后台自动生成")
private Date date;
@ApiModelProperty(value = "问题悬赏的积分")
private Integer value;
// getter、setter 省略
} 分享题目:MyBatisPlus实现多表联接、分页查询的方法-创新互联
URL链接:http://www.jxjierui.cn/article/cscihd.html


咨询
建站咨询
