package com.erp.ai.mapper;

import com.erp.ai.model.AiAgentConversation;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface AiAgentConversationMapper {
    List<AiAgentConversation> list(@Param("agentId") Long agentId,
                                   @Param("limit") int limit,
                                   @Param("offset") int offset);

    int count(@Param("agentId") Long agentId);

    AiAgentConversation getById(@Param("id") long id);

    int insert(AiAgentConversation conv);

    int updateMeta(@Param("id") long id,
                   @Param("title") String title,
                   @Param("metadata") String metadata);

    int incrementStats(@Param("id") long id, @Param("tokens") int tokens);

    int delete(@Param("id") long id);
}
