zoukankan      html  css  js  c++  java
  • mybatis项目升级到mybatis-plus项目

    1.注释mybatis-starter

    添加 mybatis-plus

    ```  <dependency>
    <dependency>
        <groupId>com.baomidou</groupId>
        <artifactId>mybatis-plus-boot-starter</artifactId>
        <version>3.3.2</version>
    </dependency>
    ```
    

    2.配置文件mybatis修改为mybatis-puls

    mybatis-puls:
      mapper-locations:
        - classpath*:com/**/mapper/*.xml
        - classpath*:mapper/*.xml
    

    3.添加MybatisPlusConfig配置文件

    @Configuration
    @MapperScan(basePackages = {"com.xxxx.xxxx.mapper"})
    @EnableTransactionManagement
    public class MybatisPlusConfig {
        /**
         * 性能分析拦截器,不建议生产使用
         */
    //    @Bean
    //    public PerformanceInterceptor performanceInterceptor(){
    //        return new PerformanceInterceptor();
    //    }
    
        /**
         * 分页插件
         */
        @Bean
        public PaginationInterceptor paginationInterceptor() {
            return new PaginationInterceptor();
        }
    
        /**
         * pagehelper的分页插件
         */
        @Bean
        public PageInterceptor pageInterceptor() {
            return new PageInterceptor();
        }
    
    }
    
    
  • 相关阅读:
    hashlib模块
    configparser模块
    xml模块和shelve模块
    json与pickle模块
    3/30
    os模块
    sys模块
    shutil模块
    random模块
    2月书单《编码隐匿在计算机软硬件背后的语言》 13-16章
  • 原文地址:https://www.cnblogs.com/pigll/p/13646240.html
Copyright © 2011-2022 走看看