程序其他sql都执行正常,也写了@param注解,但是还是一直报parameter ‘id’ not found。最后发现是调用sql的实现类里ids的入参对象名称不叫ids,叫idList
代码如下:
List<Map<String,String>> result=mapper.sql(date,ids);---就是这里的入参跟mapper不一致
List<A> sql(@Param("date") Integer date,@Param("ids")List<String> ids);
<select id="sql" resultType="java.util.Map">
select a,b,c from tablewhere date>=#{date}and id in (<foreach collection="ids" item="id" seperator=",">#{id}</foreach>)
</select>