/*
 * Copyright ©2023 CJB-CNIT Team. All rights reserved
 */
package com.openhis.web.inhospitalnursestation.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.openhis.web.inhospitalnursestation.dto.*;

@Repository
public interface InpatientMedicineCollectionMapper {

    /**
     * 就诊病人列表分页查询
     *
     * @param page 分页
     * @param queryWrapper 查询条件
     * @param amb 住院
     * @return 就诊病人列表
     */
    Page<InpatientMedicineEncounterInfoDto> selectEncounterInfoListPage(
        @Param("page") Page<InpatientMedicineEncounterInfoDto> page,
        @Param(Constants.WRAPPER) QueryWrapper<InpatientMedicineSearchParam> queryWrapper, @Param("amb") Integer amb);

    /**
     * 医嘱列表查询
     *
     * @param page 分页
     * @param queryWrapper 查询条件
     * @param encounterIdList 就诊id
     * @return 医嘱信息
     */
    Page<InpatientMedicinePrescriptionInfoDto> selectPrescriptionInfoListPage(
        @Param("page") Page<InpatientMedicinePrescriptionInfoDto> page,
        @Param(Constants.WRAPPER) QueryWrapper<InpatientMedicineSearchParam> queryWrapper,
        @Param("encounterIdList") List<Long> encounterIdList,
        @Param("statusEnum") Integer statusEnum,
        @Param("medMedicationDefinition") String medMedicationDefinition,
        @Param("admDeviceDefinition") String admDeviceDefinition);

    /**
     * 医嘱汇总列表查询
     *
     * @param page 分页
     * @param medDispenseIdList 药品发放id
     * @param medDispenseIdList 耗材发放id
     * @return 医嘱信息
     */
    Page<InpatientMedicinePrescriptionInfoDto> selectPrescriptionSummaryInfoListPage(
        @Param("page") Page<InpatientMedicinePrescriptionInfoDto> page,
        @Param(Constants.WRAPPER) QueryWrapper<InpatientMedicineSearchParam> queryWrapper,
        @Param("dispenseIdList") List<Long> medDispenseIdList,
        @Param("dispenseIdList") List<Long> devDispenseIdList,
        @Param("medMedicationDefinition") String medMedicationDispense,
        @Param("admDeviceDefinition") String admDeviceDispense);
}
