namespace SafeCampus.System;
[SugarTable("Attendance", TableDescription = "无感考勤")]
[Tenant(SqlSugarConst.DB_DEFAULT)]
[BatchEdit]
[CodeGen]
//[IgnoreInitTable]
public class Attendance : PrimaryKeyEntity
{
    /// <summary>
    /// 租户id
    /// </summary>
    [SugarColumn(ColumnName = "TenantCode", ColumnDescription = "租户id", ColumnDataType = StaticConfig.CodeFirst_BigString, IsNullable = true)]
    public string TenantCode { get; set; }
    /// <summary>
    /// 门店id
    /// </summary>
    [SugarColumn(ColumnName = "PoiId", ColumnDescription = "门店id", ColumnDataType = StaticConfig.CodeFirst_BigString, IsNullable = true)]
    public string PoiId { get; set; }
    /// <summary>
    /// 考勤事件id
    /// </summary>
    [SugarColumn(ColumnName = "EventId", ColumnDescription = "考勤事件id", ColumnDataType = StaticConfig.CodeFirst_BigString, IsNullable = true)]
    public string EventId { get; set; }
    /// <summary>
    /// 人员跟踪id
    /// </summary>
    [SugarColumn(ColumnName = "TrackId", ColumnDescription = "人员跟踪id", ColumnDataType = StaticConfig.CodeFirst_BigString, IsNullable = true)]
    public string TrackId { get; set; }
    /// <summary>
    /// 关联底库id  如果为空，表示该人员未匹配到底库
    /// </summary>
    [SugarColumn(ColumnName = "PersonSetId", ColumnDescription = "关联底库id", ColumnDataType = StaticConfig.CodeFirst_BigString, IsNullable = true)]
    public string PersonSetId { get; set; }
    /// <summary>
    /// 人员id
    /// </summary>
    [SugarColumn(ColumnName = "PersonId", ColumnDescription = "人员id", ColumnDataType = StaticConfig.CodeFirst_BigString, IsNullable = true)]
    public string PersonId { get; set; }
    /// <summary>
    /// 是否自动上报
    /// </summary>
    [SugarColumn(ColumnName = "IsAuto", ColumnDescription = "是否自动上报", IsNullable = true)]
    public bool IsAuto { get; set; }
    /// <summary>
    /// 相似度
    /// </summary>
    [SugarColumn(ColumnName = "Similarity", ColumnDescription = "相似度",  IsNullable = true)]
    public float Similarity { get; set; }
    /// <summary>
    /// 摄像头id
    /// </summary>
    [SugarColumn(ColumnName = "CameraId", ColumnDescription = "摄像头id", ColumnDataType = StaticConfig.CodeFirst_BigString, IsNullable = true)]
    public string CameraId { get; set; }
    /// <summary>
    /// 人脸质量分，取值[0, 100]
    /// </summary>
    [SugarColumn(ColumnName = "FaceScore", ColumnDescription = "人脸质量分",  IsNullable = true)]
    public float FaceScore { get; set; }
    /// <summary>
    /// 人脸照片url，链接有效期为2小时
    /// </summary>
    [SugarColumn(ColumnName = "SnapshotUrl", ColumnDescription = "人脸照片url", ColumnDataType = StaticConfig.CodeFirst_BigString, IsNullable = true)]
    public string SnapshotUrl { get; set; }
    /// <summary>
    /// 人脸照片数据，base64编码（本地对接使用）
    /// </summary>
    [SugarColumn(ColumnName = "SnapshotData", ColumnDescription = "人脸照片数据", ColumnDataType = StaticConfig.CodeFirst_BigString, IsNullable = true)]
    public string SnapshotData { get; set; }
    /// <summary>
    /// 事件发生时间
    /// </summary>
    [SugarColumn(ColumnName = "Tick", ColumnDescription = "事件发生时间", IsNullable = false)]
    public DateTime Tick { get; set; }
    /// <summary>
    /// 目标在快照中的位置
    /// </summary>
    [SugarColumn(ColumnName = "Rects", ColumnDescription = "目标在快照中的位置", ColumnDataType = StaticConfig.CodeFirst_BigString, IsNullable = true)]
    public string Rects { get; set; }
    /// <summary>
    /// 目标是进来还是出去
    /// </summary>
    [SugarColumn(ColumnName = "InsOut", ColumnDescription = "目标是进来还是出去",  IsNullable = true)]
    public bool InsOut { get; set; }
    /// <summary>
    /// 人员扩展信息
    /// </summary>
    [SugarColumn(ColumnName = "Extend", ColumnDescription = "人员扩展信息", ColumnDataType = StaticConfig.CodeFirst_BigString, IsNullable = true)]
    public string Extend { get; set; }
    /// <summary>
    /// 创建时间
    /// </summary>
    [SugarColumn(ColumnName = "CreateTime", ColumnDescription = "创建时间", IsNullable = true)]
    public  DateTime CreateTime { get; set; }
    /// <summary>
    ///摄像头信息
    /// </summary>
    [Navigate(NavigateType.OneToOne, nameof(CameraId), nameof(CameraInfo.SensorId))]
    public CameraInfo CameraInfoItem { get; set; }
    /// <summary>
    /// 寝室信息
    /// </summary>
    [Navigate(NavigateType.OneToOne, nameof(PersonId), nameof(PersonInfo.PersonId))]
    public PersonInfo PersonInfoItem { get; set; }
}