using DataTransmission.Entity; using SqlSugar; namespace Hotline.Settings { [SugarTable("system_area")] public class SystemArea: CreationSoftDeleteEntity { /// /// 区域名称 /// public string AreaName { get; set; } /// /// 上级ID /// [SugarColumn(IsNullable = true)] public string ParentId { get; set; } /// /// 简称 /// public string AreaNameAbbreviation { get; set; } /// /// 是否可以修改 /// [SugarColumn(DefaultValue = "f")] public bool IsCanModify { get; set; } [SugarColumn(IsIgnore = true)] public List Children { get; set; } } public static class AreaExtensions { /// /// 获取最末级区域对应编码(最后2位) /// /// /// /// public static string GetLastAreaCode(this string areaCode) { if (areaCode.Length < 6) throw new Exception("非法区域编码"); return areaCode.Substring(areaCode.Length - 2, 2); } } }