老项目是mybatis的,但是新项目想使用mybatis-plus,
故需要升级
2.实现步骤 步骤一:删除mybatis相关的依赖包 步骤二:导入mybatis-plus相关的包步骤三:修改application.properties文件
com.baomidou
mybatis-plus-boot-starter
3.0-RELEASE
其他配置不变
# mybatis配置 #mybatis.mapperLocations=classpath:mapper // @Bean // public PerformanceInterceptor performanceInterceptor(){ // return new PerformanceInterceptor(); // } @Bean public PaginationInterceptor paginationInterceptor() { return new PaginationInterceptor(); } @Bean public PageInterceptor pageInterceptor() { return new PageInterceptor(); } @Bean public SqlSessionFactory sqlSessionFactory(DataSource dataSource) throws Exception { String mapperLocations = "classpath:mapper/*.xml"; VFS.addImplClass(SpringBootVFS.class); final MybatisSqlSessionFactoryBean sessionFactory = new MybatisSqlSessionFactoryBean(); sessionFactory.setDataSource(dataSource); sessionFactory.setMapperLocations(new PathMatchingResourcePatternResolver().getResources(mapperLocations)); return sessionFactory.getObject(); } }3.系统化学系mybatis-plusmybatis-plus详细的图文教程 - 博客园
4.完美!



