using Admin.Core.Common.BaseModel; using FreeSql.DataAnnotations; using System.Collections.Generic; namespace Admin.Core.Model.Personnel { /// /// 组织架构 /// [Table(Name = "pe_organization")] [Index("idx_{tablename}_01", nameof(ParentId) + "," + nameof(Name) + "," + nameof(TenantId), true)] public class OrganizationEntity : EntityFull, ITenant { /// /// 租户Id /// [Column(Position = -10, CanUpdate = false)] public long? TenantId { get; set; } /// /// 父级 /// public long ParentId { get; set; } [Navigate(nameof(ParentId))] public List Childs { get; set; } /// /// 名称 /// [Column(StringLength = 50)] public string Name { get; set; } /// /// 编码 /// [Column(StringLength = 50)] public string Code { get; set; } /// /// 值 /// [Column(StringLength = 50)] public string Value { get; set; } /// /// 主管Id /// public long? PrimaryEmployeeId { get; set; } /// /// 主管 /// public EmployeeEntity PrimaryEmployee { get; set; } /// /// 员工人数 /// public int EmployeeCount { get; set; } /// /// 描述 /// [Column(StringLength = 500)] public string Description { get; set; } /// /// 启用 /// public bool Enabled { get; set; } = true; /// /// 排序 /// public int Sort { get; set; } [Navigate(ManyToMany = typeof(EmployeeOrganizationEntity))] public ICollection Employees { get; set; } } }