package com.kcim.dao.mapper;

import com.kcim.dao.model.AllocationQuery;
import com.kcim.vo.CodeAndNameVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

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

/**
 * 
 * 
 * @author huangrui
 * @date 2021-08-26 08:51:45
 */
@Mapper
public interface AllocationQueryMapper extends GenericBatchMapper<AllocationQuery> {

    BigDecimal getTotalMoney(@Param("dateYear") int dateYear, @Param("month") int month, @Param("hospId") Long hospId);

    List<CodeAndNameVO> getRespCodeAndName(@Param("hospId") Long hospId, @Param("dateYear") int dateYear, @Param("month") int month);

    List<CodeAndNameVO> getAccountCodeAndName(@Param("hospId") Long hospId, @Param("dateYear") int dateYear, @Param("month") int month);

    BigDecimal getCountByRespAndAccounts(@Param("hospId") Long hospId, @Param("dateYear") int dateYear, @Param("month") int month, @Param("code") String code, @Param("accountCodes") List<String> accountCodes);

    BigDecimal getTotalByAccountAndResps(@Param("hospId") Long hospId, @Param("dateYear") int dateYear, @Param("month") int month, @Param("code") String code, @Param("respCodes") List<String> respCodes);

    BigDecimal getTotalByAccountAndRespCode(@Param("hospId") Long hospId, @Param("dateYear") int dateYear, @Param("month") int month, @Param("accountCode") String accountCode, @Param("responsibilityCode") String responsibilityCode);

    /**
     * 获取医院所有会计科目成本（临床层的）
     * @param hospId
     * @param dateYear
     * @param month
     * @return
     */
    List<AllocationQuery> getAcountAccounts(@Param("hospId") Long hospId, @Param("dateYear") int dateYear, @Param("month") int month);

    /**
     * 获取医院各责任中心所有会计科目成本
     * @param hospId
     * @param dateYear
     * @param month
     * @return
     */
    List<AllocationQuery> getRespAcountAccounts(@Param("hospId") Long hospId, @Param("dateYear") int dateYear, @Param("month") int month);

    /**
     * 获取医院各责任中心不同来源类型的会计科目成本
     * @param hospId
     * @param dateYear
     * @param month
     * @return
     */
    List<AllocationQuery> getRespOriginAcountAccounts(@Param("hospId") Long hospId, @Param("dateYear") int dateYear, @Param("month") int month);
}
