/** * 借款单核销单据查询接口 * @Param param * @Return BaseResponse<List<LendBillReportBO>> * **/ @PostMapping("/searchAllLendBillReports") public BaseResponse<List<LendBillReportBO>> searchAllLendBillReports(@RequestBody String param) { try { Instant start = Instant.now(); if (StringUtils.isEmpty(param)) { return BaseResponse.fail("参数为必填!"); } List<String> list = JSON.parseObject(param, List.class); Map<String, Object> paraMap = new HashMap<>(); paraMap.put("billNos", list); List<LendBillReportBO> lendBillReportBOS = settlementExcuteManager.searchAllLendBillReports(paraMap); Instant end = Instant.now(); log.info("借款单核销单据查询-成功,list{},耗时:{}", JSONUtil.toJSONString(lendBillReportBOS), Duration.between(start, end).toMillis() + "毫秒!"); return BaseResponse.success(lendBillReportBOS); } catch (Exception e) { e.printStackTrace(); log.error("SettlementController____searchAllLendBillReports:借款单核销单据查询-失败!" + e.getMessage()); return BaseResponse.fail("借款单核销单据查询-失败!"+e.getMessage()); } } }
sql部分:
BM.BILL_NO IN <foreach item="billNo" index="index" collection="billNos" open="(" separator="," close=")"> #{billNo} </foreach>
collection的集合名应该和map中的集合名称相对应