package com.erp.ai.mapper;

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

import java.util.List;
import java.util.Map;

@Mapper
public interface AiAgentUsageLogMapper {
    int insert(AiAgentUsageLog log);

    Map<String, Object> getTodayAggregate();

    Map<String, Object> getMonthAggregate();

    List<AiAgentUsageLog> list(@Param("limit") int limit, @Param("offset") int offset);

    int count();

    List<Map<String, Object>> getDailyUsage(@Param("days") int days);

    long getMonthTokensByApiKey(@Param("apiKeyId") long apiKeyId);
}
