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 javax.persistence.*;


@Entity
@Table(name = "tsm_post_worker")
@NamedQuery(name = "TsmPostWorker.findAll", query = "SELECT t FROM TsmPostWorker t")
@DynamicInsert
@DynamicUpdate
@Getter
@Setter
@ToString
@EqualsAndHashCode(of = {"id"})
@ApiModel(description = "职务与用户关联表")
public class TsmPostWorker {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id")
    @ApiModelProperty(value = "主键id")
    private Long id;

    @Column(name = "post_id")
    @ApiModelProperty(value = "职务id")
    private Long postId;

    @Column(name = "worker_id")
    @ApiModelProperty(value = "用户")
    private Long workerId;
}
