Parameter ‘ew‘ not found

 报错代码如图所示:

Parameter ‘ew‘ not found_第1张图片

Parameter ‘ew‘ not found_第2张图片

 

mapper代码:

 

serviceimpl代码:

Parameter ‘ew‘ not found_第3张图片

mapper.xml代码:

Parameter ‘ew‘ not found_第4张图片

org.apache.ibatis.binding.BindingException: Parameter 'ew' not found. Available parameters are [vo, page, param1, param2]

报错信息显示的是ew找不到,这里的ew其实就是QueryWrapper条件。让你选择后面他给的几个参数,但是你在mapper文件中用了@Param(xx),却还是报这个错误。

解决方法:

改之前:

Parameter ‘ew‘ not found_第5张图片

改之后:

成功获取数据:

Parameter ‘ew‘ not found_第6张图片 

 

 以上方法只适用于借鉴,很多情况属于以下几类:

包名没导对:

import org.apache.ibatis.annotations.Param;

mapper文件中没有添加@Param(xx):至于@Param(xx)的用法大家上网看看。

 

你可能感兴趣的:(mybatis,java,mybatis)