Mybatis-plus: org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.itcast.search.mapper.JobMapper.listWeeklyTable

Created on 18 Apr 2019  ·  1Comment  ·  Source: baomidou/mybatis-plus

当前使用版本(必须填写清楚,否则不予处理)

    <dependency>
        <groupId>com.baomidou</groupId>
        <artifactId>mybatis-plus-boot-starter</artifactId>
        <version>3.1.0</version>
    </dependency>

该问题是怎么引起的?(最新版上已修复的会直接close掉)

在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

>All comments

看文档

Was this page helpful?
0 / 5 - 0 ratings