错误sted exception is org.apache.ibatis.binding.BindingException: Parameter 'xxx' not found.

编程入门 行业动态 更新时间:2024-10-28 15:29:09

<a href=https://www.elefans.com/category/jswz/34/1771449.html style=错误sted exception is org.apache.ibatis.binding.BindingException: Parameter 'xxx' not found. Available"/>

错误sted exception is org.apache.ibatis.binding.BindingException: Parameter 'xxx' not found. Available

抛这个错误都是xml找不到dao层给的参数,然后我就检查了参数发现是对的,注解也加了

贴代码:

List<Map<String,Object>> nearbyGoods(@Param("lng") String lng, @Param("lat") String lat);
<!-- 获取附近的商品 --><select id="nearbyGoods" resultType="map">SELECTgoods.goods_name,store_name,(st_distance (point (store.lng,store.lat),point (#{lng},#{lat})) * 111195 / 10000) AS juliFROMylk_store storeINNER JOIN ylk_goods goods ON store.id = goods.store_idORDER BYjuli ASC</select>

然后一顿百度,也是让我加@Param注解,我用#{arg0}、#{arg1}是可以成功取到的,然后我就纳闷了

结果:最后问题发现居然是导错包了本来应该是【import org.apache.ibatis.annotations.Param】结果我导成【import org.springframework.data.repository.query.Param】

都怪自己太粗心

更多推荐

错误sted exception is org.apache.ibatis.binding.BindingException: Parameter '

本文发布于:2024-03-07 15:57:53,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1718257.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:错误   exception   org   apache   sted

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!