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.