using iWareCommon.Common.Entity; using iWareCommon.Utils; using iWareLog.ORM; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace iWareLog.COUNT.Entity { public class StackerReportEntity : ICommonEntity { /// /// 主键 /// public int Id { get; set; } /// /// 小车变化 /// public string Name { get; set; } /// /// 小车状态 /// public int Status { get; set; } /// /// 生成时间 /// public DateTime? CreateTime { get; set; } /// /// 结束时间 /// public DateTime? FinishTime { get; set; } /// /// 是否结束 /// public int IsFinished { get; set; } /// /// 构造函数 /// public StackerReportEntity() { } /// /// 构造函数 /// /// orm中的模型 public StackerReportEntity(COUNTStackerReport stackerReport) { EntityPropHelper.CopyProp(stackerReport, this, GetColumnMap()); } /// /// 获取自定义类SendMsgLogEntity的字段名为键,ORM对象中字段名为值的字段 /// /// public static Dictionary GetColumnMap() { return new Dictionary() { {"Id", "id"}, {"Name", "name"}, {"Status", "status"}, {"CreateTime", "createtime"}, {"FinishTime", "finishtime"}, {"IsFinished", "isfinished"} }; } /// /// 将SendMsgLogEntity实体转化为orm里面的COUNTStackerReport模型 /// /// orm中的LOGReceiveMsgLog模型 public COUNTStackerReport ToOrm() { var stackerReport = new COUNTStackerReport(); EntityPropHelper.CopyProp(this, stackerReport, GetColumnMap()); return stackerReport; } /// /// 根据SendMsgLogEntity的字段转COUNTStackerReport的字段 /// /// SendMsgLogEntity的字段 /// COUNTStackerReport public static string GetColumnName(string name) { var columnMap = GetColumnMap(); return columnMap.ContainsKey(name) ? columnMap[name] : name; } /// /// 获取SendMsgLogEntity对应的表名 /// /// COUNTStackerReport public static string GetTableName() { return "[dbo].[COUNTStackerReport]"; } } }