using Cksoft.Unity;
using System;
namespace DllEapEntity
{
[Table("Machine")]
public class Machine:BaseEntity
{
////自动产生代码开始&&此行不能删除
#region 自动产生代码
public Machine()
{
base.EntityStatusID = 1;
}
[ColDetail(10,"厂商代码",1,0,60,1,"e.FCode","editSupplierFCode",1,1)]
public string SupplierFCode { get; set; }
[ColDetail(30,"代码",1,1,60,1,"a.FCode","editFCode",1,1)]
public string FCode { get; set; }
[ColDetail(40,"名称",1,1,100,1,"a.FName","editFName",1,1)]
public string FName { get; set; }
[ColDetail(50,"IP地址",1,1,100,1,"a.IPAddress","editIPAddress",1,1)]
public string IPAddress { get; set; }
[ColDetail(60,"端口",1,1,60,1,"a.FPort","editFPort",1,1)]
public int? FPort { get; set; }
[ColDetail(70,"设备ID",1,1,60,1,"a.DeviceID","editDeviceID",1,1)]
public int? DeviceID { get; set; }
[ColDetail(80,"T3",1,1,60,1,"a.T3","editT3",1,1)]
public int T3 { get; set; }
[ColDetail(90,"T5",1,1,60,1,"a.T5","editT5",1,1)]
public int T5 { get; set; }
[ColDetail(100,"T6",1,1,60,1,"a.T6","editT6",1,1)]
public int T6 { get; set; }
[ColDetail(110,"T7",1,1,60,1,"a.T7","editT7",1,1)]
public int T7 { get; set; }
[ColDetail(120,"T8",1,1,60,1,"a.T8","editT8",1,1)]
public int T8 { get; set; }
[ColDetail(130,"备注",1,1,200,1,"a.Remark","editRemark",1,1)]
public string Remark { get; set; }
[ColDetail(140,"录入人代码",1,1,60,1,"a.RecCode","",1,1)]
public string RecCode { get; set; }
[ColDetail(150,"录入日期",1,1,100,1,"a.RecTime","editRecTime",1,1)]
public DateTime RecTime { get; set; }
[ColDetail(160,"修改 人代码",1,1,60,1,"a.ModCode","",1,1)]
public string ModCode { get; set; }
[ColDetail(170,"修改时间",1,1,100,1,"a.ModTime","editModTime",1,1)]
public DateTime ModTime { get; set; }
[ColDetail(180,"录入人",1,0,60,1,"b.FName","editRecName",1,1)]
public string RecName { get; set; }
[ColDetail(190,"修改人",1,0,60,1,"c.FName","editModName",1,1)]
public string ModName { get; set; }
[ColDetail(10000,"主键ID",0,1,100,1,"a.ID","",1,1)]
[Key]
[Identity]
public int ID { get; set; }
[ColDetail(10000,"机型ID",0,1,100,1,"a.MModeID","editMModeCode",1,2)]
public int MModeID { get; set; }
[ColDetail(10010,"机型代码",1,0,100,1,"d.FCode","editMModeCode",1,1)]
public string MModeCode { get; set; }
[ColDetail(10020,"机型名称",1,0,100,1,"d.FName","editMModeName",1,1)]
public string MModeName { get; set; }
[ColDetail(10030,"厂商ID",0,0,100,1,"d.SupplierID","editSupplierFCode",1,2)]
public int SupplierID { get; set; }
[ColDetail(10040,"是否连接",1,1,100,1,"a.IsConn","",1,1)]
public int? IsConn { get; set; }
[ColDetail(10050,"IsControl",1,1,100,1,"a.IsControl","",1,1)]
public int? IsControl { get; set; }
[ColDetail(10060,"是否进行产量分析",1,1,100,1,"a.IsAnalysis","",1,1)]
public int? IsAnalysis { get; set; }
[ColDetail(10070,"FCode",1,0,100,1,"g.FCode","",1,1)]
public string PCode { get; set; }
[ColDetail(10080,"FName",1,0,100,1,"g.FName","",1,1)]
public string PName { get; set; }
[ColDetail(10090,"扫描枪IP",1,1,100,1,"a.ScanIp","",1,1)]
public string ScanIp { get; set; }
[ColDetail(10100,"调程模式ID",1,1,100,1,"a.CallPMode","",1,1)]
public int? CallPMode { get; set; }
[ColDetail(10110,"本地路径",1,1,100,1,"a.LocDir","",1,1)]
public string LocDir { get; set; }
[ColDetail(10120,"ID",1,0,100,1,"g.ID","",1,1)]
public int ProcessId { get; set; }
[ColDetail(10130,"IsRemoveProgram",1,1,100,1,"a.IsRemoveProgram","",1,1)]
public int? IsRemoveProgram { get; set; }
[ColDetail(10140,"名称",1,0,100,1,"h.FName","",1,1)]
public string CallPModeFName { get; set; }
[ColDetail(10150,"MacAddress",1,1,100,1,"a.MacAddress","",1,1)]
public string MacAddress { get; set; }
[ColDetail(10160,"RegionId",1,1,100,1,"a.RegionId","",1,1)]
public int RegionId { get; set; }
[ColDetail(10170,"厂区ID",1,1,100,1,"a.FactoryId","",1,1)]
public int FactoryId { get; set; }
[ColDetail(10180,"名称",1,0,100,1,"i.FName","",1,1)]
public string FactoryName { get; set; }
[ColDetail(10190,"Source",1,1,100,1,"a.Source","",1,1)]
public string Source { get; set; }
[ColDetail(10200,"真实IP",1,1,100,1,"a.RealIP","",1,1)]
public string RealIP { get; set; }
[ColDetail(10210,"楼层Id",1,0,100,1,"j.ParentId","",1,1)]
public int FloorId { get; set; }
[ColDetail(10220,"线体名称",1,0,100,1,"j.FName","",1,1)]
public string LineName { get; set; }
[ColDetail(10230,"楼层名称",1,0,100,1,"k.FName","",1,1)]
public string FloorName { get; set; }
[ColDetail(10230, "厂房名称", 1, 0, 100, 1, "l.FName", "", 1, 1)]
public string PlantName { get; set; }
[ColDetail(10240, "机台软件版本", 1, 1, 100, 1, "a.FVersion", "", 1, 1)]
public string FVersion { get; set; }
[ColDetail(10260, "小程序状态 1启动 2未启动", 1, 1, 100, 1, "a.AppletS", "", 1, 1)]
public int AppletS { get; set; }
[ColDetail(10270, "待机程序版本", 1, 1, 100, 1, "a.AppletV", "", 1, 1)]
public string AppletV { get; set; }
public string macnumber { get; set; }
public override string GetSelectSql()
{
return string.Format($"select { GetQueryColSql()} from { GetQueryTabSql()}");
}
public override string GetQueryColSql()
{
string sqlstr = "e.FCode SupplierFCode,a.FCode FCode,a.FName FName,machinenumber.macnumber macnumber,a.IPAddress IPAddress,a.FPort FPort,a.DeviceID DeviceID,a.T3 T3,a.T5 T5,a.T6 T6,a.T7 T7";
sqlstr += ",a.T8 T8,a.Remark Remark,a.RecCode RecCode,a.RecTime RecTime,a.ModCode ModCode,a.ModTime ModTime,b.FName RecName,c.FName ModName,a.ID ID";
sqlstr += ",a.MModeID MModeID,d.FCode MModeCode,d.FName MModeName,d.SupplierID SupplierID,a.IsConn IsConn,a.IsControl IsControl,a.IsAnalysis IsAnalysis";
sqlstr += ",g.FCode PCode,g.FName PName,a.ScanIp ScanIp,a.CallPMode CallPMode,a.LocDir LocDir,g.ID ProcessId,a.IsRemoveProgram IsRemoveProgram";
sqlstr += ",h.FName CallPModeFName,a.MacAddress MacAddress,a.RegionId RegionId,a.FactoryId FactoryId,i.FName FactoryName,a.Source Source,a.RealIP RealIP";
sqlstr += ",j.ParentId FloorId,j.FName LineName,k.FName FloorName,0 EntityStatusID,a.fversion fversion,l.FName PlantName,a.AppletS AppletS,a.AppletV AppletV ";
return sqlstr;
}
public override string GetQueryTabSql()
{
string sqlstr=" Machine a ";
sqlstr+=" left outer join staff b on a.RecCode =b.FCode";
sqlstr+=" left outer join staff c on a.ModCode =c.FCode";
sqlstr+=" left outer join macmodel d on a.MModeID =d.id";
sqlstr+=" left outer join supplier e on d.SupplierID =e.id";
sqlstr+=" left outer join mactprocess f on a.id =f.macid";
sqlstr+=" left outer join tprocess g on f.PCode =g.FCode";
sqlstr+=" left outer join constitem h on a.CallPMode =h.subid and h.preid=14";
sqlstr+=" left outer join factoryregion i on a.factoryid =i.id";
sqlstr+=" left outer join factoryregion j on a.regionid =j.id";
sqlstr+=" left outer join factoryregion k on j.parentid =k.id ";
sqlstr += " left outer join factoryregion l on k.parentid =l.id ";
sqlstr += "left join machinenumber on a.id=machinenumber.macid";
return sqlstr;
}
public override string GetQuerySortSql()
{
return " ";
}
#endregion
////自动产生代码结束&&此行不能删除
///
/// 区域名称
///
[Ignore]
public string RegionName { get; set; }
[Ignore]
public string Floor { get; set; }
[Ignore]
public string Line { get; set; }
[Ignore]
public string ProRootPath { get; set; }
///
/// 是否为虚拟机台
///
[Ignore]
public int IsVirtual { get; set; }
///
/// 厂房Id
///
[Ignore]
public int PlantId { get; set; }
}
}