Mybatis如何高效处理查询?

摘要:# 基于SpringBoot整合Mybatis ## 1.导入依赖 ~~~xml org.springframework.boot spring-boot-starter-parent 2.3.7.RELEASE org.springfra
基于SpringBoot整合Mybatis 1.导入依赖 <!--Boot工程父依赖--> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.3.7.RELEASE</version> </parent> <!--Boot工程打包的时候可以用到--> <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> </plugins> </build> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> </dependency> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> </dependency> <dependency> <groupId>com.alibaba</groupId> <artifactId>druid-spring-boot-starter</artifactId> <version>1.1.10</version> </dependency> <dependency> <groupId>org.mybatis.spring.boot</groupId> <artifactId>mybatis-spring-boot-starter</artifactId> <version>2.1.3</version> </dependency> <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> </dependency> </dependencies> 2.编写配置信息 #数据源配置 spring: datasource: #springboot集成的mysql驱动版本是8,所以Driver要选cj包 driver-class-name: com.mysq
阅读全文