springboot 引入 mybatis

  1. pom
    1. <dependency>
      <groupId>org.mybatis.spring.boot</groupId>
      <artifactId>mybatis-spring-boot-starter</artifactId>
      <version>2.1.3</version>
      </dependency>
  2. yml
mybatis:
type-aliases-package: cn.likui.study.entity
mapper-locations: classpath:mapper/*Mapper.xml
configuration:
map-underscore-to-camel-case: true
# log-impl: org.apache.ibatis.logging.stdout.StdOutImpl

mapper(java) entity(java) mapper(xml 注意namespace配置)

原文地址:https://www.cnblogs.com/beixiaoyi/p/13738053.html