package com.cyksj.model.views;

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

import java.util.Date;

/**
 * @author chan
 * @date 2024/4/10 11:37
 */
@Data
@SearchBean(tables = "(SELECT MAX(id) id from chatgpt_user_conversation_record as r\n" +
        "GROUP BY r.conversation_id) t left join chatgpt_user_conversation_record as r on t.id = r.id , chatgpt_user_conversation as c, chatgpt_session s "
        ,where = "r.conversation_id = c.conversationId AND s.carId = r.car_id "
        ,orderBy = "r.created_time desc"
)
public class ChatGptUserConversationRecordHistoryView {

    @DbField("r.user_token")
    private String userToken;
    /**
     * 对话标题
     */
    @DbField("c.title")
    private String title;

    /**
     * 对话id
     */
    @DbField("r.conversation_id")
    private String conversationId;

    /**
     * 对话时间
     */
    @DbField("r.created_time")
    private Date conversationTime;

    /**
     * 车队id
     */
    @DbField("r.car_id")
    private String carId;

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

    @DbField("s.isPlus")
    private Integer isPLus;

}
