2026-04-02 14:05:41 +08:00
|
|
|
|
package com.competition.common.entity;
|
|
|
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.annotation.*;
|
2026-04-07 21:52:32 +08:00
|
|
|
|
import io.swagger.v3.oas.annotations.media.Schema;
|
2026-04-02 14:05:41 +08:00
|
|
|
|
import lombok.Data;
|
|
|
|
|
|
|
|
|
|
|
|
import java.io.Serializable;
|
|
|
|
|
|
import java.time.LocalDateTime;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 基础实体类,所有实体继承此类
|
2026-04-02 14:57:26 +08:00
|
|
|
|
* 包含新审计字段(Java规范)和旧审计字段(过渡期兼容)
|
2026-04-02 14:05:41 +08:00
|
|
|
|
*/
|
|
|
|
|
|
@Data
|
2026-04-07 21:52:32 +08:00
|
|
|
|
@Schema(description = "基础实体")
|
2026-04-02 14:05:41 +08:00
|
|
|
|
public abstract class BaseEntity implements Serializable {
|
|
|
|
|
|
|
|
|
|
|
|
/** 主键 ID(自增) */
|
2026-04-07 21:52:32 +08:00
|
|
|
|
@Schema(description = "主键ID")
|
2026-04-02 14:05:41 +08:00
|
|
|
|
@TableId(type = IdType.AUTO)
|
|
|
|
|
|
private Long id;
|
|
|
|
|
|
|
2026-04-02 14:57:26 +08:00
|
|
|
|
// ====== 新审计字段(Java 规范) ======
|
2026-04-02 14:05:41 +08:00
|
|
|
|
|
2026-04-02 14:57:26 +08:00
|
|
|
|
/** 创建人账号 */
|
2026-04-07 21:52:32 +08:00
|
|
|
|
@Schema(description = "创建人账号")
|
2026-04-02 14:57:26 +08:00
|
|
|
|
@TableField(value = "create_by", fill = FieldFill.INSERT)
|
2026-04-02 14:05:41 +08:00
|
|
|
|
private String createBy;
|
|
|
|
|
|
|
2026-04-02 14:57:26 +08:00
|
|
|
|
/** 更新人账号 */
|
2026-04-07 21:52:32 +08:00
|
|
|
|
@Schema(description = "更新人账号")
|
2026-04-02 14:57:26 +08:00
|
|
|
|
@TableField(value = "update_by", fill = FieldFill.INSERT_UPDATE)
|
2026-04-02 14:05:41 +08:00
|
|
|
|
private String updateBy;
|
|
|
|
|
|
|
2026-04-02 14:57:26 +08:00
|
|
|
|
/** 逻辑删除标识(0-未删除,1-已删除) */
|
2026-04-07 21:52:32 +08:00
|
|
|
|
@Schema(description = "逻辑删除标识:0-未删除,1-已删除")
|
2026-04-02 14:57:26 +08:00
|
|
|
|
@TableLogic
|
|
|
|
|
|
@TableField(value = "deleted", fill = FieldFill.INSERT)
|
2026-04-02 14:05:41 +08:00
|
|
|
|
private Integer deleted;
|
|
|
|
|
|
|
2026-04-09 12:52:39 +08:00
|
|
|
|
// ====== 旧审计字段(过渡期保留,请使用 createBy/updateBy) ======
|
2026-04-02 14:05:41 +08:00
|
|
|
|
|
2026-04-09 12:52:39 +08:00
|
|
|
|
/** 创建人 ID(已弃用,请使用 createBy) */
|
|
|
|
|
|
@Deprecated
|
|
|
|
|
|
@Schema(description = "创建人ID(已弃用,请使用 createBy)")
|
2026-04-02 14:05:41 +08:00
|
|
|
|
@TableField(value = "creator", fill = FieldFill.INSERT)
|
|
|
|
|
|
private Integer creator;
|
|
|
|
|
|
|
2026-04-09 12:52:39 +08:00
|
|
|
|
/** 修改人 ID(已弃用,请使用 updateBy) */
|
|
|
|
|
|
@Deprecated
|
|
|
|
|
|
@Schema(description = "修改人ID(已弃用,请使用 updateBy)")
|
2026-04-02 14:05:41 +08:00
|
|
|
|
@TableField(value = "modifier", fill = FieldFill.INSERT_UPDATE)
|
|
|
|
|
|
private Integer modifier;
|
|
|
|
|
|
|
|
|
|
|
|
/** 创建时间 */
|
2026-04-07 21:52:32 +08:00
|
|
|
|
@Schema(description = "创建时间")
|
2026-04-02 14:05:41 +08:00
|
|
|
|
@TableField(value = "create_time", fill = FieldFill.INSERT)
|
|
|
|
|
|
private LocalDateTime createTime;
|
|
|
|
|
|
|
2026-04-02 14:57:26 +08:00
|
|
|
|
/** 修改时间 */
|
2026-04-07 21:52:32 +08:00
|
|
|
|
@Schema(description = "修改时间")
|
2026-04-02 14:05:41 +08:00
|
|
|
|
@TableField(value = "modify_time", fill = FieldFill.INSERT_UPDATE)
|
|
|
|
|
|
private LocalDateTime modifyTime;
|
|
|
|
|
|
|
|
|
|
|
|
/** 有效状态:1-有效,2-失效 */
|
2026-04-07 21:52:32 +08:00
|
|
|
|
@Schema(description = "有效状态:1-有效,2-失效")
|
2026-04-02 14:05:41 +08:00
|
|
|
|
@TableField(value = "valid_state", fill = FieldFill.INSERT)
|
|
|
|
|
|
private Integer validState;
|
|
|
|
|
|
}
|