简化以下代码, largeRuleStifService.updateBatch(1000, lrsList, obj -> Wrappers.lambdaUpdate(new LargeRuleStifPO()) .set(LargeRuleStifPO::getRepTp , obj.getRepTp()) .set(LargeRuleStifPO::getRfnm, obj.getRfnm()) .set(LargeRuleStifPO::getMendSt, obj.getMendSt()) .set(LargeRuleStifPO::getRpst, obj.getRpst()) .eq(LargeRuleStifPO::getCsnm, obj.getCsnm()) .eq(LargeRuleStifPO::getHtdt, obj.getHtdt()) .eq(LargeRuleStifPO::getCrcd, obj.getCrcd()) .eq(LargeRuleStifPO::getTicd, obj.getTicd()) .eq(LargeRuleStifPO::getSpcsSt, "1") .eq(LargeRuleStifPO::getMendSt, "3") );
时间: 2024-02-10 20:11:33 浏览: 57
可以使用方法引用来简化代码:
```
largeRuleStifService.updateBatch(1000, lrsList, obj -> {
LargeRuleStifPO largeRuleStifPO = new LargeRuleStifPO();
largeRuleStifPO.setRepTp(obj.getRepTp());
largeRuleStifPO.setRfnm(obj.getRfnm());
largeRuleStifPO.setMendSt(obj.getMendSt());
largeRuleStifPO.setRpst(obj.getRpst());
return Wrappers.lambdaUpdate(largeRuleStifPO)
.eq(LargeRuleStifPO::getCsnm, obj.getCsnm())
.eq(LargeRuleStifPO::getHtdt, obj.getHtdt())
.eq(LargeRuleStifPO::getCrcd, obj.getCrcd())
.eq(LargeRuleStifPO::getTicd, obj.getTicd())
.eq(LargeRuleStifPO::getSpcsSt, "1")
.eq(LargeRuleStifPO::getMendSt, "3");
});
```
这样可以避免每次都创建一个新的 `LargeRuleStifPO` 对象。同时,使用方法引用可以使代码更加简洁易读。
阅读全文