UpdateWrapper 加语句

UpdateWrapper<LogisticsOrderCharge> chargeUpdateWrapper = new UpdateWrapper<>();
chargeUpdateWrapper.set("update_time",new Date());
if(costType == LogisticsCostTypeEnum.DEPOSIT.getCode()) {
chargeUpdateWrapper.setSql("paid_amount = paid_amount + " + realPaymentAmount);
} else {
chargeUpdateWrapper.setSql("paid_remain_amount = paid_remain_amount + " + realPaymentAmount);
}
chargeUpdateWrapper.eq("id", orderCharge.getId());
orderChargeService.update(chargeUpdateWrapper);
 
posted @ 2021-12-30 11:17  八英里  阅读(367)  评论(0编辑  收藏  举报