Search in sources :

Example 91 with PaginationInnerInterceptor

use of com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor in project heifer by galaxy-sea.

the class MybatisPlusConfiguration method mybatisPlusInterceptor.

@Bean
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) Bean(org.springframework.context.annotation.Bean)

Example 92 with PaginationInnerInterceptor

use of com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor in project spring-base-demo by guanyang.

the class MybatisPlusConfig method mybatisPlusInterceptor.

@Bean
public MybatisPlusInterceptor mybatisPlusInterceptor() {
    MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
    // 分页插件,参考文档:https://mp.baomidou.com/guide/page.html
    interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
    // 乐观锁插件,参考文档:https://mp.baomidou.com/guide/interceptor-optimistic-locker.html#optimisticlockerinnerinterceptor
    interceptor.addInnerInterceptor(new OptimisticLockerInnerInterceptor());
    return interceptor;
}
Also used : MybatisPlusInterceptor(com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor) PaginationInnerInterceptor(com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor) OptimisticLockerInnerInterceptor(com.baomidou.mybatisplus.extension.plugins.inner.OptimisticLockerInnerInterceptor) Bean(org.springframework.context.annotation.Bean)

Example 93 with PaginationInnerInterceptor

use of com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor in project longmarch by yuyueqty.

the class MybatisPlusConfig method mybatisPlusInterceptor.

/**
 * 拦截器
 *
 * @return MybatisPlusInterceptor
 */
@Bean
public MybatisPlusInterceptor mybatisPlusInterceptor() {
    MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
    // XML SQL 解析器
    interceptor.addInnerInterceptor(new XmlSqlInterceptor(new XMLLanguageDriver()));
    // 数据脱敏拦截器
    interceptor.addInnerInterceptor(new DesensitizedInterceptor());
    // 数据权限拦截器
    interceptor.addInnerInterceptor(new DataScopeInterceptor());
    // 分页拦截器
    interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
    return interceptor;
}
Also used : MybatisPlusInterceptor(com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor) XMLLanguageDriver(org.apache.ibatis.scripting.xmltags.XMLLanguageDriver) PaginationInnerInterceptor(com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor) Bean(org.springframework.context.annotation.Bean)

Example 94 with PaginationInnerInterceptor

use of com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor in project novel by 201206030.

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 95 with PaginationInnerInterceptor

use of com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor in project scaleph by flowerfine.

the class MybatisConfig method paginationInterceptor.

@Bean
public MybatisPlusInterceptor paginationInterceptor() {
    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)

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