package com.cyksj.model.views;

import com.ejlchina.searcher.bean.DbField;
import com.ejlchina.searcher.bean.DbIgnore;
import com.ejlchina.searcher.bean.SearchBean;
import lombok.Data;

import java.util.Date;
import java.util.Objects;

/**
 * @author chan
 * @date 2024/4/8 17:02
 */
@Data
@SearchBean(
        tables = "chatgpt_session cs",
        where = "status is true "
)
public class ChatgptCarInfoView {

    /**
     * 车次id
     */
    @DbField("cs.carId")
    private String carId;

    /**
     * 车次名称
     */
    @DbField("cs.car_name")
    private String carName;

    /**
     * 车次状态 繁忙 空闲 停运
     */
    @DbIgnore
    private String status;


    /**
     * 得分
     */
    @DbField("cs.score")
    private Double score;

    /**
     * 可用时间
     */
    @DbIgnore
    private Date expTime;

    @DbField("cs.clears_in")
    private Long clearsIn;

    @DbField("cs.team_clears_in")
    private Long teamClearsIn;

    /**
     * 车队可用时间
     */
    @DbIgnore
    private Date teamExpTime;

    /**
     * 车次类型 team plus 3.5
     */
    @DbIgnore
    private String type;

    /**
     * 使用次数
     */
    @DbIgnore
    private Integer use;

    @DbField("cs.isPlus")
    private Integer isPlus;

    @DbField("cs.sort")
    private Integer sort;


    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        ChatgptCarInfoView that = (ChatgptCarInfoView) o;
        return Objects.equals(carId, that.carId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(carId);
    }
}
