package com.storlead.sales.pojo.entity.mail;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.storlead.framework.mybatis.entity.SysBaseField;
import com.storlead.mail.pojo.entity.MailAttachmentEntity;
import com.baomidou.mybatisplus.annotation.TableId;
import java.util.Date;
import java.util.List;

import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * <p>
 * 客户联系人关联邮箱
 * </p>
 *
 * @author chenkq
 * @since 2024-08-29
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("customer_mail_record")
@ApiModel(value="CustomerMailRecordEntity对象", description="客户联系人关联邮箱")
public class CustomerMailRecordEntity extends SysBaseField {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键id")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "绑定的邮件")
    @TableField("mail_id")
    private Long mailId;

    @ApiModelProperty(value = "显示顺序")
    @TableField("msg_num")
    private Integer msgNum;

    @ApiModelProperty(value = "客户id")
    @TableField("customer_id")
    private Long customerId;

    @ApiModelProperty(value = "联系人id")
    @TableField("liaison_id")
    private Long liaisonId;

//    @ApiModelProperty(value = "跟进主键id(0表示已跟进，null表示未跟进)")
//    @TableField("follow_up_id")
//    private Long followUpId;
//
//    @ApiModelProperty(value = "进出标记（1进2出）")
//    @TableField("in_out_mark")
//    private Integer inOutMark;

    @ApiModelProperty(value = "主题")
    @TableField("subject")
    private String subject;

    @ApiModelProperty(value = "发件人邮箱")
    @TableField("`from`")
    private String from;

    @ApiModelProperty(value = "发件人名")
    @TableField("from_name")
    private String fromName;

    @ApiModelProperty(value = "收件人邮箱")
    @TableField("recipient")
    private String recipient;

    @ApiModelProperty(value = "收件人邮箱")
    @TableField("recipient_name")
    private String recipientName;

    @ApiModelProperty(value = "抄送人邮箱")
    @TableField("recipient_cc")
    private String recipientCc;

    @ApiModelProperty(value = "抄送人邮箱")
    @TableField("recipient_cc_name")
    private String recipientCcName;

    @ApiModelProperty(value = "密送人邮箱")
    @TableField("recipient_bcc")
    private String recipientBcc;

    @ApiModelProperty(value = "密送人")
    @TableField("recipient_bcc_name")
    private String recipientBccName;

    @ApiModelProperty(value = "folder")
    @TableField("folder")
    private String folder;

    @ApiModelProperty(value = "邮件内容")
    @TableField("content")
    private String content;

    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "收件时间")
    @TableField("sent_date")
    private Date sentDate;

    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "收件时间")
    @TableField("recipient_date")
    private Date recipientDate;

    @ApiModelProperty(value = "邮件大小")
    @TableField("email_size")
    private Integer emailSize;

    @ApiModelProperty(value = "备注")
    @TableField("remark")
    private String remark;

    @TableField(exist = false)
    private List<MailAttachmentEntity> attachments;

    @ApiModelProperty(value = "跟进主键id(0表示已跟进，null表示未跟进)")
    @TableField(exist = false)
    private Long followUpId;

    @ApiModelProperty(value = "进出标记（1进2出）")
    @TableField(exist = false)
    private Integer inOutMark;
}
