1.Create an initial project in https://start.spring.io

How to use springboot and mybatis 随笔 第1张

SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。

 

2.Unzip rar file and open with intellij

How to use springboot and mybatis 随笔 第2张

How to use springboot and mybatis 随笔 第3张

 

3.add other dependencies in pom.xml

How to use springboot and mybatis 随笔 第4张

 

4.Create two new packages : dao, entity

How to use springboot and mybatis 随笔 第5张

How to use springboot and mybatis 随笔 第6张

5. Add configuration in application.properties

How to use springboot and mybatis 随笔 第7张

 

6.add a java Class in entity 

How to use springboot and mybatis 随笔 第8张

 

 7. add an interface in dao package 

How to use springboot and mybatis 随笔 第9张

 

 8.Add an annotation in DemoApplication.class

How to use springboot and mybatis 随笔 第10张

9.Add a Directory in resources named mapper:

How to use springboot and mybatis 随笔 第11张

 

 10.Add an UserDao.xml in mapper

How to use springboot and mybatis 随笔 第12张

 

 How to use springboot and mybatis 随笔 第13张

 

扫码关注我们
微信号:SRE实战
拒绝背锅 运筹帷幄