package com.diagbot.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.diagbot.dto.AverageStatisticsDTO;
import com.diagbot.dto.AverageStatisticsFeeDTO;
import com.diagbot.entity.HomePage;
import com.diagbot.vo.FilterPageByAverageVO;
import com.diagbot.vo.FilterPageVO;
import com.diagbot.vo.FilterVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author zhoutg
 * @since 2020-04-13
 */
public interface HomePageMapper extends BaseMapper<HomePage> {

    /**
     * 按科室统计平均住院天数
     *
     * @param filterVO
     * @return
     */
    public List<AverageStatisticsDTO> getAverageDayNum(FilterVO filterVO);

    /**
     * 按科室统计平均费用
     *
     * @param filterVO
     * @return
     */
    public List<AverageStatisticsDTO> getAverageFee(FilterVO filterVO);

    /**
     * 按科室统计平均住院天数（分页）
     *
     * @param filterPageByAverageVO
     * @return
     */
    public IPage<AverageStatisticsDTO> getAverageDayNumPage(@Param("filterPageByAverageVO") FilterPageByAverageVO filterPageByAverageVO);

    /**
     * 按科室统计平均费用（分页）
     *
     * @param filterPageByAverageVO
     * @return
     */
    public IPage<AverageStatisticsFeeDTO> getAverageFeePage(@Param("filterPageByAverageVO") FilterPageByAverageVO filterPageByAverageVO);

    /**
     * 根据病案首页编码、医院编码、病人住院ID-批量更新
     * @param list
     */
    public void updateBatchByKey(List<HomePage> list);

}
