package org.jeecg.modules.database.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * @Description: 试验样品信息
 * @Author: jeecg-boot
 * @Date: 2024-12-04
 * @Version: V1.0
 */
@Data
@TableName("experiment_sample_info")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@Schema(description = "试验样品信息")
public class ExperimentSampleInfo implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(type = IdType.ASSIGN_ID)
    @Schema(description = "主键")
    private String id;
    /**
     * 创建人
     */
    @Schema(description = "创建人")
    private String createBy;
    /**
     * 创建日期
     */
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
    @Schema(description = "创建日期")
    private Date   createTime;
    /**
     * 更新人
     */
    @Schema(description = "更新人")
    private String updateBy;
    /**
     * 更新日期
     */
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
    @Schema(description = "更新日期")
    private Date   updateTime;
    /**
     * 所属部门
     */
    @Schema(description = "所属部门")
    private String sysOrgCode;
    /**
     * 试验ID
     */
    @Excel(name = "试验ID", width = 15)
    @Schema(description = "试验ID")
    private String experimentId;
    /**
     * 样品类型
     */
    @Excel(name = "样品类型", width = 15)
    @Schema(description = "样品类型")
    private String sampleType;
    /**
     * 样品型号
     */
    @Excel(name = "样品型号", width = 15)
    @Schema(description = "样品型号")
    private String sampleModel;
    /**
     * 样品批次
     */
    @Excel(name = "样品批次", width = 15)
    @Schema(description = "样品批次")
    private String sampleBatch;

    @Schema(description = "型号批次")
    @TableField(exist = false)
    private String modelBatch;
    /**
     * 生产厂家
     */
    @Excel(name = "生产厂家", width = 15)
    @Schema(description = "生产厂家")
    private String sampleManufacturer;
    /**
     * 图片
     */
    @Excel(name = "图片", width = 15)
    @Schema(description = "图片")
    private String sampleImage;
    /**
     * 名称
     */
    @Excel(name = "样品名称", width = 15)
    @Schema(description = "样品名称")
    private String sampleName;

    public String getModelBatch() {
        return sampleModel + "-" + sampleBatch;
    }

    public void setModelBatch(String modelBatch) {
        this.modelBatch = modelBatch;
    }
}
