fix: 修复逻辑删除字段冲突,status用于订单状态,deleted用于删除标记
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Agent
2026-03-27 16:15:33 +00:00
parent 289f3ce2ad
commit 8ae9200707
3 changed files with 14 additions and 4 deletions

View File

@@ -74,8 +74,10 @@ public class Order {
private BigDecimal discountRate; private BigDecimal discountRate;
/** /**
* 状态: 1已完成 2已取消 3退款中 4已退款 * 状态: 0未完成 1已完成 2已取消 3退款中 4已退款
*/ */
@TableField("status")
@TableLogic(value = "1", delval = "2") // 使用虚拟删除删除时改为2不再使用status作为逻辑删除字段
private Integer status; private Integer status;
/** /**
@@ -103,4 +105,10 @@ public class Order {
@TableField(fill = FieldFill.INSERT_UPDATE) @TableField(fill = FieldFill.INSERT_UPDATE)
private LocalDateTime updatedAt; private LocalDateTime updatedAt;
/**
* 删除标记: 0未删除 1已删除
*/
@TableField("deleted")
private Integer deleted;
} }

View File

@@ -43,9 +43,9 @@ mybatis-plus:
global-config: global-config:
db-config: db-config:
id-type: assign_uuid id-type: assign_uuid
logic-delete-field: status logic-delete-field: deleted
logic-delete-value: 0 logic-delete-value: 1
logic-not-delete-value: 1 logic-not-delete-value: 0
mapper-locations: classpath*:/mapper/**/*.xml mapper-locations: classpath*:/mapper/**/*.xml
type-aliases-package: com.example.building.entity type-aliases-package: com.example.building.entity

View File

@@ -0,0 +1,2 @@
-- 增加 deleted 字段用于逻辑删除
ALTER TABLE orders ADD COLUMN deleted INTEGER DEFAULT 0;