Springboot整合Mybatis多条件查询报错
org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.binding.BindingException: Parameter 'istrue' not found. Available parameters are [isTrue, param5, supplierId, param6, eTime, state, param3, sTime, param4, param1, purchaseNumber, param2]
很明显报了参数istrue找不到,找了很久也没找到错误原因,网上很多人说是多参数查询是要加
@Param("supplierId") Integer supplierId ,但我加了,还是报错,最后在mapper文件中的
<if test="istrue != null">
AND t_purchase_list.istrue= #{istrue}
</if>
@Test
public void contextLoads() {
Map<String,Object> result = new HashMap<>();
List<PurchaseList> purchaseListList = purchaseListGoodsDao.getPutPurchaselist(null,null,null,null,null,null);
发现错误,istrue没有大写,找不到参数中的isTrue.
博客讲述了Springboot整合Mybatis进行多条件查询时出现报错,具体为找不到参数'istrue',经查找发现是参数大小写问题,实际参数为'isTrue'。
2223





