出错详细信息:
org.apache.ibatis.binding.BindingException: Parameter 'productId' not found. Available parameters are [pageable, abcProduct, param1, param2]
原因:
1 mapper接口文件中,多个参数时,没有加 @Param("abcProduct") AbcProduct abcProduct 注解
2 相应的xml文件中,也要做相应的修改,abcProduct.productId,abcProduct.productPrice的形式
下面的修改的正确的写法,代码不全,只是展示如何修正:
List<AbcProduct> queryAllByLimit(@Param("abcProduct") AbcProduct abcProduct,
@Param("pageable") Pageable pageable);
<if test="abcProduct.productStock != null">
and product_stock = #{abcProduct.productStock}
</if>
</where>
limit #{pageable.offset}, #{pageable.pageSize}
</select>