Search in sources :

Example 76 with PaginationInnerInterceptor

use of com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor in project ballcat-codegen by ballcat-projects.

the class MybatisPlusConfig method mybatisPlusInterceptor.

/**
 * MybatisPlusInterceptor 插件,默认提供分页插件</br>
 * 如需其他MP内置插件,则需自定义该Bean
 * @return MybatisPlusInterceptor
 */
@Bean
@ConditionalOnMissingBean(MybatisPlusInterceptor.class)
public MybatisPlusInterceptor mybatisPlusInterceptor() {
    MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
    interceptor.addInnerInterceptor(new PaginationInnerInterceptor());
    return interceptor;
}
Also used : MybatisPlusInterceptor(com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor) PaginationInnerInterceptor(com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Example 77 with PaginationInnerInterceptor

use of com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor in project onex-boot by zhangchaoxu.

the class BaseMybatisPlusConfig method initPaginationInterceptor.

/**
 * 初始化分页拦截器
 */
protected InnerInterceptor initPaginationInterceptor() {
    PaginationInnerInterceptor paginationInnerInterceptor = new PaginationInnerInterceptor(DbType.MYSQL);
    // 单页分页条数限制,默认不受限制
    paginationInnerInterceptor.setMaxLimit(-1L);
    // 溢出总页数后是否进行处理
    paginationInnerInterceptor.setOverflow(false);
    return paginationInnerInterceptor;
}
Also used : PaginationInnerInterceptor(com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor)

Example 78 with PaginationInnerInterceptor

use of com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor in project charon by harvies.

the class MybatisAutoConfiguration method paginationInterceptor.

@Bean
public PaginationInnerInterceptor paginationInterceptor() {
    PaginationInnerInterceptor paginationInterceptor = new PaginationInnerInterceptor();
    // 设置请求的页面大于最大页后操作, true调回到首页,false 继续请求  默认false
    // paginationInterceptor.setOverflow(false);
    // 设置最大单页限制数量,默认 500 条,-1 不受限制
    // paginationInterceptor.setLimit(500);
    // 开启 count 的 join 优化,只针对部分 left join
    paginationInterceptor.setOptimizeJoin(true);
    return paginationInterceptor;
}
Also used : PaginationInnerInterceptor(com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor) Bean(org.springframework.context.annotation.Bean)

Example 79 with PaginationInnerInterceptor

use of com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor in project Ant-Live by PinTeh.

the class MybatisPlusConfig method mybatisPlusInterceptor.

@Bean
public MybatisPlusInterceptor mybatisPlusInterceptor() {
    MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
    interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
    return interceptor;
}
Also used : MybatisPlusInterceptor(com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor) PaginationInnerInterceptor(com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor) Bean(org.springframework.context.annotation.Bean)

Example 80 with PaginationInnerInterceptor

use of com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor in project waynboot-mall by wayn111.

the class MybatisPlusConfig method mybatisPlusInterceptor.

// 最新版
@Bean
public MybatisPlusInterceptor mybatisPlusInterceptor() {
    MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
    interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.H2));
    return interceptor;
}
Also used : MybatisPlusInterceptor(com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor) PaginationInnerInterceptor(com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor) Bean(org.springframework.context.annotation.Bean)

Aggregations

PaginationInnerInterceptor (com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor)104 Bean (org.springframework.context.annotation.Bean)95 MybatisPlusInterceptor (com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor)94 OptimisticLockerInnerInterceptor (com.baomidou.mybatisplus.extension.plugins.inner.OptimisticLockerInnerInterceptor)15 ConditionalOnMissingBean (org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean)14 BlockAttackInnerInterceptor (com.baomidou.mybatisplus.extension.plugins.inner.BlockAttackInnerInterceptor)11 TenantLineInnerInterceptor (com.baomidou.mybatisplus.extension.plugins.inner.TenantLineInnerInterceptor)6 InnerInterceptor (com.baomidou.mybatisplus.extension.plugins.inner.InnerInterceptor)4 TenantLineHandler (com.baomidou.mybatisplus.extension.plugins.handler.TenantLineHandler)3 MybatisSqlSessionFactoryBean (com.baomidou.mybatisplus.extension.spring.MybatisSqlSessionFactoryBean)3 Expression (net.sf.jsqlparser.expression.Expression)3 Order (org.springframework.core.annotation.Order)3 MybatisConfiguration (com.baomidou.mybatisplus.core.MybatisConfiguration)2 IllegalSQLInnerInterceptor (com.baomidou.mybatisplus.extension.plugins.inner.IllegalSQLInnerInterceptor)2 LongValue (net.sf.jsqlparser.expression.LongValue)2 StringValue (net.sf.jsqlparser.expression.StringValue)2 ConditionalOnBean (org.springframework.boot.autoconfigure.condition.ConditionalOnBean)2 ConditionalOnExpression (org.springframework.boot.autoconfigure.condition.ConditionalOnExpression)2 TenantLineHandler (com.albedo.java.plugins.database.handler.TenantLineHandler)1 SchemaInterceptor (com.albedo.java.plugins.database.interceptor.SchemaInterceptor)1