SchoolClass.cs 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. using Microsoft.EntityFrameworkCore;
  2. using System.ComponentModel.DataAnnotations;
  3. using System.ComponentModel.DataAnnotations.Schema;
  4. namespace YBEE.EQM.Core;
  5. /// <summary>
  6. /// 学校班级
  7. /// </summary>
  8. [Comment("学校班级")]
  9. public class SchoolClass : DEntityBase<long>
  10. {
  11. /// <summary>
  12. /// 主键:1位学段+4位学校编码+4位入学年份+2位班号
  13. /// </summary>
  14. [Comment("主键:1位学段+4位学校ID+4位入学年份+2位班号")]
  15. [Key, DatabaseGenerated(DatabaseGeneratedOption.None)]
  16. public override long Id { get; set; }
  17. /// <summary>
  18. /// 学校ID
  19. /// </summary>
  20. [Comment("学校ID")]
  21. [Required]
  22. public short SysOrgId { get; set; }
  23. /// <summary>
  24. /// 校区ID
  25. /// </summary>
  26. [Comment("校区ID")]
  27. public short? SysOrgBranchId { get; set; }
  28. /// <summary>
  29. /// 学段
  30. /// </summary>
  31. [Comment("学段")]
  32. [Required, Column(TypeName = "smallint")]
  33. public EducationStage EducationStage { get; set; }
  34. /// <summary>
  35. /// 班号
  36. /// </summary>
  37. [Comment("班号")]
  38. [Required]
  39. public short ClassNumber { get; set; } = 1;
  40. /// <summary>
  41. /// 名称:入学年份+级+班号+班,如2025级1班
  42. /// </summary>
  43. [Comment("名称:入学年份+级+班号+班,如2025级1班")]
  44. [Required, StringLength(50)]
  45. public string Name { get; set; }
  46. /// <summary>
  47. /// 全称:学段名+入学年份+级+班号+班,如小学2025级1班
  48. /// </summary>
  49. [Comment("全称:学段名+入学年份+级+班号+班,如小学2025级1班")]
  50. [Required, StringLength(100)]
  51. public string FullName { get; set; }
  52. /// <summary>
  53. /// 简称:班号+班,如1班
  54. /// </summary>
  55. [Comment("简称:班号+班,如1班")]
  56. [Required, StringLength(50)]
  57. public string ShortName { get; set; }
  58. /// <summary>
  59. /// 年份(级)
  60. /// </summary>
  61. [Comment("年份(级)")]
  62. [Required]
  63. public short GradeBeginYear { get; set; }
  64. /// <summary>
  65. /// 年份(届)
  66. /// </summary>
  67. [Comment("年级年份")]
  68. [Required]
  69. public short GradeEndYear { get; set; }
  70. /// <summary>
  71. /// 学制
  72. /// </summary>
  73. [Comment("学制")]
  74. [Required]
  75. public short EducationYears { get; set; }
  76. /// <summary>
  77. /// 备注
  78. /// </summary>
  79. [Comment("备注")]
  80. [StringLength(200)]
  81. public string Remark { get; set; }
  82. /// <summary>
  83. /// 状态
  84. /// </summary>
  85. [Comment("状态")]
  86. [Required, Column(TypeName = "smallint")]
  87. public CommonStatus Status { get; set; } = CommonStatus.ENABLE;
  88. /// <summary>
  89. /// 一对一引用(机构)
  90. /// </summary>
  91. public virtual SysOrg SysOrg { get; set; }
  92. /// <summary>
  93. /// 一对一引用(校区)
  94. /// </summary>
  95. public virtual SysOrg SysOrgBranch { get; set; }
  96. }