using Microsoft.EntityFrameworkCore; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; namespace YBEE.EQM.Core; /// /// 学校班级 /// [Comment("学校班级")] public class SchoolClass : DEntityBase { /// /// 主键:1位学段+4位学校编码+4位入学年份+2位班号 /// [Comment("主键:1位学段+4位学校ID+4位入学年份+2位班号")] [Key, DatabaseGenerated(DatabaseGeneratedOption.None)] public override long Id { get; set; } /// /// 学校ID /// [Comment("学校ID")] [Required] public short SysOrgId { get; set; } /// /// 校区ID /// [Comment("校区ID")] public short? SysOrgBranchId { get; set; } /// /// 学段 /// [Comment("学段")] [Required, Column(TypeName = "smallint")] public EducationStage EducationStage { get; set; } /// /// 班号 /// [Comment("班号")] [Required] public short ClassNumber { get; set; } = 1; /// /// 名称:入学年份+级+班号+班,如2025级1班 /// [Comment("名称:入学年份+级+班号+班,如2025级1班")] [Required, StringLength(50)] public string Name { get; set; } /// /// 全称:学段名+入学年份+级+班号+班,如小学2025级1班 /// [Comment("全称:学段名+入学年份+级+班号+班,如小学2025级1班")] [Required, StringLength(100)] public string FullName { get; set; } /// /// 简称:班号+班,如1班 /// [Comment("简称:班号+班,如1班")] [Required, StringLength(50)] public string ShortName { get; set; } /// /// 年份(级) /// [Comment("年份(级)")] [Required] public short GradeBeginYear { get; set; } /// /// 年份(届) /// [Comment("年级年份")] [Required] public short GradeEndYear { get; set; } /// /// 学制 /// [Comment("学制")] [Required] public short EducationYears { 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 SysOrg { get; set; } /// /// 一对一引用(校区) /// public virtual SysOrg SysOrgBranch { get; set; } }