mybatisplus 条件 and(多条件问题)

发布时间 2024-01-12 11:08:56作者: 何一徐一
LambdaQueryWrapper<DnfProcessDnfInfo> wrapper = Wrappers.lambdaQuery();
wrapper.and(i -> {
if (pnlList.size() > 1) {
for (int j = 0; j < pnlList.size(); j++) {
if (j == 0) {
i.in(DnfProcessDnfInfo::getPnlId, pnlList.get(j));
} else {
i.or().in(DnfProcessDnfInfo::getPnlId, pnlList.get(j));
}
}
} else {
i.in(DnfProcessDnfInfo::getPnlId, pnlList.get(0));
}
stripList.forEach(j -> {
i.or().in(DnfProcessDnfInfo::getStripId, j);
});
});