Daily error (2): Mybatis Error - Parameter 'XXX' not found Available parameters are [1, 0, param1, param2].

1, before modification codes:

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

修改后的代码:
    @Select("select * from fruitsell where f_id=#{0} and u_id=#{1}")
    public Fruitsell finbyfruitsell(Long f_id,Long u_id);

In this manner into 0,1,2,3 sequence matching.

2、

 Error: $ {Name}
right: $ {name}

Since the EL read attribute getter methods, generally in accordance with the first letter in lowercase processing properties.

3、 

    @Select ( "SELECT * WHERE F_ID from fruitsell F_ID = {# #} and U_ID = {} U_ID")
    public Fruitsell finbyfruitsell (@Param ( "F_ID") Long F_ID, the Param @ ( "F_ID") Long U_ID);
plus a @Param comment on it.
 

发布了22 篇原创文章 · 获赞 6 · 访问量 4883

Guess you like

Origin blog.csdn.net/qq_37651252/article/details/97961209