package org.eco.als.domain.vo;

import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mybatisflex.annotation.RelationOneToOne;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.eco.als.domain.LifetimeSpareParts;
import org.eco.common.orm.core.domain.BaseEntity;

import java.io.Serial;
import java.io.Serializable;

/**
 * 有寿件视图对象 als_lifetime_spare_parts_t
 *
 * @author wgk
 * @date 2024-12-14
 */
@Data
@ExcelIgnoreUnannotated
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = LifetimeSpareParts.class)
public class LifetimeSparePartsVo extends BaseEntity implements Serializable {

@Serial
private static final long serialVersionUID = 1L;

    /** 编号 */
//    @ExcelProperty(value = "编号")
    private Long id;

    /** 飞机机号 */
    private String airModelId;
    @ExcelProperty(value = "机型")
    @RelationOneToOne(
        selfField = "airModelId",
        targetTable = "T_AIRCAFT_MODEL",
        targetField = "aircaftModelId",
        valueField = "aircaftModelName"
    )
    private String airModel;

    /** 飞机编目 */
    private String airId;
    @ExcelProperty(value = "编目")
    @RelationOneToOne(
        selfField = "airId",
        targetTable = "T_AIRCAFT_CATALOG",
        targetField = "aircaftCatalogId",
        valueField = "aircaftCatalogCode"
    )
    private String airCode;

    /** 构型Id */
    private String configId;
    @ExcelProperty(value = "构型")
    @RelationOneToOne(
        selfField = "configId",
        targetTable = "als_air_configuration_t",
        targetField = "id",
        valueField = "name"
    )
    private String configName;


    /** 部件名称 */
    @ExcelProperty(value = "部件名称")
    private String componentName;

    /** 部件型号 */
    @ExcelProperty(value = "部件型号")
    private String componentModel;

    /** 部件编码 */
    @ExcelProperty(value = "部件编码")
    private String componentNum;

    /** 出厂日期 */
    @ExcelProperty(value = "出厂日期")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private String factoryDate;

    /** 当前安装飞机 */
    @ExcelProperty(value = "当前安装飞机")
    private String currentInstallAircraft;

    /** 工作时次 */
    @ExcelProperty(value = "工作时次")
    private String workTime;

    /** 额定寿命 */
    @ExcelProperty(value = "额定寿命")
    private String ratedLifetime;

    /** 剩余寿命 */
    @ExcelProperty(value = "剩余寿命")
    private String remainingLifetime;

    /** 备注 */
//    @ExcelProperty(value = "备注")
    private String remarks;

    /** 删除标识（1删除 0未删除） */
//    @ExcelProperty(value = "删除标识（1删除 0未删除）")
    private Integer delFlag;


    /**
     * 创建人名称
     */
//    @FieldMapper(type = MapperConstant.USER_ID_TO_NAME, mapper = "createBy")
    private String createByName;

    /**
     * 创建人名称
     */
//    @FieldMapper(type = MapperConstant.USER_ID_TO_NAME, mapper = "updateBy")
    private String updateByName;

}
