using iWareCommon.Common.Entity; using iWareCommon.Utils; using iWareDataCore.ORM; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace iWareDataCore.DEV.Entity { public class EquipmentTypeViewEntity : ICommonEntity { public int Id { get; set; } /// /// 设备名字 /// public string Name { get; set; } /// /// 设备备注 /// public string Remark { get; set; } /// /// 是否有引用 /// public int RefLabel { get; set; } /// /// 构造函数 /// public EquipmentTypeViewEntity() { } /// /// 构造函数 /// /// 角色 public EquipmentTypeViewEntity(DEVEquipmentTypeView role) { EntityPropHelper.CopyProp(role, this, GetColumnMap()); } /// /// 将对象转换成ORM中的类型 /// /// Orm中的角色类型 public DEVEquipmentTypeView ToOrm() { DEVEquipmentTypeView role = new DEVEquipmentTypeView(); EntityPropHelper.CopyProp(this, role, GetColumnMap()); return role; } /// /// 获取自定义角色类中的字段名为键,orm中对象的字段名为值的字段 /// /// public static Dictionary GetColumnMap() { return new Dictionary() { {"Id","id"}, {"Name", "name"}, {"Remark", "remark"}, {"RefLabel","reflabel"}, }; } /// /// 根据RoleEntity的字段转RBAC_Role的字段 /// /// RoleEntity的字段 /// RBAC_Role public static string GetColumnName(string name) { var columnMap = GetColumnMap(); return columnMap.ContainsKey(name) ? columnMap[name] : name; } /// /// 获取RoleEntity对于的表名 /// /// DEVEquipmentTypeView public static string GetTableName() { return "[dbo].[DEVEquipmentTypeView]"; } } }