package com.bc.exam.config;

import com.bc.exam.aspect.mybatis.QueryInterceptor;
import com.bc.exam.aspect.mybatis.UpdateInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


/**
 * @Description 描述:Mybatis过滤器配置 注意：必须按顺序进行配置，否则容易出现业务异常
 * @Author A贾宇婷034244310
 * @Date 20260615
 */
@Configuration
@MapperScan("com.bc.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();
    }


}