Search in sources :

Example 6 with PerformanceInterceptor

use of com.baomidou.mybatisplus.extension.plugins.PerformanceInterceptor in project shopzz by whoiszxl.

the class MyBatisConfig method performanceInterceptor.

@Bean
@Profile({ "dev", "test" })
public PerformanceInterceptor performanceInterceptor() {
    PerformanceInterceptor performanceInterceptor = new PerformanceInterceptor();
    // ms,超过此处设置的ms则sql不执行
    performanceInterceptor.setMaxTime(1000);
    performanceInterceptor.setFormat(true);
    return performanceInterceptor;
}
Also used : PerformanceInterceptor(com.baomidou.mybatisplus.extension.plugins.PerformanceInterceptor) Profile(org.springframework.context.annotation.Profile) Bean(org.springframework.context.annotation.Bean)

Example 7 with PerformanceInterceptor

use of com.baomidou.mybatisplus.extension.plugins.PerformanceInterceptor in project springboot-learning by lyb-geek.

the class MybatisPlusConfig method performanceInterceptor.

/**
 * 性能分析插件
 *
 * @return
 */
@Bean
public PerformanceInterceptor performanceInterceptor() {
    PerformanceInterceptor performanceInterceptor = new PerformanceInterceptor();
    performanceInterceptor.setFormat(true);
    return performanceInterceptor;
}
Also used : PerformanceInterceptor(com.baomidou.mybatisplus.extension.plugins.PerformanceInterceptor) Bean(org.springframework.context.annotation.Bean)

Aggregations

PerformanceInterceptor (com.baomidou.mybatisplus.extension.plugins.PerformanceInterceptor)7 Bean (org.springframework.context.annotation.Bean)7 MybatisSqlSessionFactoryBean (com.baomidou.mybatisplus.extension.spring.MybatisSqlSessionFactoryBean)1 ConditionalOnProperty (org.springframework.boot.autoconfigure.condition.ConditionalOnProperty)1 Profile (org.springframework.context.annotation.Profile)1