错误:Parameter '0' not found.Available parameters are [arg1, arg0, param1, param2]的解决方法

时间:2022-07-24 22:58:35

调用的方法:

  List<Card> temp = cardService.queryRepeat(Type,shop);

xml:

  <select id="queryRepeat" parameterType="String" resultType="Card">
      select * from card where card_type=#{type} and shop=#{shop}
   </select>

此時报错:Parameter '0' not found.Available parameters are [arg1, arg0, param1, param2]

解决方法:

  <select id="queryRepeat" parameterType="String" resultType="Card">
      select * from card where card_type=#{arg0} and shop=#{arg1}
   </select>