From d33f24113cac070683002e0ed4174b075f057498 Mon Sep 17 00:00:00 2001 From: wuchunlei Date: Fri, 24 Nov 2023 14:50:16 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8C=BB=E6=A1=88=E6=B7=BB=E5=8A=A0=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/BookMedicalRecordsController.java | 12 +----------- .../book/entity/BookMedicalRecordsEntity.java | 6 ++---- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/src/main/java/com/peanut/modules/book/controller/BookMedicalRecordsController.java b/src/main/java/com/peanut/modules/book/controller/BookMedicalRecordsController.java index 9164f37e..d5dac974 100644 --- a/src/main/java/com/peanut/modules/book/controller/BookMedicalRecordsController.java +++ b/src/main/java/com/peanut/modules/book/controller/BookMedicalRecordsController.java @@ -64,12 +64,6 @@ public class BookMedicalRecordsController { @RequestMapping("/saveOrUpdate") public R save(@RequestBody BookMedicalRecordsEntity entity){ try { - if (entity.getSort()==null){ - entity.setSort(1); - } - if (entity.getDelFlag()==null){ - entity.setDelFlag(0); - } bookMedicalRecordsService.saveOrUpdate(entity); return R.ok(); }catch (Exception e) { @@ -82,11 +76,7 @@ public class BookMedicalRecordsController { @RequestMapping("/del") public R del(Integer medicalRecordsId){ try { - BookMedicalRecordsEntity entity = bookMedicalRecordsService.getOne( - new QueryWrapper() - .eq("medical_records_id", medicalRecordsId)); - entity.setDelFlag(1); - bookMedicalRecordsService.updateById(entity); + bookMedicalRecordsService.removeById(medicalRecordsId); return R.ok(); }catch (Exception e) { return R.error("删除失败:"+e.getMessage()); diff --git a/src/main/java/com/peanut/modules/book/entity/BookMedicalRecordsEntity.java b/src/main/java/com/peanut/modules/book/entity/BookMedicalRecordsEntity.java index 7ee8a242..355c45b4 100644 --- a/src/main/java/com/peanut/modules/book/entity/BookMedicalRecordsEntity.java +++ b/src/main/java/com/peanut/modules/book/entity/BookMedicalRecordsEntity.java @@ -1,9 +1,6 @@ package com.peanut.modules.book.entity; -import com.baomidou.mybatisplus.annotation.FieldFill; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.*; import lombok.Data; import java.io.Serializable; @@ -44,6 +41,7 @@ public class BookMedicalRecordsEntity implements Serializable { /** * 删除标志 */ + @TableLogic private Integer delFlag; }