mybatis-plus 分页
mybatisplus自带了分页支持,可以在自定义sql得查询结果中直接返回Page来接收分页查询结果。以下为示例
1 编写mybatis 得mapper中得查询,其中第一个参数Page不需要添加参数注解,返回类型没有实体接收也可以用Map。
/**
* 系统日志
*/
@Mapper
public interface SysLogDao extends BaseMapper<SysLogEntity> {
@Select("select * from sys_log where username ~ #{key} and create_date > #{startTime}")
public IPage<SysLogEntity> list(Page<SysLogEntity> page , @Param