SysOrg.cs 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. using Furion.DatabaseAccessor;
  2. using Microsoft.EntityFrameworkCore;
  3. using Microsoft.EntityFrameworkCore.Metadata.Builders;
  4. using System;
  5. using System.ComponentModel;
  6. using System.ComponentModel.DataAnnotations;
  7. using System.ComponentModel.DataAnnotations.Schema;
  8. namespace YBEE.EQM.Core;
  9. /// <summary>
  10. /// 机构
  11. /// </summary>
  12. [Comment("机构")]
  13. public partial class SysOrg : DEntityBase<short>, IEntityTypeBuilder<SysOrg>
  14. {
  15. /// <summary>
  16. /// 父机构ID
  17. /// </summary>
  18. [Comment("父机构ID")]
  19. [Required]
  20. public short Pid { get; set; } = 0;
  21. /// <summary>
  22. /// 父机构ID路径
  23. /// </summary>
  24. [Comment("父机构ID路径")]
  25. [StringLength(200)]
  26. public string Pids { get; set; } = "[0]";
  27. /// <summary>
  28. /// 机构类型
  29. /// </summary>
  30. [Comment("机构类型")]
  31. [Required, Column(TypeName = "smallint")]
  32. public OrgType OrgType { get; set; } = OrgType.SCHOOL;
  33. /// <summary>
  34. /// 办学性质
  35. /// </summary>
  36. [Comment("办学性质")]
  37. [Required, Column(TypeName = "smallint")]
  38. public OrgFundSource OrgFundSource { get; set; } = OrgFundSource.PUBLIC;
  39. /// <summary>
  40. /// 学段
  41. /// </summary>
  42. [Comment("学段")]
  43. [Required, Column(TypeName = "smallint")]
  44. public EducationStage EducationStage { get; set; } = EducationStage.NONE;
  45. /// <summary>
  46. /// 城乡类型
  47. /// </summary>
  48. [Comment("城乡类型")]
  49. [Required, Column(TypeName = "smallint")]
  50. public UrbanRuralType UrbanRuralType { get; set; } = UrbanRuralType.URBAN;
  51. /// <summary>
  52. /// 所属学区ID(机构ID)
  53. /// </summary>
  54. [Comment("所属学区ID(机构ID)")]
  55. public short? SchoolDistrictId { get; set; }
  56. /// <summary>
  57. /// 名称
  58. /// </summary>
  59. [Comment("名称")]
  60. [Required, StringLength(100)]
  61. public string Name { get; set; }
  62. /// <summary>
  63. /// 名称
  64. /// </summary>
  65. [Comment("名称")]
  66. [Required, StringLength(200)]
  67. public string FullName { get; set; }
  68. /// <summary>
  69. /// 简称
  70. /// </summary>
  71. [Comment("简称")]
  72. [Required, StringLength(50)]
  73. public string ShortName { get; set; }
  74. /// <summary>
  75. /// 简称2
  76. /// </summary>
  77. [Comment("简称2")]
  78. [StringLength(50)]
  79. public string ShortName2 { get; set; } = "";
  80. /// <summary>
  81. /// 编码
  82. /// </summary>
  83. [Comment("编码")]
  84. [Required, StringLength(20)]
  85. public string Code { get; set; }
  86. /// <summary>
  87. /// 带前缀唯一代码
  88. /// </summary>
  89. [Comment("带前缀唯一代码")]
  90. [Required, StringLength(20)]
  91. public string UniqueCode { get; set; }
  92. /// <summary>
  93. /// TQES学校ID(兼容老系统)
  94. /// </summary>
  95. [Comment("TQES学校ID(兼容老系统)")]
  96. [StringLength(20)]
  97. public int? TqesId { get; set; }
  98. /// <summary>
  99. /// TQES学校编码(兼容老系统)
  100. /// </summary>
  101. [Comment("TQES学校编码(兼容老系统)")]
  102. [StringLength(20)]
  103. public string TqesCode { get; set; } = "";
  104. /// <summary>
  105. /// 排序
  106. /// </summary>
  107. [Description("排序")]
  108. [Required]
  109. public int Sort { get; set; } = 0;
  110. /// <summary>
  111. /// 经度
  112. /// </summary>
  113. [Comment("经度")]
  114. public decimal Longitude { get; set; } = 0;
  115. /// <summary>
  116. /// 纬度
  117. /// </summary>
  118. [Comment("纬度")]
  119. public decimal Latitude { get; set; } = 0;
  120. /// <summary>
  121. /// 地址
  122. /// </summary>
  123. [Comment("地址")]
  124. public string Address { get; set; } = "";
  125. /// <summary>
  126. /// 备注
  127. /// </summary>
  128. [Comment("备注")]
  129. [StringLength(200)]
  130. public string Remark { get; set; } = "";
  131. /// <summary>
  132. /// 状态
  133. /// </summary>
  134. [Comment("状态")]
  135. [Required, Column(TypeName = "smallint")]
  136. public CommonStatus Status { get; set; } = CommonStatus.ENABLE;
  137. /// <summary>
  138. /// 一对一引用(所属学区,即机构)
  139. /// </summary>
  140. public virtual SysOrg SchoolDistrict { get; set; }
  141. public void Configure(EntityTypeBuilder<SysOrg> entityBuilder, DbContext dbContext, Type dbContextLocator)
  142. {
  143. entityBuilder.Ignore(t => t.CreateSysUser).Ignore(t => t.UpdateSysUser);
  144. }
  145. }