package org.eco.als.domain;

import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.Table;
import lombok.Data;
import org.dromara.easyes.annotation.HighLight;
import org.dromara.easyes.annotation.IndexField;
import org.dromara.easyes.annotation.IndexId;
import org.dromara.easyes.annotation.IndexName;
import org.dromara.easyes.annotation.rely.Analyzer;
import org.dromara.easyes.annotation.rely.FieldStrategy;
import org.dromara.easyes.annotation.rely.FieldType;
import org.dromara.easyes.annotation.rely.IdType;

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

/**
 * 故障案例对象 als_fault_case_t
 *
 * @author wgk
 * @date 2024-11-14
 */
@Data
@Table(value = "als_fault_case_t")
@IndexName("fault_case_index")
public class FaultCase implements Serializable {
    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 编号
     */
    @Id
    @IndexId(type = IdType.CUSTOMIZE)
    private Long id;

    /**
     * 机型
     */

    @IndexField(fieldType = FieldType.LONG, strategy = FieldStrategy.NOT_EMPTY)
    private Long aircraftTypeId;

    @ExcelProperty(value = "机型")
    @IndexField(fieldType = FieldType.TEXT, strategy = FieldStrategy.NOT_EMPTY)
    private String aircraftTypeName;

    /**
     * 系统
     */
    @IndexField(fieldType = FieldType.LONG, strategy = FieldStrategy.NOT_EMPTY)
    private Long aircraftSystemId;

    @ExcelProperty(value = "系统")
    @IndexField(fieldType = FieldType.TEXT, strategy = FieldStrategy.NOT_EMPTY)
    private String aircraftSystemName;

    /**
     * 分系统
     */
    @IndexField(fieldType = FieldType.LONG, strategy = FieldStrategy.NOT_EMPTY)
    private Long aircraftSubsystemId;

    @ExcelProperty(value = "分系统")
    @IndexField(fieldType = FieldType.TEXT, strategy = FieldStrategy.NOT_EMPTY)
    private String aircraftSubsystemName;

    @ExcelProperty(value = "作者")
    private String author;

    /**
     * 故障现象
     */
    @IndexField(value = "pContent", fieldType = FieldType.TEXT, strategy = FieldStrategy.NOT_EMPTY,
        analyzer = Analyzer.IK_MAX_WORD, searchAnalyzer = Analyzer.IK_MAX_WORD)
    @HighLight(preTag = "<font color=\"red\" >", postTag = "</font>")
    private String faultPhenomenon;

    @ExcelProperty(value = "故障现象")
    @Column(ignore = true)
    @IndexField(exist = false)
    private String pContent;

    @ExcelProperty(value = "故障原因")
    @Column(ignore = true)
    @IndexField(exist = false)
    private String fContent;

    /**
     * 故障原因
     */
    @IndexField(value = "fContent", fieldType = FieldType.TEXT, strategy = FieldStrategy.NOT_EMPTY,
        analyzer = Analyzer.IK_MAX_WORD, searchAnalyzer = Analyzer.IK_MAX_WORD)
    @HighLight(preTag = "<font color=\"red\" >", postTag = "</font>")
    private String faultCause;

    /**
     * 故障树
     */
    @ExcelProperty(value = "故障树")
    @IndexField(fieldType = FieldType.TEXT, strategy = FieldStrategy.NOT_EMPTY, analyzer = Analyzer.IK_MAX_WORD,
        searchAnalyzer = Analyzer.IK_MAX_WORD)
    private String faultTreePath;

    /**
     * 故障图
     */
    @ExcelProperty(value = "故障图")
    @IndexField(fieldType = FieldType.TEXT, strategy = FieldStrategy.NOT_EMPTY, analyzer = Analyzer.IK_MAX_WORD,
        searchAnalyzer = Analyzer.IK_MAX_WORD)
    private String faultPicturePath;

    /**
     * 排故方法
     */
    @ExcelProperty(value = "排故方法")
    @IndexField(fieldType = FieldType.TEXT, strategy = FieldStrategy.NOT_EMPTY, analyzer = Analyzer.IK_MAX_WORD,
        searchAnalyzer = Analyzer.IK_MAX_WORD)
    private String troubleshootingMethodPath;


    /**
     * 浏览次数
     */
    @ExcelProperty(value = "浏览次数")
    @IndexField(fieldType = FieldType.LONG, strategy = FieldStrategy.NOT_EMPTY)
    private Long viewCount;
    /**
     * 创建者
     */
    @IndexField(fieldType = FieldType.TEXT)
    private String createBy;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @IndexField(fieldType = FieldType.DATE, dateFormat = "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis")
    private Date createTime;

    /**
     * 更新者
     */
    @IndexField(fieldType = FieldType.TEXT)
    private String updateBy;

    /**
     * 更新时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @IndexField(fieldType = FieldType.DATE, dateFormat = "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis")
    private Date updateTime;
    private String orderBy;


}
