1、pom文件加依赖
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>2.2.0</version>
</dependency>
2、yml加配置项
mybatis:
mapper-locations: classpath:mapper/*.xml,classpath:mapper/imp/*.xml,classpath:mapper/ecm/*.xml
type-aliases-package: com.entity,;com.imp.entity,;com.ecm.entity,;com.orcl.bean
configuration:
map-underscore-to-camel-case: true
3、dao层加注解
@Mapper