SpringBoot整合Mybatis
一.xml方式整合mybatis
xml方式在编写复杂SQL时,更适合。
1.导入依赖
<!-- mysql驱动-->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<!-- druid连接-->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
<version>1.1.10</version>
</dependency>
<!-- mybatis-->
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>1.3.2</version>
</dependency>
2.编写配置文件
//准备实体类
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Air {
private Integer id;
private In