using Furion.DatabaseAccessor; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; using System; using System.ComponentModel; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; namespace YBEE.EQM.Core; /// /// 机构 /// [Comment("机构")] public partial class SysOrg : DEntityBase, IEntityTypeBuilder { /// /// 父机构ID /// [Comment("父机构ID")] [Required] public short Pid { get; set; } = 0; /// /// 父机构ID路径 /// [Comment("父机构ID路径")] [StringLength(200)] public string Pids { get; set; } = "[0]"; /// /// 机构类型 /// [Comment("机构类型")] [Required, Column(TypeName = "smallint")] public OrgType OrgType { get; set; } = OrgType.SCHOOL; /// /// 办学性质 /// [Comment("办学性质")] [Required, Column(TypeName = "smallint")] public OrgFundSource OrgFundSource { get; set; } = OrgFundSource.PUBLIC; /// /// 学段 /// [Comment("学段")] [Required, Column(TypeName = "smallint")] public EducationStage EducationStage { get; set; } = EducationStage.NONE; /// /// 城乡类型 /// [Comment("城乡类型")] [Required, Column(TypeName = "smallint")] public UrbanRuralType UrbanRuralType { get; set; } = UrbanRuralType.URBAN; /// /// 所属学区ID(机构ID) /// [Comment("所属学区ID(机构ID)")] public short? SchoolDistrictId { get; set; } /// /// 名称 /// [Comment("名称")] [Required, StringLength(100)] public string Name { get; set; } /// /// 名称 /// [Comment("名称")] [Required, StringLength(200)] public string FullName { get; set; } /// /// 简称 /// [Comment("简称")] [Required, StringLength(50)] public string ShortName { get; set; } /// /// 简称2 /// [Comment("简称2")] [StringLength(50)] public string ShortName2 { get; set; } = ""; /// /// 编码 /// [Comment("编码")] [Required, StringLength(20)] public string Code { get; set; } /// /// 带前缀唯一代码 /// [Comment("带前缀唯一代码")] [Required, StringLength(20)] public string UniqueCode { get; set; } /// /// TQES学校ID(兼容老系统) /// [Comment("TQES学校ID(兼容老系统)")] [StringLength(20)] public int? TqesId { get; set; } /// /// TQES学校编码(兼容老系统) /// [Comment("TQES学校编码(兼容老系统)")] [StringLength(20)] public string TqesCode { get; set; } = ""; /// /// 排序 /// [Description("排序")] [Required] public int Sort { get; set; } = 0; /// /// 经度 /// [Comment("经度")] public decimal Longitude { get; set; } = 0; /// /// 纬度 /// [Comment("纬度")] public decimal Latitude { get; set; } = 0; /// /// 地址 /// [Comment("地址")] public string Address { get; set; } = ""; /// /// 备注 /// [Comment("备注")] [StringLength(200)] public string Remark { get; set; } = ""; /// /// 状态 /// [Comment("状态")] [Required, Column(TypeName = "smallint")] public CommonStatus Status { get; set; } = CommonStatus.ENABLE; /// /// 一对一引用(所属学区,即机构) /// public virtual SysOrg SchoolDistrict { get; set; } public void Configure(EntityTypeBuilder entityBuilder, DbContext dbContext, Type dbContextLocator) { entityBuilder.Ignore(t => t.CreateSysUser).Ignore(t => t.UpdateSysUser); } }