56 lines
1.6 KiB
Java
56 lines
1.6 KiB
Java
|
|
package com.competition.common.entity;
|
|||
|
|
|
|||
|
|
import com.baomidou.mybatisplus.annotation.*;
|
|||
|
|
import lombok.Data;
|
|||
|
|
|
|||
|
|
import java.io.Serializable;
|
|||
|
|
import java.time.LocalDateTime;
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* 基础实体类,所有实体继承此类
|
|||
|
|
* 当前阶段使用现有数据库列名,新审计字段暂不映射(待 Flyway 迁移后启用)
|
|||
|
|
*/
|
|||
|
|
@Data
|
|||
|
|
public abstract class BaseEntity implements Serializable {
|
|||
|
|
|
|||
|
|
/** 主键 ID(自增) */
|
|||
|
|
@TableId(type = IdType.AUTO)
|
|||
|
|
private Long id;
|
|||
|
|
|
|||
|
|
// ====== 新审计字段(列尚未存在,暂不映射到数据库) ======
|
|||
|
|
|
|||
|
|
/** 创建人账号(待 Flyway V2 后启用) */
|
|||
|
|
@TableField(exist = false)
|
|||
|
|
private String createBy;
|
|||
|
|
|
|||
|
|
/** 更新人账号(待 Flyway V2 后启用) */
|
|||
|
|
@TableField(exist = false)
|
|||
|
|
private String updateBy;
|
|||
|
|
|
|||
|
|
/** 逻辑删除标识(待 Flyway V2 后启用) */
|
|||
|
|
@TableField(exist = false)
|
|||
|
|
private Integer deleted;
|
|||
|
|
|
|||
|
|
// ====== 现有审计字段(与当前数据库一致) ======
|
|||
|
|
|
|||
|
|
/** 创建人 ID */
|
|||
|
|
@TableField(value = "creator", fill = FieldFill.INSERT)
|
|||
|
|
private Integer creator;
|
|||
|
|
|
|||
|
|
/** 修改人 ID */
|
|||
|
|
@TableField(value = "modifier", fill = FieldFill.INSERT_UPDATE)
|
|||
|
|
private Integer modifier;
|
|||
|
|
|
|||
|
|
/** 创建时间 */
|
|||
|
|
@TableField(value = "create_time", fill = FieldFill.INSERT)
|
|||
|
|
private LocalDateTime createTime;
|
|||
|
|
|
|||
|
|
/** 修改时间(数据库列名为 modify_time) */
|
|||
|
|
@TableField(value = "modify_time", fill = FieldFill.INSERT_UPDATE)
|
|||
|
|
private LocalDateTime modifyTime;
|
|||
|
|
|
|||
|
|
/** 有效状态:1-有效,2-失效 */
|
|||
|
|
@TableField(value = "valid_state", fill = FieldFill.INSERT)
|
|||
|
|
private Integer validState;
|
|||
|
|
}
|