0%

Java错误集合

beer

Photo by Sean Thomas on Unsplash

Mybatis错误:Parameter ‘XXX’ not found. Available parameters are [1, 0, param1, param2]

Mybatis 调用指定参数

1
2
3
4
5
6
7
8
9
10
11
原本
@Select("select * from fruitsell where f_id=#{f_id} and u_id=#{u_id}")
public Fruitsell finbyfruitsell(Long f_id,Long u_id);

可行方法1
@Select("select * from fruitsell where f_id=#{0} and u_id=#{1}")
public Fruitsell finbyfruitsell(Long f_id,Long u_id);

推荐方案
@Select("select * from fruitsell where f_id=#{f_id} and u_id=#{u_id}")
public Fruitsell finbyfruitsell(@Param("f_id") Long f_id,@Param("f_id") Long u_id);

参考,Mybatis错误:Parameter XXX not found. Available parameters are 1, 0, param1,param2伤心瘦子的专栏-CSDN博客parameter start not found. available parameters