package com.crunii.micro.domain.entity.main;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Where;
import org.springframework.data.annotation.CreatedBy;
import org.springframework.data.annotation.CreatedDate;

import javax.persistence.*;
import java.util.Date;

/**
 * @author gongsongtao
 * @date 2023/11/30 15:06
 */
@Entity
@Table(name = "tsm_worker_delivery_address")
@NamedQuery(name = "TsmWorkerDeliveryAddress.findAll", query = "SELECT t FROM TsmWorkerDeliveryAddress t")
@DynamicInsert
@DynamicUpdate
@Getter
@Setter
@ToString
@EqualsAndHashCode(of = { "id" })
@GenericGenerator(name = "idGenerator", strategy = "com.crunii.micro.core.distributed.DistributedSnowFlakeId")
@ApiModel(description = "邮寄地址表")
@Where(clause=" del_flag = 0 ")
public class TsmWorkerDeliveryAddress {

    @Id
    @GeneratedValue(generator = "idGenerator")
    @Column(name = "id")
    @ApiModelProperty(value = "id")
    private Long id ;

    /**
     * 用户ID
     */
    @Column(name = "worker_id")
    @ApiModelProperty(value = "用户ID")
    private Integer workerId;

    /**
     * 收货人姓名
     */
    @Column(name = "consignee_name")
    @ApiModelProperty(value = "收货人姓名")
    private String consigneeName;


    /**
     * 收货地址
     */
    @Column(name = "consignee_address")
    @ApiModelProperty(value = "收货地址")
    private String consigneeAddress;

    /**
     * 收货电话
     */
    @Column(name = "consignee_phone")
    @ApiModelProperty(value = "收货电话")
    private String consigneePhone;

    /**
     * 邮编
     */
    @Column(name = "postalCode")
    @ApiModelProperty(value = "邮编")
    private String postalCode;


    /**
     * 删除标志
     */
    @Column(name = "del_flag")
    @ApiModelProperty(value = "删除标志")
    private Integer delFlag;

    /**
     * 创建人
     */
    @Column(name = "create_by")
    @ApiModelProperty(value = "创建人")
    @CreatedBy
    private String createBy;
    /**
     * 创建时间
     */
    @Column(name = "create_time")
    @ApiModelProperty(value = "创建时间")
    @CreatedDate
    private Date createTime;

    /**
     * 更新人
     */
    @Column(name = "update_by")
    @ApiModelProperty(value = "更新人")
    private String updateBy;
    /**
     * 更新时间
     */
    @Column(name = "update_time")
    @ApiModelProperty(value = "更新时间")
    private Date updateTime;

    /**
     * 创建人Id
     */
    @Column(name = "create_id")
    private Long createId;
    /**
     * 更新人Id
     */
    @Column(name = "update_id")
    private Long updateId;
}
