package com.securitycontrol.entity.background.vo;

import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;

/**
 * @author 10488
 * 班组VO
 */
@Data
public class TeamManageVo {

    @ApiModelProperty(value = "班组ID")
    private String teamId;

    @ApiModelProperty(value = "班组名称")
    @NotBlank(message = "班组名称不能为空", groups = {Query.class})
    @Length(max = 80, message = "班组名称字符长度不能超过80", groups = {Query.class})
    private String teamName;

    @ApiModelProperty(value = "班组长")
    @NotBlank(message = "班组长不能为空", groups = {Query.class})
    @Length(max = 50, message = "班组长字符长度不能超过50", groups = {Query.class})
    private String teamLeader;

    @ApiModelProperty(value = "身份证编号")
    @NotBlank(message = "身份证号码不能为空", groups = {Query.class})
    @Length(max = 30, message = "身份证号码字符长度不能超过30", groups = {Query.class})
    @Pattern(regexp = "[1-9]\\d{5}(19|20)\\d{2}((01|03|05|07|08|10|12)(0[1-9]|[1-2]\\d|3[0-1])|(04|06|09|11)(0[1-9]|[1-2]\\d|30)|02(0[1-9]|[1-2]\\d))\\d{3}[\\dXx]",message = "身份证号码格式不正确",groups = {Query.class})
    private String idNumber;

    @ApiModelProperty(value = "手机号码")
    @NotBlank(message = "手机号码不能为空", groups = {Query.class})
    @Length(max = 20, message = "手机号码字符长度不能超过20", groups = {Query.class})
    @Pattern(regexp = "(0|86|17951)?(13[0-9]|19[0-9]|15[012356789]|17[678]|18[0-9]|14[57])[0-9]{8}",message = "手机号格式不正确",groups = {Query.class})
    private String teamLeaderPhone;

    @ApiModelProperty(value = "班组状态")
    private String status;

    @ApiModelProperty(value = "班组人数")
    private String teamNum;

    @ApiModelProperty(value = "工程编码")
    @NotBlank(message = "工程编码能为空", groups = {Query.class})
    @Length(max = 80, message = "工程编码字符长度不能超过80", groups = {Query.class})
    private String bidCode;

    @ApiModelProperty(value = "工程名称")
    private String proName;

    @ApiModelProperty(value = "1.新增 2.修改")
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private Integer type;

    /**
     * 查询条件限制
     */
    public interface Query {
    }
}
