今天在使用的时候,遇到了这个错误
Parameter ‘tagIdList’ not found. Available parameters are [Collection,list]
repository接口中
public List<Tag> findAllById(List tagIdList);
mapper.xml中
<select id="findAllById" parameterType="java.util.List" resultType="Tag" >
select * from t_tag
<where>
<foreach item="id" separator="," collection="tagIdList" open="id in (" close=")">
#{id}
</foreach>
</where>
</select>
错误解决方法:接口中加上一个注解
public List<Tag> findAllById(@Param("tagIdList")List tagIdList);