1、数据源配置allowMultiQueries默认false导致Mybatis无法操作多行数据问题,多行指的是以;;;;结束的语句
2、Mybatis-Plus分页插件功能需进行注册,否则分页无效,参考https://mp.baomidou.com/guide/page.html
import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor; import org.mybatis.spring.annotation.MapperScan; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.transaction.annotation.EnableTransactionManagement; /** * 功能说明:mybatis-plus注册配置 * 开发人员:@author liusha * 开发日期:2019/9/1 9:28 * 功能描述:分页插件 */ @Configuration @EnableTransactionManagement @MapperScan("com.sand.*.mapper*") public class MybatisPlusConfig { /** * 分页插件 */ @Bean public PaginationInterceptor paginationInterceptor() { return new PaginationInterceptor(); } }
3、springboot项目热部署提高开发效率,需进行如下操作:
<!-- 在pom.xml中引入热部署devtools依赖以及maven插件 --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> <optional>true</optional> <scope>true</scope> </dependency> <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <configuration> <!-- 为false时热部署不起作用 --> <fork>true</fork> </configuration> </plugin> </plugins> </build> <!-- 配置文件application.yml引入 --> spring: devtools: restart: #热部署开关 enabled: true