一、
1、添加jar包文件
<!--添加Mybatis --> <dependency> <groupId>org.mybatis.spring.boot</groupId> <artifactId>mybatis-spring-boot-starter</artifactId> <version>1.1.1</version> </dependency> |
2、配置yaml文件
mybatis: config-location: classpath:/mybatis/mybatis-config.xml mapper-locations: classpath:/mybatis/mappers/*.xml type-aliases-package: com.tedu.pojo |
3、设置mybatis-config.xml
|
4、设置UserMapper.xml
|
5、编辑UserMapper.java
|
6、编辑UserServiceImpl.java
|
5、为mybatis生成代理对象
|