diff --git a/Java/BSupplierServiceImpl.java b/Java/BSupplierServiceImpl.java new file mode 100644 index 0000000000000000000000000000000000000000..95fcf6d4a19472db44d5965eaa9ab8098e776a8d --- /dev/null +++ b/Java/BSupplierServiceImpl.java @@ -0,0 +1,19 @@ + +// 明明只是按需求过滤状态,怎么查询就永远只有10条记录呢 +public TableDataInfo selectPage(BSupplier query, PageQuery pageQuery) { + Page page = baseMapper.selectPage(pageQuery.build(), wrapper(query)); + TableDataInfo dataInfo = TableDataInfo.build(page); + List rows = dataInfo.getRows(); + if (CollUtil.isNotEmpty(rows)) { + // 如果是状态0 就把不是0的干掉 + if ("0".equals(query.getMonthRt())){ + rows.removeIf(e -> !"0".equals(e.getMonthRt())); + // 如果是状态1 就把不是1的干掉 + }else if ("1".equals(query.getMonthRt())){ + rows.removeIf(e -> !"1".equals(e.getMonthRt())); + } + dataInfo.setRows(rows); + dataInfo.setTotal(rows.size()); + } + return dataInfo; +} \ No newline at end of file