You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

185 lines
5.6 KiB
C#

1 year ago
using System.ComponentModel;
using SqlSugar;
1 year ago
namespace DS.Module.Core.Data;
/// <summary>
/// 实体类基类
/// </summary>
public abstract class BaseModel<TKey> : IDeleted
1 year ago
{
/// <summary>
/// 主键ID
/// </summary>
[Description("主键ID")]
[SugarColumn(IsPrimaryKey = true, ColumnDescription = "主键ID")]
1 year ago
public TKey Id { get; set; }
/// <summary>
/// 备注
/// </summary>
[Description("备注")]
[SugarColumn(IsNullable = true, ColumnDescription = "备注", Length = 200)]
1 year ago
public string Note { get; set; }
/// <summary>
/// 创建时间
/// </summary>
[Description("创建时间")]
[SugarColumn(IsOnlyIgnoreUpdate = true, ColumnDescription = "创建时间")]
11 months ago
public DateTime CreateTime { get; set; }
1 year ago
/// <summary>
/// 创建人
/// </summary>
[Description("创建人")]
[SugarColumn(IsOnlyIgnoreUpdate = true, IsNullable = true, ColumnDescription = "创建人")]
9 months ago
public long CreateBy { get; set; }
1 year ago
/// <summary>
/// 创建人名称
/// </summary>
[Description("创建人名称")]
[SugarColumn(IsOnlyIgnoreUpdate = true, IsNullable = true, ColumnDescription = "创建人名称", Length = 50)]
public string CreateUserName { get; set; }
1 year ago
/// <summary>
/// 修改人
/// </summary>
[Description("修改人")]
[SugarColumn(IsNullable = true, ColumnDescription = "修改人")]
9 months ago
public long UpdateBy { get; set; }
/// <summary>
/// 修改人名称
/// </summary>
[Description("修改人名称")]
[SugarColumn(IsNullable = true, ColumnDescription = "修改人名称", Length = 50)]
public string UpdateUserName { get; set; }
1 year ago
/// <summary>
/// 更新时间
/// </summary>
[Description("更新时间")]
[SugarColumn(IsNullable = true, ColumnDescription = "更新时间")]
1 year ago
public DateTime UpdateTime { get; set; }
/// <summary>
/// 删除
/// </summary>
[Description("删除")]
[SugarColumn(ColumnDescription = "是否删除")]
11 months ago
public bool Deleted { get; set; } = false;
/// <summary>
/// 删除人名称
/// </summary>
[Description("删除人名称")]
[SugarColumn(IsNullable = true, ColumnDescription = "删除人名称", Length = 50)]
public string DeleteUserName { get; set; }
1 year ago
/// <summary>
/// 删除时间
/// </summary>
[Description("删除时间")]
[SugarColumn(IsNullable = true, ColumnDescription = "删除时间")]
1 year ago
public DateTime DeleteTime { get; set; }
/// <summary>
/// 删除人
/// </summary>
[Description("删除人")]
[SugarColumn(IsNullable = true, ColumnDescription = "删除人")]
9 months ago
public long DeleteBy { get; set; }
11 months ago
// /// <summary>
// /// 租户Id
// /// </summary>
// [SqlSugar.SugarColumn(ColumnDescription = "租户Id", IsOnlyIgnoreUpdate = true)]
// public long TenantId { get; set; } = 0;
}
/// <summary>
/// 实体类基类
/// </summary>
public abstract class BaseModelV2<TKey> : IDeleted
{
/// <summary>
/// 主键ID
/// </summary>
[Description("主键ID")]
[SugarColumn(IsPrimaryKey = true, ColumnDescription = "主键ID")]
public TKey Id { get; set; }
/// <summary>
/// 备注
/// </summary>
[Description("备注")]
[SugarColumn(IsNullable = true, ColumnDescription = "备注", Length = 200)]
public string? Note { get; set; }
/// <summary>
/// 创建时间
/// </summary>
[Description("创建时间")]
[SugarColumn(IsOnlyIgnoreUpdate = true, ColumnDescription = "创建时间")]
public DateTime CreateTime { get; set; }
/// <summary>
/// 创建人
/// </summary>
[Description("创建人")]
[SugarColumn(IsOnlyIgnoreUpdate = true, IsNullable = true, ColumnDescription = "创建人")]
public long CreateBy { get; set; }
/// <summary>
/// 修改人
/// </summary>
[Description("修改人")]
[SugarColumn(IsNullable = true, ColumnDescription = "修改人")]
public long? UpdateBy { get; set; }
/// <summary>
/// 更新时间
/// </summary>
[Description("更新时间")]
[SugarColumn(IsNullable = true, ColumnDescription = "更新时间")]
public DateTime? UpdateTime { get; set; }
/// <summary>
/// 删除
/// </summary>
[Description("删除")]
[SugarColumn(ColumnDescription = "是否删除", DefaultValue = "0")]
public bool Deleted { get; set; }
/// <summary>
/// 删除时间
/// </summary>
[Description("删除时间")]
[SugarColumn(IsNullable = true, ColumnDescription = "删除时间", IsOnlyIgnoreInsert = true)]
public DateTime? DeleteTime { get; set; }
/// <summary>
/// 删除人
/// </summary>
[Description("删除人")]
[SugarColumn(IsNullable = true, ColumnDescription = "删除人", IsOnlyIgnoreInsert = true)]
public long? DeleteBy { get; set; }
/// <summary>
/// 创建人名称
/// </summary>
[Description("创建人名称")]
[SugarColumn(IsOnlyIgnoreUpdate = true, IsNullable = true, ColumnDescription = "创建人名称", Length = 50)]
public string? CreateUserName { get; set; }
/// <summary>
/// 修改人名称
/// </summary>
[Description("修改人名称")]
[SugarColumn(IsNullable = true, ColumnDescription = "修改人名称", Length = 50)]
public string? UpdateUserName { get; set; }
/// <summary>
/// 删除人名称
/// </summary>
[Description("删除人名称")]
[SugarColumn(IsNullable = true, ColumnDescription = "删除人名称", Length = 50, IsOnlyIgnoreInsert = true)]
public string? DeleteUserName { get; set; }
1 year ago
}