MybatisPlusConfig.java 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. package org.jeecg.config;
  2. import org.mybatis.spring.annotation.MapperScan;
  3. import org.springframework.context.annotation.Bean;
  4. import org.springframework.context.annotation.Configuration;
  5. import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
  6. import com.baomidou.mybatisplus.extension.plugins.PerformanceInterceptor;
  7. /**
  8. * 单数据源配置(jeecg.datasource.open = false时生效)
  9. * @Author zhoujf
  10. *
  11. */
  12. @Configuration
  13. @MapperScan(value={"org.jeecg.modules.**.mapper*","cn.com.ctop.**.mapper*"})
  14. public class MybatisPlusConfig {
  15. /**
  16. * 分页插件
  17. */
  18. @Bean
  19. public PaginationInterceptor paginationInterceptor() {
  20. // 设置sql的limit为无限制,默认是500
  21. return new PaginationInterceptor().setLimit(-1);
  22. }
  23. // /**
  24. // * mybatis-plus SQL执行效率插件【生产环境可以关闭】
  25. // */
  26. // @Bean
  27. // public PerformanceInterceptor performanceInterceptor() {
  28. // return new PerformanceInterceptor();
  29. // }
  30. }