项目移植到原先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>


相关文章
|
5月前
|
SQL XML Java
Invalid bound statement (not found): com.zheng.mapper.UserMapper.login
这篇文章解释了MyBatis中接口与Mapper配置文件映射绑定失败的原因,并提供了解决步骤,包括确保Mapper.xml文件的namespace与Mapper接口的类路径相同,接口方法名与XML中定义的statement id相同,以及接口方法的输入输出参数类型与Mapper.xml中定义的sql的parameterType和resultType类型匹配。
Invalid bound statement (not found): com.zheng.mapper.UserMapper.login
|
8月前
|
Java
SpringBoot:Invalid bound statement (not found)的原因和解决方案
SpringBoot:Invalid bound statement (not found)的原因和解决方案
|
8月前
|
SQL JSON Java
【bug日记】已解决:Invalid bound statement (not found): 找不到对应的Mapper映射类
【bug日记】已解决:Invalid bound statement (not found): 找不到对应的Mapper映射类
|
SQL 关系型数据库 MySQL
this is incompatible with sql_mode=only_full_group_by、错误解决方案(亲测可用)
this is incompatible with sql_mode=only_full_group_by、错误解决方案(亲测可用)
4203 0
this is incompatible with sql_mode=only_full_group_by、错误解决方案(亲测可用)
|
Java Maven
invalid bound statement (not found) - 接手一个老项目时报的几个错误处理方案
invalid bound statement (not found) - 接手一个老项目时报的几个错误处理方案
212 0
invalid bound statement (not found) - 接手一个老项目时报的几个错误处理方案
使用SpringBoot报错:Inferred type ‘S‘ for type parameter ‘S‘ is not within its bound。【解决办法】
使用SpringBoot报错:Inferred type ‘S‘ for type parameter ‘S‘ is not within its bound。【解决办法】
使用SpringBoot报错:Inferred type ‘S‘ for type parameter ‘S‘ is not within its bound。【解决办法】
SAP MM 执行事务代码MRRL报错-No message was found for partner 100065 company code 0001-
SAP MM 执行事务代码MRRL报错-No message was found for partner 100065 company code 0001-
SAP MM 执行事务代码MRRL报错-No message was found for partner 100065 company code 0001-
SpringBoot项目出现: Invalid bound statement (not found)可能原因
SpringBoot项目出现: Invalid bound statement (not found)可能原因
261 0
SpringBoot项目出现: Invalid bound statement (not found)可能原因
|
Java 数据格式 XML
JakartaEE Exception: Invalid bound statement (not found): com.mazaiting.blog.dao.UserDao.selectUs...
异常 org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.
1217 0