package com.vctgo.system.api.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.vctgo.common.core.annotation.Excel;
import com.vctgo.common.core.web.domain.KinderInfoPlatformBaseEntity;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import java.util.List;

/**
 * 班级设置对象 sys_class_setting
 *
 * @author caesar
 * @date 2023-05-30
 */
@Data
@TableName("sys_class_setting")
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class SysClassSetting extends KinderInfoPlatformBaseEntity {

    private static final long serialVersionUID = -7842624647767476575L;

    /**
     * 主键
     */
    @TableId
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    @Excel(name = "序号")
    @TableField(exist = false)
    private String index;

    @Excel(name = "班级名称")
    private String className;

    /**
     * 班级别名
     */
    @Excel(name = "班级别名")
    private String classAlias;

    /**
     * 入学年份
     */
    @Excel(name = "入学年份")
    private String enrollmentYear;

    /**
     * 绑定位置
     */
    @TableField(exist = false)
    @Excel(name = "绑定位置")
    private String bindLocationString;

    @TableField(exist = false)
    @Excel(name = "创建时间")
    private String date;

    /**
     * 所在年级
     */
    @NotBlank(message = "所在年级不能为空")
    @Pattern(regexp = "^[1-3]$", message = "所在年级传参有误")
    private String gradeIn;

    /**
     * 班级编号
     */
    @NotBlank(message = "班级编号不能为空")
    @Pattern(regexp = "^[1-9]\\d*$", message = "班级编号传参有误")
    private String classNumber;

    /**
     * 是否删除
     */
    private String isDeleted;


    //==========================================页面扩展=============================================
    /**
     * 教师名称
     */
    @TableField(exist = false)
    private String teacherName;

    /**
     * 幼儿总数
     */
    @TableField(exist = false)
    private String childhoodCount;

    /**
     * 位置列表
     */
    @TableField(exist = false)
    private String locationName;

    @TableField(exist = false)
    private String locationIdList;

    /**
     * 位置id
     */
    @TableField(exist = false)
    private Long locationId;

    @TableField(exist = false)
    private List<SysLocationSetting> sysLocationSettingList;

    /**
     * 班级名称说明
     */
    @TableField(exist = false)
    private String classAliasDesc;

    /**
     * 年级说明
     */
    @TableField(exist = false)
    private String gradeInDesc;

}
