1.要是用mp的BaseMapper的crud接口,必须重写MybatisPlusConfig配置文件,否则扫描不到对应的map接口,报错找不到什么statement(具体错误记不得了),主要的配置代码如下:
//此处好像也必须,否则mp的3.x版本会报错,需要指定DialectType这个玩意
@Bean
public PaginationInterceptor paginationInterceptor() {
PaginationInterceptor page = new PaginationInterceptor();
page.setDialectType("mysql");
return page;
}
//尤其是这个方法,必须重写,使用MybatisSqlSessionFactoryBean这个Bean
@Bean
public MybatisSqlSessionFactoryBean mybatisSqlSessionFactoryBean() throws IOException {
MybatisSqlSessionFactoryBean mybatisPlus = new MybatisSqlSessionFactoryBean();
mybatisPlus.setDataSource(dataSource);
mybatisPlus.setVfs(SpringBootVFS.class);
if (StringUtils.hasText(this.properties.getConfigLocation())) {
mybatisPlus.setConfigLocation(this.resourceLoader.getResource(this.properties.getCo