using Admin.Core.Common.BaseModel;
using Admin.Core.Model.Admin;
using Admin.Core.Model.Enums;
using FreeSql.DataAnnotations;
using System;
using System.Collections.Generic;
namespace Admin.Core.Model.Personnel
{
///
/// 员工
///
[Table(Name = "pe_employee")]
[Index("idx_{tablename}_01", nameof(Code) + "," + nameof(TenantId), true)]
public class EmployeeEntity : EntityFull, ITenant
{
///
/// 租户Id
///
[Column(Position = -10)]
public long? TenantId { get; set; }
public TenantEntity Tenant { get; set; }
///
/// 用户Id
///
public long? UserId { get; set; }
public UserEntity User { get; set; }
///
/// 姓名
///
[Column(StringLength = 20)]
public string Name { get; set; }
///
/// 昵称
///
[Column(StringLength = 20)]
public string NickName { get; set; }
///
/// 性别
///
public Sex? Sex { get; set; }
///
/// 工号
///
[Column(StringLength = 20)]
public string Code { get; set; }
///
/// 主属部门Id
///
public long OrganizationId { get; set; }
public OrganizationEntity Organization { get; set; }
///
/// 主管Id
///
public long? PrimaryEmployeeId { get; set; }
///
/// 主管
///
public EmployeeEntity PrimaryEmployee { get; set; }
///
/// 职位Id
///
public long PositionId { get; set; }
public PositionEntity Position { get; set; }
///
/// 手机号
///
[Column(StringLength = 20)]
public string Phone { get; set; }
///
/// 邮箱
///
[Column(StringLength = 250)]
public string Email { get; set; }
///
/// 入职时间
///
public DateTime? EntryTime { get; set; }
[Navigate(ManyToMany = typeof(EmployeeOrganizationEntity))]
public ICollection Organizations { get; set; }
}
}