package com.ruoyi.web.modules.screen.mapper;

import java.util.Date;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.ruoyi.web.modules.screen.domain.dto.LivestockResourceBandCountDto;
import com.ruoyi.web.modules.screen.domain.dto.LivestockResourceCategoryCountDto;
import com.ruoyi.web.modules.screen.domain.dto.LivestockResourceDateCountDto;
import com.ruoyi.web.modules.screen.domain.dto.LivestockResourceOverviewDto;
import com.ruoyi.web.modules.screen.domain.dto.LivestockResourceUserStructureDto;

/**
 * 大屏畜牧资源统计只读 Mapper。
 */
public interface LivestockResourceScreenMapper
{
    LivestockResourceOverviewDto selectYearOverviewMetrics(
            @Param("yearStart") Date yearStart, @Param("yearEnd") Date yearEnd);

    Long countTodayActiveUsers(@Param("dayStart") Date dayStart, @Param("dayEnd") Date dayEnd);

    Long countTodayNewUsers(@Param("dayStart") Date dayStart, @Param("dayEnd") Date dayEnd);

    Long countTodaySessions(@Param("dayStart") Date dayStart, @Param("dayEnd") Date dayEnd);

    Long countTodayQuestionCount(@Param("dayStart") Date dayStart, @Param("dayEnd") Date dayEnd);

    List<LivestockResourceDateCountDto> selectDailySessionCounts(
            @Param("rangeStart") Date rangeStart, @Param("rangeEnd") Date rangeEnd);

    List<LivestockResourceDateCountDto> selectDailyAiReplyCounts(
            @Param("rangeStart") Date rangeStart, @Param("rangeEnd") Date rangeEnd);

    LivestockResourceUserStructureDto selectUserStructure();

    Long countAskerMessagesInYear(@Param("yearStart") Date yearStart, @Param("yearEnd") Date yearEnd);

    List<LivestockResourceCategoryCountDto> selectAskerCategoryCounts(
            @Param("yearStart") Date yearStart, @Param("yearEnd") Date yearEnd);

    List<LivestockResourceDateCountDto> selectHourlySessionCounts(
            @Param("dayStart") Date dayStart, @Param("dayEnd") Date dayEnd);

    List<LivestockResourceDateCountDto> selectHourlyAiReplyCounts(
            @Param("dayStart") Date dayStart, @Param("dayEnd") Date dayEnd);

    Long countYearSessions(@Param("yearStart") Date yearStart, @Param("yearEnd") Date yearEnd);

    List<LivestockResourceBandCountDto> selectSessionReplyBuckets(
            @Param("yearStart") Date yearStart, @Param("yearEnd") Date yearEnd);

    Long countAiRepliesOk(@Param("yearStart") Date yearStart, @Param("yearEnd") Date yearEnd);

    Long countAiRepliesFail(@Param("yearStart") Date yearStart, @Param("yearEnd") Date yearEnd);

    List<String> selectTextAskerContents(@Param("yearStart") Date yearStart, @Param("yearEnd") Date yearEnd);

    List<Integer> selectDistinctSessionYears();
}
