namespace SafeCampus.System;
[SugarTable("CameraGroup", TableDescription = "摄像头分组表")]
[Tenant(SqlSugarConst.DB_DEFAULT)]
[BatchEdit]
[CodeGen]
[IgnoreInitTable]
public class CameraGroup : PrimaryKeyEntity
{
    /// <summary>
    /// 分组名称
    /// </summary>
    [SugarColumn(ColumnName = "Name", ColumnDescription = "分组名称", ColumnDataType = StaticConfig.CodeFirst_BigString, IsNullable = false)]
    public string Name { get; set; }
    /// <summary>
    /// 父级id
    /// </summary>
    [SugarColumn(ColumnName = "ParentId", ColumnDescription = "父级id", IsNullable = true)]
    public long ParentId { get; set; }
    /// <summary>
    /// 子级
    /// </summary>
    [SugarColumn(IsIgnore = true)]
    public List<CameraGroup> Children { get; set; }
    /// <summary>
    /// 摄像头列表
    /// </summary>
    [Navigate(NavigateType.OneToMany, nameof(CameraInfo.GroupId))]
    public List<CameraInfo> CameraInfos { get; set; }
}