package com.tykj.dev.device.confirmcheck.entity.domain;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Where;
import org.springframework.data.annotation.CreatedBy;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedBy;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

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

/**
 * entity class for device_check_bill
 * 装备核查账单
 */
@Data
@Entity
@EntityListeners(AuditingEntityListener.class)
@SQLDelete(sql = "update device_check_bill set delete_tag = 1 where id = ?")
@Where(clause = "delete_tag = 0")
@ApiModel("装备核查账单")
@Table(name = "device_check_bill", schema = "device_check_bill")
@NoArgsConstructor
public class DeviceCheckBillEntity {

    /**
     * 主键id
     */
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id", columnDefinition = "not null  int(11) 主键id")
    @ApiModelProperty(name = "主键id")
    private Integer id;
    /**
     * 检查组成员1(省A岗)id
     */
    @Column(name = "userA_id", columnDefinition = "not null  int(11) 检查组成员1(省A岗)id")
    @ApiModelProperty(value = "检查组成员1(省A岗)id")
    private Integer userAId;
    /**
     * 检查组成员2(省A岗)id
     */
    @Column(name = "userB_id", columnDefinition = "not null  int(11) 检查组成员2(省A岗)id")
    @ApiModelProperty(value = "检查组成员2(省A岗)id")
    private Integer userBId;
    /**
     * 核查状态(0:决算待审核,1:决算审核失败,2:决算中,3:决算完成)
     */
    @Column(name = "check_status", columnDefinition = "not null  int(11) 核查状态(0:决算待审核,1:决算审核失败,2:决算中,3:决算完成)")
    @ApiModelProperty(value = "核查状态(0:决算待审核,1:决算审核失败,2:决算中,3:决算完成)")
    private Integer checkStatus;
    /**
     * 核查单位主键id(x作为分隔符)，例如1x2,意为单位id为1和2的装备核查
     */
    @Column(name = "check_detail", columnDefinition = "not null  text 核查单位主键id(x作为分隔符)，例如1x2,意为单位id为1和2的装备核查")
    @ApiModelProperty(value = "核查单位主键id(x作为分隔符)，例如1x2,意为单位id为1和2的装备核查")
    private String checkDetail;
    /**
     * 核查标题
     */
    @Column(name = "check_title", columnDefinition = "not null  varchar(32) 核查标题")
    @ApiModelProperty(value = "核查标题")
    private String checkTitle;
    /**
     * 备注
     */
    @Column(name = "remark", columnDefinition = "not null  varchar(255) 备注")
    @ApiModelProperty(value = "备注")
    private String remark;
    /**
     * 创建用户id
     */
    @CreatedBy
    @Column(name = "create_user_id", columnDefinition = "not null  int(11) 创建用户id")
    @ApiModelProperty(value = "创建用户id")
    private Integer createUserId;
    /**
     * 创建时间
     */
    @CreatedDate
    @Column(name = "create_time", columnDefinition = "not null  datetime 创建时间")
    @ApiModelProperty(value = "创建时间")
    private Date createTime;
    /**
     * 更新用户id
     */
    @LastModifiedBy
    @Column(name = "update_user_id", columnDefinition = "not null  int(11) 更新用户id")
    @ApiModelProperty(value = "更新用户id")
    private Integer updateUserId;
    /**
     * 更新时间
     */
    @LastModifiedDate
    @Column(name = "update_time", columnDefinition = "not null  datetime 更新时间")
    @ApiModelProperty(value = "更新时间")
    private Date updateTime;
    /**
     * 删除标记(0:未删除，1:已删除)
     */
    @Column(name = "delete_tag", columnDefinition = "not null  int(11) 删除标记(0:未删除，1:已删除)")
    @ApiModelProperty(value = "删除标记(0:未删除，1:已删除)")
    private Integer deleteTag = 0;

    public DeviceCheckBillEntity(Integer userAId, Integer userBId, Integer checkStatus, String checkDetail, String checkTitle, Date completeTime, String remark) {
        this.userAId = userAId;
        this.userBId = userBId;
        this.checkStatus = checkStatus;
        this.checkDetail = checkDetail;
        this.checkTitle = checkTitle;
        this.remark = remark;
    }

}
