软删除
软化删除就是只在页面删除 但是数据库还是存在得
代码
@DeleteMapping(value = "/delete")
@RequiresPermissions("prBidding:delete")
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
PrBidding prBidding=new PrBidding();
prBidding.setId(id);
prBidding.setDeleted(YesOrNoConstant.DELETED);
prBiddingService.updateById(prBidding);
// prBiddingService.removeById(id);
return Result.ok("删除成功!");
}
批量 软删除
代码
@DeleteMapping(value = "/deleteBatch")
@RequiresPermissions("prBidding:deleteBatch")
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
PrBidding prBidding=new PrBidding();
prBidding.setDeleted(YesOrNoConstant.DELETED);
UpdateWrapper<PrBidding> prBiddingUpdateWrapper=new UpdateWrapper<>();
prBiddingUpdateWrapper.in("id",Arrays.asList(ids.split(",")));
this.prBiddingService.update(prBidding,prBiddingUpdateWrapper);
return Result.ok("批量删除成功!");
}