日期:2014-05-20 浏览次数:20810 次
[Key]
public int ID { get; set; }
[Display(Name = "员工")]
[Required(ErrorMessage = "*")]
public string StaffNo { get; set; }
[Display(Name = "调动时间")]
[Required(ErrorMessage = "*")]
public DateTime TransferDate { get; set; }
[Display(Name = "调出公司")]
[Required(ErrorMessage = "*")]
public int OutCompanyID { get; set; }
[Display(Name = "调出部门")]
[Required(ErrorMessage = "*")]
public int OutDeptID { get; set; }
[Display(Name = "调出岗位")]
[Required(ErrorMessage = "*")]
public int OutPositionID { get; set; }
[Display(Name = "调入公司")]
[Required(ErrorMessage = "*")]
public int InCompanyID { get; set; }
[Display(Name = "调入部门")]
[Required(ErrorMessage = "*")]
public int InDeptID { get; set; }
[Display(Name = "调入岗位")]
[Required(ErrorMessage = "*")]
public int InPositionID { get; set; }
[Key]
public int ID { get; set; }
[Display(Name = "岗位名称")]
[Required(ErrorMessage = "*")]
[StringLength(15, ErrorMessage = "不能超过15个字符")]
public string Name { get; set; }
[Display(Name = "所属部门")]
public int DeptID { get; set; }
[ForeignKey("DeptID")]
public virtual BaseOrganization Organization { get; set; }
[Key]
public int ID { get; set; }
[Display(Name = "机构名称")]
[Required(ErrorMessage = "*")]
public string Name { get; set; }
[Display(Name = "机构编号")]
[Required(ErrorMessage = "*")]
public string Code { get; set; }
[Display(Name = "排序号")]
[Required(ErrorMessage = "*")]
public int SortNumber { get; set; }
[Display(Name = "所属机构")]
[Required(ErrorMessage = "*")]
public int ParentID { get; set; }
select a.ID,a.StaffNo,
a.OutPositionID,b.Name as OutPositionName,b.DeptID as OutDeptID,c.Name as OutDeptName,
d.ID as OutCompanyID,d.Name as OutCompanyName,
a.InPositionID,e.Name as InPositionName,e.DeptID as InDeptID,f.Name as InDeptName,
g.ID as InCompanyID,g.Name as InCompanyName
from
T a
left join P b on a.OutPositionID = b.ID
left join D c on b.DeptID = c.ID
left join D d on substring(c.Code,0,3) = d.Code
left join P e on a.InPositionID = e.ID