package com.keao.edu.user.dao;

import com.keao.edu.common.dal.BaseDAO;
import com.keao.edu.user.dto.ExamManualLedgerStatisticsDto;
import com.keao.edu.user.entity.ExamManualLedger;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

public interface ExamManualLedgerDao extends BaseDAO<Long, ExamManualLedger> {

    List<ExamManualLedger> queryExamManualLedgers(Map<String, Object> params);
    int countExamManualLedgers(Map<String, Object> params);

    /**
     * @describe 获取考级项目支出统计信息
     * @author Joburgess
     * @date 2020.07.09
     * @param examId:
     * @return com.keao.edu.user.dto.ExamManualLedgerStatisticsDto
     */
    ExamManualLedgerStatisticsDto getExamManualLedgerStatistics(@Param("organId") Integer organId,
                                                                @Param("examId") Long examId,
                                                                @Param("targetOrganId") Integer targetOrganId);


    List<ExamManualLedger> getExamOrganManualLedgers(@Param("organId") Integer organId,
                                                     @Param("examId") Long examId,
                                                     @Param("days") List<String> days);

    /**
     * @describe 统计合作单位在指定项目中的累计支出
     * @author Joburgess
     * @date 2020.07.21
     * @param examId:
     * @param organId:
     * @return java.math.BigDecimal
     */
    BigDecimal countOrganLedgerWithExam(@Param("examId") Long examId,
                                        @Param("organId") Integer organId);
}
