项目移植到原先mybasis项目里出现BindingException: Invalid bound statement (not found): **selectPage

简介: 项目移植到原先mybasis项目里出现BindingException: Invalid bound statement (not found): **selectPage

项目场景:

ruoyi-cloud进行Mybatis转换Mybatis-plus,执行QueryWrapper方法,一直提醒报错 Cause: java.sql.SQLSyntaxErrorException: Unknown column ‘search_value’ in ‘field list’

但是对应实体类没有查找到这个字段,经过一番努力,在一篇文章里找到了答案,最后问题得到了解决!

 

### The error may involve defaultParameterMap
### The error occurred while setting parameters
### SQL: SELECT  category_id,category_name,code,app_type,remark,del_flag,search_value,create_by,create_time,update_by,update_time,params  FROM wf_category   WHERE  del_flag='0'
### Cause: java.sql.SQLSyntaxErrorException: Unknown column 'search_value' in 'field list'
; bad SQL grammar []; nested exception is java.sql.SQLSyntaxErrorException: Unknown column 'search_value' in 'field list'
  at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:239)
  at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:70)
  at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:91)
  at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:441)
  at com.sun.proxy.$Proxy111.selectList(Unknown Source)
  at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:224)
  at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.executeForIPage(MybatisMapperMethod.java:121)
  at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.execute(MybatisMapperMethod.java:85)
  at com.baomidou.mybatisplus.core.override.MybatisMapperProxy$PlainMethodInvoker.invoke(MybatisMapperProxy.java:148)
  at com.baomidou.mybatisplus.core.override.MybatisMapperProxy.invoke(MybatisMapperProxy.java:89)
  at com.sun.proxy.$Proxy162.selectPage(Unknown Source)
  at com.ruoyi.common.core.mapper.BaseMapperPlus.selectVoPage(BaseMapperPlus.java:183)
  at java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:627)
  at com.baomidou.mybatisplus.core.override.MybatisMapperProxy$DefaultMethodInvoker.invoke(MybatisMapperProxy.java:162)
  at com.baomidou.mybatisplus.core.override.MybatisMapperProxy.invoke(MybatisMapperProxy.java:89)
  at com.sun.proxy.$Proxy162.selectVoPage(Unknown Source)

同时要去掉 mybatis-spring-boot-starter的mybatis ,否则版本可能会有冲突

<!-- SpringBoot集成mybatis框架 -->
            <dependency>
                <groupId>org.mybatis.spring.boot</groupId>
                <artifactId>mybatis-spring-boot-starter</artifactId>
                <version>${mybatis-spring-boot.version}</version>
                <exclusions>
          <exclusion>
                <groupId>org.mybatis</groupId>
                <artifactId>mybatis</artifactId>
          </exclusion>
        </exclusions>
            </dependency>


相关文章
|
12天前
|
Java
SpringBoot:Invalid bound statement (not found)的原因和解决方案
SpringBoot:Invalid bound statement (not found)的原因和解决方案
|
19天前
|
SQL JSON Java
【bug日记】已解决:Invalid bound statement (not found): 找不到对应的Mapper映射类
【bug日记】已解决:Invalid bound statement (not found): 找不到对应的Mapper映射类
|
8月前
flowable项目报错:java.sql.SQLSyntaxErrorException: Table ‘psr_flowable_test.act_ge_property’ doesn’t exi
flowable项目报错:java.sql.SQLSyntaxErrorException: Table ‘psr_flowable_test.act_ge_property’ doesn’t exi
|
7月前
|
JSON 小程序 API
小程序踩坑-Setting data field "list" to undefined is invalid.
小程序踩坑-Setting data field "list" to undefined is invalid.
159 0
|
8月前
|
SQL
SAP Table function 执行报错 code CX_SQL_EXCEPTION feature not supported 该如何分析
SAP Table function 执行报错 code CX_SQL_EXCEPTION feature not supported 该如何分析
41 0
|
12月前
|
Dart
error • The parameter ‘name‘ can‘t have a value of ‘null‘ because of its type错误
error • The parameter ‘name‘ can‘t have a value of ‘null‘ because of its type错误
|
Java Maven
invalid bound statement (not found) - 接手一个老项目时报的几个错误处理方案
invalid bound statement (not found) - 接手一个老项目时报的几个错误处理方案
164 0
invalid bound statement (not found) - 接手一个老项目时报的几个错误处理方案
|
XML SQL Java
如何去寻找解决bug?(以Mapped Statements collection does not contain value for xxx的异常为例)
如何去寻找解决bug?(以Mapped Statements collection does not contain value for xxx的异常为例)
如何去寻找解决bug?(以Mapped Statements collection does not contain value for xxx的异常为例)
SAP QM 执行事务代码QA11 报错- Selected set code does not exist, or data entered is incomplete-
SAP QM 执行事务代码QA11 报错- Selected set code does not exist, or data entered is incomplete-
SAP QM 执行事务代码QA11 报错- Selected set code does not exist, or data entered is incomplete-