package com.tofly.watermeter.custom.mapper.statisticanalysis;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.*;

@Repository
public interface ReportManagementMapper {

    List<Map<String,Object>> getEconomicBenefitCountAndAmount(@Param("startDate") String startDate,
                                                              @Param("endDate") String endDate);

    Page<HashMap<String,Object>> getEconomicBenefitDetail(Page page,
                                                          @Param("startDate") String startDate,
                                                          @Param("endDate") String endDate,
                                                          @Param("rectifyType") String rectifyType);

    List<HashMap<String,String>> getQualityStatisticsByYearMonth(@Param("yearMonth") String yearMonth,
                                                                 @Param("queryType") String queryType);

    Page<HashMap<String,String>> getQualityStatisticsDetail(Page page,
                                                            @Param("yearMonth") String yearMonth,
                                                            @Param("zglx") String zglx);

    /**
     * 获取不合格数量
     */
    List<HashMap<String, String>> getUnqualifiedQuantity(@Param("startDate") String startDate,
                                                         @Param("endDate") String endDate,
                                                         @Param("cbpq") String cbpq);

    /**
     * 获取每月合格率
     */
    HashMap<String, String> getMonthlyPassRate(@Param("queryDate") String queryDate,
                                               @Param("cbpq") String cbpq);

    /**
     * 根据认证类型获取时间范围内质检统计
     * @param startDate 开始时间
     * @param endDate 结束时间
     * @param type 认证类型
     */
    List<HashMap<String, String>> getQualityStatisticsByCertificationProject(@Param("startDate") String startDate,
                                                                             @Param("endDate") String endDate,
                                                                             @Param("type") String type);

    Page<HashMap<String,String>> getUnqualifiedQuantityDetail(Page page,
                                                              @Param("queryDate") String queryDate,
                                                              @Param("cbpq") String cbpq);

    List<HashMap<String,String>> getPassRateDetailDetail(@Param("queryDate") String queryDate,
                                                         @Param("cbpq") String cbpq);

    HashMap<String, String> getRectifyByNumber(String rectifyNumber);
}
