package com.xinelu.manage.domain.nursestationdepartment;

import com.xinelu.common.annotation.Excel;
import com.xinelu.common.core.domain.BaseDomain;
import com.xinelu.common.custominterface.Insert;
import com.xinelu.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 org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * 护理站部门信息对象 nurse_station_department
 *
 * @author xinyilu
 * @date 2022-09-13
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "护理站部门信息对象", description = "nurse_station_department")
public class NurseStationDepartment extends BaseDomain {
    private static final long serialVersionUID = 1L;

    /**
     * 主键id
     */
    @NotNull(message = "护理站科室id不能为空", groups = {Update.class})
    private Long id;

    /**
     * 护理站表id
     */
    @ApiModelProperty(value = "护理站表id")
    @Excel(name = "护理站表id")
    @NotNull(message = "护理站表id不能为空", groups = {Insert.class, Update.class})
    private Long nurseStationId;

    /**
     * 科室编码
     */
    @ApiModelProperty(value = "科室编码")
    @Excel(name = "科室编码")
    private String departmentCode;

    /**
     * 科室名称
     */
    @NotBlank(message = "科室名称不能为空", groups = {Insert.class, Update.class})
    @ApiModelProperty(value = "科室名称")
    @Excel(name = "科室名称")
    @Length(max = 20, message = "科室名称不能超过20位", groups = {Insert.class, Update.class})
    private String departmentName;

    /**
     * 科室负责人名称
     */
    @NotBlank(message = "科室负责人名称不能为空", groups = {Insert.class, Update.class})
    @ApiModelProperty(value = "科室负责人名称")
    @Excel(name = "科室负责人名称")
    @Length(max = 20, message = "科室负责人名称不能超过20位", groups = {Insert.class, Update.class})
    private String departmentPerson;

    /**
     * 联系电话
     */
    @NotBlank(message = "联系电话不能为空", groups = {Insert.class})
    @Length(max = 11, message = "手机号码不能超过11位", groups = {Insert.class, Update.class})
    @ApiModelProperty(value = "联系电话")
    @Excel(name = "联系电话")
    private String phone;


    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("nurseStationId", getNurseStationId())
                .append("departmentCode", getDepartmentCode())
                .append("departmentName", getDepartmentName())
                .append("departmentPerson", getDepartmentPerson())
                .append("phone", getPhone())
                .append("createBy", getCreateBy())
                .append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime())
                .toString();
    }
}