SysOrg.cs 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. // 大名科技(天津)有限公司版权所有 电话:18020030720 QQ:515096995
  2. //
  3. // 此源代码遵循位于源代码树根目录中的 LICENSE 文件的许可证
  4. namespace Admin.NET.Core;
  5. /// <summary>
  6. /// 系统机构表
  7. /// </summary>
  8. [SugarTable(null, "系统机构表")]
  9. [SysTable]
  10. [SugarIndex("index_{table}_N", nameof(Name), OrderByType.Asc)]
  11. [SugarIndex("index_{table}_C", nameof(Code), OrderByType.Asc)]
  12. [SugarIndex("index_{table}_T", nameof(Type), OrderByType.Asc)]
  13. public partial class SysOrg : EntityTenant
  14. {
  15. /// <summary>
  16. /// 父Id
  17. /// </summary>
  18. [SugarColumn(ColumnDescription = "父Id")]
  19. public long Pid { get; set; }
  20. /// <summary>
  21. /// 名称
  22. /// </summary>
  23. [SugarColumn(ColumnDescription = "名称", Length = 64)]
  24. [Required, MaxLength(64)]
  25. public virtual string Name { get; set; }
  26. /// <summary>
  27. /// 编码
  28. /// </summary>
  29. [SugarColumn(ColumnDescription = "编码", Length = 64)]
  30. [MaxLength(64)]
  31. public string? Code { get; set; }
  32. /// <summary>
  33. /// 级别
  34. /// </summary>
  35. [SugarColumn(ColumnDescription = "级别")]
  36. public int? Level { get; set; }
  37. /// <summary>
  38. /// 机构类型-数据字典
  39. /// </summary>
  40. [SugarColumn(ColumnDescription = "机构类型", Length = 64)]
  41. [MaxLength(64)]
  42. public string? Type { get; set; }
  43. /// <summary>
  44. /// 负责人Id
  45. /// </summary>
  46. [SugarColumn(ColumnDescription = "负责人Id", IsNullable = true)]
  47. public long? DirectorId { get; set; }
  48. /// <summary>
  49. /// 负责人
  50. /// </summary>
  51. [Newtonsoft.Json.JsonIgnore]
  52. [System.Text.Json.Serialization.JsonIgnore]
  53. [Navigate(NavigateType.OneToOne, nameof(DirectorId))]
  54. public SysUser Director { get; set; }
  55. /// <summary>
  56. /// 排序
  57. /// </summary>
  58. [SugarColumn(ColumnDescription = "排序")]
  59. public int OrderNo { get; set; } = 100;
  60. /// <summary>
  61. /// 状态
  62. /// </summary>
  63. [SugarColumn(ColumnDescription = "状态")]
  64. public StatusEnum Status { get; set; } = StatusEnum.Enable;
  65. /// <summary>
  66. /// 备注
  67. /// </summary>
  68. [SugarColumn(ColumnDescription = "备注", Length = 128)]
  69. [MaxLength(128)]
  70. public string? Remark { get; set; }
  71. /// <summary>
  72. /// 机构子项
  73. /// </summary>
  74. [SugarColumn(IsIgnore = true)]
  75. public List<SysOrg> Children { get; set; }
  76. /// <summary>
  77. /// 是否禁止选中
  78. /// </summary>
  79. [SugarColumn(IsIgnore = true)]
  80. public bool Disabled { get; set; }
  81. }