package jnpf.limsEntity; import com.baomidou.mybatisplus.annotation.FieldStrategy; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; import java.util.Date; /** * LIMS 业务操作日志实体。 *
* 表结构详见 {@code tasks/lims-biz-log-ddl.sql},设计详见 {@code tasks/biz-log-design.md}。 *
* 不继承 {@code SuperEntity},因为日志表字段语义与 SuperEntity 默认审计字段不一致 * (日志本身就是审计记录,无需 lastModify*;creatorUserId/creatorTime 我们重命名为 operatorUserId/creatorTime)。 */ @Data @TableName("lims_biz_log") public class LimsBizLogEntity { @TableId(value = "id", type = IdType.ASSIGN_ID) private String id; /** * 自增序号,运维排查使用,业务代码不依赖。 *
由 PG 列的 {@code GENERATED BY DEFAULT AS IDENTITY} 生成,不是 Java 侧填充—— * {@code insertStrategy = FieldStrategy.NEVER} 让 insert 语句完全不提这一列,交给 * identity 兜底。之前误标 {@code fill = FieldFill.INSERT}(照抄了平台 {@code f_} 前缀标准 * 字段的写法,但没有任何 MetaObjectHandler 认识这个 LIMS 自建字段名),导致该列在 INSERT * 里被显式绑成 null——MySQL 的 AUTO_INCREMENT 遇显式 NULL 会自动生成,但 PG 的 IDENTITY * 只在语句完全不提该列时才生效,遇显式 NULL 直接拒绝,是 MySQL→PG 迁移遗留 bug(同 L043 一族)。 */ @TableField(value = "log_seq", insertStrategy = FieldStrategy.NEVER) private Long logSeq; @TableField("biz_code") private String bizCode; @TableField("biz_type") private String bizType; @TableField("source_model_id") private String sourceModelId; @TableField("source_data_id") private String sourceDataId; @TableField("action_type") private String actionType; @TableField("action_label") private String actionLabel; /** {@link jnpf.limsEntity.bizlog.VisualLogModel} 数组的 JSON 字符串 */ @TableField("data_log") private String dataLog; /** 自由结构元数据 JSON */ @TableField("extra_json") private String extraJson; @TableField("operator_user_id") private String operatorUserId; @TableField("operator_org_id") private String operatorOrgId; @TableField("creator_time") private Date creatorTime; @TableField("tenant_id") private String tenantId; @TableField("delete_mark") private Integer deleteMark; }