Mybatis-Plus分页插件功能无效问题

需加入以下代码在容器中进行注册,参考https://mp.baomidou.com/guide/page.html

import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.transaction.annotation.EnableTransactionManagement;

/**
 * 功能说明:mybatis-plus注册配置
 * 开发人员:@author liusha
 * 开发日期:2019/9/1 9:28
 * 功能描述:分页插件
 */
@Configuration
@EnableTransactionManagement
@MapperScan("com.sand.*.mapper*")
public class MybatisPlusConfig {
  /**
   * 分页插件
   */
  @Bean
  public PaginationInterceptor paginationInterceptor() {
    return new PaginationInterceptor();
  }
}

 

posted @ 2020-06-09 15:30  聚散彡流沙  阅读(1792)  评论(0编辑  收藏