mybatis的查询语句-foreach的使用

前言

传入的参数时map集合,但其中有 list 集合

service

  Map searchMap = new HashMap<>();
  searchMap.put("borrowId", borrowId);
  List stateList = new ArrayList<>();
  stateList.add(BorrowModel.STATE_PASS);
  stateList.add(BorrowModel.STATE_REPAY_FAIL);
  searchMap.put("stateList", stateList);
  Borrow borrow = clBorrowMapper.findByIdAndState(searchMap);

mapper

Borrow findByIdAndState(Map<String, Object> paramMap);

xml

你可能感兴趣的:(mybatis)