1、直接使用注解
pom中
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>1.1.1</version>
</dependency>
@Mapper注解
https://www.cnblogs.com/latteyan/p/5813262.html
2、通过配置
@Mapper
添加
mybatis.mapper-locations=classpath:mybatis/mapper/*.xml
按照对应的路径添加.xml映射文件
配置对应的xml文件配置