package com.alttd.altitudeweb.database.chat;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Optional;

public interface ChatLogMapper {

    @Select("""
            SELECT uuid, time_stamp, server, type, channel, receiver, mini_message, blocked
            FROM chat_log
            WHERE mini_message IS NOT NULL
            AND time_stamp >= #{since}
            """)
    List<ChatLogDao> getChatLogs(@Param("since") long since);

    @Select("""
            SELECT party_id FROM chat_users
            WHERE uuid = #{uuid}
            """)
    Optional<Integer> getPartyId(@Param("uuid") String uuid);

}
