SpringBoot 逻辑删除mybaiisPlus

@DeleteMapping
public R deleteMaterial(@RequestParam("ids") String idList){//idList=1,2,3,4
    log.debug("idList is " + idList);
    String[] ids = idList.split(",");
    if (ids.length == 1){
        materialService.update().setSql("is_deleted = 1").eq("id",ids[0]).update();
    }else {
        materialService.update().setSql("is_deleted = 1").inSql("id",idList).update();
    }
    return R.success(null);
}

你可能感兴趣的:(spring,boot,java,后端)