You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
885 B
37 lines
885 B
package com.yf.exam.config;
|
|
|
|
import com.yf.exam.aspect.mybatis.QueryInterceptor;
|
|
import com.yf.exam.aspect.mybatis.UpdateInterceptor;
|
|
import org.mybatis.spring.annotation.MapperScan;
|
|
import org.springframework.context.annotation.Bean;
|
|
import org.springframework.context.annotation.Configuration;
|
|
|
|
/**
|
|
* Mybatis过滤器配置
|
|
* 注意:必须按顺序进行配置,否则容易出现业务异常
|
|
* @author bool
|
|
*/
|
|
@Configuration
|
|
@MapperScan("com.yf.exam.modules.**.mapper")
|
|
public class MybatisConfig {
|
|
|
|
/**
|
|
* 数据查询过滤器
|
|
*/
|
|
@Bean
|
|
public QueryInterceptor queryInterceptor() {
|
|
QueryInterceptor query = new QueryInterceptor();
|
|
query.setLimit(-1L);
|
|
return query;
|
|
}
|
|
|
|
/**
|
|
* 插入数据过滤器
|
|
*/
|
|
@Bean
|
|
public UpdateInterceptor updateInterceptor() {
|
|
return new UpdateInterceptor();
|
|
}
|
|
|
|
|
|
} |