using SqlSugar; using System; namespace EntrustSettle.Model; [SugarIndex("index_{table}_IsDeleted", nameof(IsDeleted), OrderByType.Asc)] public class BaseEntity : RootEntityTkey, IDeleteFilter { /// /// 是否逻辑删除 /// public bool IsDeleted { get; set; } #region 创建 /// /// 创建者ID /// [SugarColumn(IsOnlyIgnoreUpdate = true)] public string CreateId { get; set; } /// /// 创建者名称 /// [SugarColumn(IsOnlyIgnoreUpdate = true)] public string CreateBy { get; set; } /// /// 创建时间 /// [SugarColumn(IsOnlyIgnoreUpdate = true)] public DateTime CreateTime { get; set; } = DateTime.Now; #endregion #region 修改 /// /// 修改者ID /// [SugarColumn(IsOnlyIgnoreInsert = true)] public string ModifyId { get; set; } /// /// 修改者名称 /// [SugarColumn(IsOnlyIgnoreInsert = true)] public string ModifyBy { get; set; } /// /// 修改时间 /// // [SugarColumn(IsOnlyIgnoreInsert = true)] 因为存在新增时赋值的情况,所以不加此特性 public DateTime? ModifyTime { get; set; } #endregion }