错误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 '
发布评论