package com.alttd.altitudeweb.database.discord;

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

import java.util.List;

public interface AppealListMapper {

    @Select("""
            SELECT userId, next
            FROM appeal_list
            ORDER BY userId;
            """)
    List<AppealList> getAppealList();

    @Update("""
            UPDATE appeal_list
            SET next = #{next}
            WHERE userId = #{userId}
            """)
    void updateNext(@Param("userId") long userId, @Param("next") boolean next);

}
