package com.xinyilu.system.domain.studentInfo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.xinyilu.common.core.domain.BaseEntity;
import com.xinyilu.common.custominterface.Insert;
import com.xinyilu.common.custominterface.Query;
import com.xinyilu.common.custominterface.Update;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.time.LocalDate;

/**
 * 学生信息对象 student_info
 *
 * @author jihan
 * @date 2022-08-01
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "学生信息对象", description = "student_info")
public class StudentInfo extends BaseEntity implements Serializable {
    private static final long serialVersionUID = 2265032068568372714L;
    /**
     * 主键id
     */
    @NotNull(message = "主键id不能位空", groups = {Update.class})
    private Long id;

    /**
     * 幼儿园表id
     */
    private Long kindergartenId;

    /**
     * 班级表id
     */
    @ApiModelProperty(value = "班级表id")
    @NotNull(message = "所属班级不能位空", groups = {Insert.class, Update.class, Query.class})
    private Long classId;

    /**
     * 民族所属字典表id
     */
    @ApiModelProperty(value = "民族所属字典表id")
    @NotNull(message = "所属民族不能为空", groups = {Insert.class, Update.class, Query.class})
    private Long nationDictId;

    /**
     * 学生姓名表
     */
    @ApiModelProperty(value = "学生姓名表")
    @NotBlank(message = "学生姓名不能为空", groups = {Insert.class, Update.class, Query.class})
    private String studentName;

    /**
     * 学生性别，MALE：男，女：FEMALE
     */
    @ApiModelProperty(value = "学生性别，MALE：男，女：FEMALE")
    @NotBlank(message = "学生性别不能为空", groups = {Insert.class, Update.class, Query.class})
    private String studentSex;

    /**
     * 学生编号
     */
    @ApiModelProperty(value = "学生编号")
    private String studentNumber;

    /**
     * 出生日期
     */
    @ApiModelProperty(value = "出生日期")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @NotNull(message = "出生日期不能为空", groups = {Insert.class, Update.class, Query.class})
    private LocalDate birthDate;

    /**
     * 身份证号
     */
    @ApiModelProperty(value = "身份证号")
    @Size(min = 0, max = 18, message = "身份证号最大长度位18位", groups = {Insert.class, Update.class, Query.class})
    private String cardNumber;

    /**
     * 曾用名
     */
    @ApiModelProperty(value = "曾用名")
    private String onceName;

    /**
     * 家庭住址
     */
    @ApiModelProperty(value = "家庭住址")
    private String homeAddress;

    /**
     * 是否删除，0：否，1：是
     */
    private Integer delFlag;

    /**
     * 用户表id
     */
    private Long userId;

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("classId", getClassId())
                .append("nationDictId", getNationDictId())
                .append("studentName", getStudentName())
                .append("studentSex", getStudentSex())
                .append("studentNumber", getStudentNumber())
                .append("birthDate", getBirthDate())
                .append("cardNumber", getCardNumber())
                .append("onceName", getOnceName())
                .append("homeAddress", getHomeAddress())
                .append("delFlag", getDelFlag())
                .append("createBy", getCreateBy())
                .append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime())
                .toString();
    }
}
