<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
<version>3.1.0</version>
</dependency>
在mapper的xml文件中写了个“listWeeklyTable”的查询sql,报错“com.123.search.mapper.JobMapper.listWeeklyTable”
相关配置
mybatis-plus:
# MyBaits 别名包扫描路径,通过该属性可以给包中的类注册别名
type-aliases-package: com.itcast.search.entity
# 该配置请和 typeAliasesPackage 一起使用,如果配置了该属性,则仅仅会扫描路径下以该类作为父类的域对象 。
type-aliases-super-type: java.lang.Object
#Mapper文件位置配置
mapper-locations: classpath:mapper//Mapper.xml
启动类配置“
@MapperScan("com.123.search.mapper")
public class ServiceSearchApplication
配置类
@Configuration
@EnableTransactionManagement
public class MybatisPlusConfig {
/**
* 性能分析拦截器--观察 SQL 执行情况及执行时长,dev环境使用,并且开启SQK格式化
* @return com.baomidou.mybatisplus.extension.plugins.PerformanceInterceptor;
*/
@Bean
@Profile("dev")
public PerformanceInterceptor performanceInterceptor(){
return new PerformanceInterceptor().setFormat(true);
}
/**
* 分页拦截器
* @return com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor
*/
@Bean
public PaginationInterceptor paginationInterceptor(){
return new PaginationInterceptor();
}
}
xml文件信息(检查了namespace和resultType,都可以点击跳转路径没有错):
xml路径
nvalid bound statement (not found): com.123.search.mapper.JobMapper.listWeeklyTable
看文档