package com.kcim.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.kcim.dao.model.AllocationQuery;
import com.kcim.vo.CodeAndNameVO;

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


/**
 * 
 *
 * @author huangrui
 * @email 
 * @date 2021-08-26 08:51:45
 */
public interface AllocationQueryService extends IService<AllocationQuery> {

    /**
     * 这个月总金额
     * @param dateYear
     * @param month
     * @param hospId
     * @return
     */
    BigDecimal getTotalMoney(int dateYear, int month, Long hospId);

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

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

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

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

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

    /**
     * 获取这个月的分摊数据
     * @param hospId 医院id
     * @param year 年
     * @param month 月
     * @return 分摊数据查询
     */
    List<AllocationQuery> getAllByDate(Long hospId, int year, int month);

    List<AllocationQuery> getCostByDate(Long hospId, int year, int month,int originType);

    List<AllocationQuery> getByDate(int year, int month, Long hospId, List<Long> levelSorts);

    List<AllocationQuery> getByDateAndResp(int year, int month, Long hospId, String responsibilityCode);

    List<AllocationQuery> getByDateRespn(int year, int month, Long hospId, List<Long> shareLevelId, String responsibilityCode);

    List<AllocationQuery> getAcountAccounts(Long hospId, int dateYear, int month);

    List<AllocationQuery> getRespAcountAccounts(Long hospId, int dateYear, int month);

    List<AllocationQuery> getRespOriginAcountAccounts(Long hospId, int dateYear, int month);

    void batchInsertAllocationQuery(List<AllocationQuery> allocationQueryList);
}

