package com.ruoyi.os.mapper;

import com.ruoyi.os.domain.CountDiagnosisVO;
import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.os.domain.PatientMedicalRecordsVO;
import com.ruoyi.os.domain.PatientMedicalRecordsYesVO;
import org.apache.ibatis.annotations.Mapper;

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

/**
 * @author 何顺
 * @date 2024-09-21
 */
@Mapper
public interface OsStatisticsMapper {

    //
    /**
     * 查询 诊断 详情
     *
     * @param patientMedicalRecordsVO 处方详情主键
     * @return 处方详情
     */
    @DataSource(value = DataSourceType.MASTER)
    public List<PatientMedicalRecordsVO> obtainPatientDiagnosisList(PatientMedicalRecordsVO patientMedicalRecordsVO);

    /**
     * 查询 症状 对应 数量
     *
     * @param countDiagnosisVO 处方详情主键
     * @return 处方详情
     */
    public List<CountDiagnosisVO> obtainSymptomCorrespondingNumber(CountDiagnosisVO countDiagnosisVO);

    /**
     * 导出是医保的数据列表
     *
     * @param patientMedicalRecordsVO 列表
     * @return 数据集合
     *         邵政文
     *         2025-05-14
     */
    @DataSource(value = DataSourceType.MASTER)
    public List<PatientMedicalRecordsYesVO> obtainPatientDiagnosisYesList(
            PatientMedicalRecordsVO patientMedicalRecordsVO);

    /**
     * 按患者ID统计历史医保报销累计金额(仅统计已发药)
     *
     * @param patientId 患者ID
     * @return 历史医保报销累计金额
     */
    public BigDecimal getHistoryReimbursementByPatientId(Long patientId);

    /**
     * 按患者ID统计历史医保报销累计金额(仅统计已发药)
     *
     * @param params 参数map,包含patientId和yearDate
     * @return 历史医保报销累计金额
     */
    public BigDecimal getHistoryReimbursementByPatientId(Map<String, Object> params);
}
