当在mybatis框架的xml映射文件中使用的查询语句包含多个参数时, 报出此错误。
<select id="selectAllAlarms" resultMap="resultMap" parameterType="Integer">
select * from alarm order by now_time desc limit #{startIndex},#{pageSize}
</select>
解决方法:
为方法中的参数加上注解以指定参数名称
List<Alarm> selectAllAlarms(@Param("startIndex") int startIndex, @Param("pageSize") int pageSize) throws Exception;//limit ?,?