package com.ruoyi.web.work.domain;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.util.Date;
/**
 * @author lsw
 * @date 2024-04-18
 */
@Data
@TableName(value = "tb_relate")
@Accessors(chain = true)
public class Relate{
    private static final long serialVersionUID = 1L;

    private Long id;

    @ApiModelProperty(value = "关联用户")
    private Long userId;

    @NotNull(message = "关联企业不能为空")
    @ApiModelProperty(value = "关联企业")
    private Long companyId;

    @ApiModelProperty(value = "状态:0=正常,1=停用")
    private Integer state;


    @TableField(fill = FieldFill.INSERT)
    private String createBy;

    @TableField(fill = FieldFill.UPDATE)
    private String updateBy;

    @TableField(fill = FieldFill.UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

    @TableField(exist = false)
    @ApiModelProperty(value = "姓名")
    @Excel(name = "姓名")
    private String name;

    @TableField(exist = false)
    @ApiModelProperty(value = "手机号")
    @Excel(name = "手机号")
    private String phone;

    @TableField(exist = false)
    @ApiModelProperty(value = "身份证")
    @Excel(name = "身份证",width = 30)
    private String idCard;

    @TableField(exist = false)
    @ApiModelProperty(value = "开户行")
    private String bankName;

    @TableField(exist = false)
    @ApiModelProperty(value = "银行卡账号")
    private String bankAccount;

    @TableField(exist = false)
    @ApiModelProperty(value = "支付宝")
    private String alipay;

    @ApiModelProperty(value = "是否签署合同:0=未签,1=已签")
    private Integer isContract;

    @NotBlank(message = "关联方式不能为空")
    @Pattern(regexp = "^(手动关联|扫码关联)$", message = "关联方式必须为'手动关联'或'扫码关联'")
    @Excel(name = "关联方式")
    private String way;

    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "关联时间",dateFormat = "yyyy-MM-dd HH:mm:ss", width = 30)
    private Date createTime;

}
