首页>代码>springboot整合vue实现进销存管理系统>/jxc_project-master/src/main/java/com/cdy/jxc_project/config/MybatisPlusConfig.java
package com.cdy.jxc_project.config;

import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.OptimisticLockerInnerInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

//Mybatisplus的配置类
@Configuration  // ===>applicationContext.xml
public class MybatisPlusConfig {

    //下面是mybatisplus乐观锁的插件
    //基于mybatisplus 3.4.0 的写法
    @Bean
    public MybatisPlusInterceptor optimisticLockerInnerInterceptor() {
        MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
        interceptor.addInnerInterceptor(new OptimisticLockerInnerInterceptor());
        return interceptor;
    }

    //下面是mybatisplus的分页插件
    @Bean
    public MybatisPlusInterceptor mybatisPlusPagerInterceptor() {
        MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
        interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
        return interceptor;
    }
}
最近下载更多
陈小灏  LV18 2月22日
liuyutong  LV3 2023年10月11日
小妹妹  LV7 2023年10月10日
笛卡尔积  LV6 2023年9月25日
yiy12345  LV2 2023年9月21日
guoyan  LV12 2023年9月15日
最近浏览更多
哪里的完整版  LV8 2月27日
docnnxxy688 2月26日
暂无贡献等级
andy_伟  LV6 2月25日
陈小灏  LV18 2月22日
zhao44413 2月21日
暂无贡献等级
weishenme1993  LV9 1月1日
微信网友_6955249237250048  LV5 2024年12月28日
随手一个用户名  LV1 2023年10月14日
liuyutong  LV3 2023年10月11日
wwfl02  LV3 2023年10月10日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友