mapper接口方法:

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

mybatis 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]

解决方法1:

List<Card> temp = cardService.queryRepeat(@param(“type”) String type,@param(“shop”) String shop);

解决方法2:

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

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐