using SqlSugar;
using System;
namespace ProductionSystem_Model
{
[Serializable]
public class BaseModel
{
public BaseModel()
{
Id = Guid.NewGuid().ToString();
IsActive = true;
CreatedTime = DateTime.Now;
}
///
/// 主键
///
[SugarColumn(ColumnName = "id", IsPrimaryKey = true, IsNullable = false)]
public string Id { get; set; }
///
/// 备注
///
[SugarColumn(ColumnName = "remark")]
public string Remark { get; set; }
///
/// 数据状态
/// 1—可用,0—不可用
///
[SugarColumn(ColumnName = "isactive")]
public bool IsActive { get; set; } = true;
///
/// 创建时间
///
[SugarColumn(ColumnName = "createdtime", IsOnlyIgnoreUpdate = true)]
public DateTime CreatedTime { get; set; } = DateTime.Now;
///
/// 创建者
///
[SugarColumn(ColumnName = "createdby", IsOnlyIgnoreUpdate = true)]
public string CreatedBy { get; set; }
///
/// 最后一次修改时间
///
[SugarColumn(ColumnName = "updatedtime", IsOnlyIgnoreInsert = true)]
public DateTime? UpdatedTime { get; set; }
///
/// 最后一次修改者
///
[SugarColumn(ColumnName = "updatedby", IsOnlyIgnoreInsert = true)]
public string UpdatedBy { get; set; }
}
}