using SqlSugar;
namespace Entity.Base
{
///
/// 框架实体基类Id
///
public abstract class EntityBaseId
{
///
/// 雪花Id
///
[SugarColumn(ColumnName = "id", ColumnDescription = "主键Id", IsPrimaryKey = true, IsIdentity = false)]
public virtual long Id { get; set; }
}
///
/// 框架实体基类
///
[SugarIndex("index_{table}_CT", nameof(CreateTime), OrderByType.Asc)]
public abstract class EntityBase : EntityBaseId, IDeletedFilter
{
///
/// 创建时间
///
[SugarColumn(ColumnDescription = "创建时间", IsOnlyIgnoreUpdate = true, ColumnName = "create_time")]
public virtual DateTime? CreateTime { get; set; }
///
/// 更新时间
///
[SugarColumn(ColumnDescription = "更新时间", ColumnName = "update_time")]
public virtual DateTime? UpdateTime { get; set; }
///
/// 创建者Id
///
[SugarColumn(ColumnDescription = "创建者Id", IsOnlyIgnoreUpdate = true, ColumnName = "create_user_id")]
public virtual long? CreateUserId { get; set; }
///
/// 创建者姓名
///
[SugarColumn(ColumnDescription = "创建者姓名", Length = 64, IsOnlyIgnoreUpdate = true, ColumnName = "create_user_name")]
public virtual string? CreateUserName { get; set; }
///
/// 修改者Id
///
[SugarColumn(ColumnDescription = "修改者Id", ColumnName = "update_user_id")]
public virtual long? UpdateUserId { get; set; }
///
/// 修改者姓名
///
[SugarColumn(ColumnDescription = "修改者姓名", Length = 64, ColumnName = "update_user_name")]
public virtual string? UpdateUserName { get; set; }
///
/// 软删除
///
[SugarColumn(ColumnDescription = "软删除", ColumnName = "is_delete")]
public virtual bool IsDelete { get; set; } = false;
}
///
/// 业务数据实体基类(数据权限)
///
public abstract class EntityBaseData : EntityBase, IOrgIdFilter
{
///
/// 创建者部门Id
///
[SugarColumn(ColumnDescription = "创建者部门Id", IsOnlyIgnoreUpdate = true, ColumnName = "creat_org_id")]
public virtual long? CreateOrgId { get; set; }
///
/// 创建者部门名称
///
[SugarColumn(ColumnDescription = "创建者部门名称", Length = 64, IsOnlyIgnoreUpdate = true, ColumnName = "creat_org_name")]
public virtual string? CreateOrgName { get; set; }
}
}