/*
 * Copyright ©2023 CJB-CNIT Team. All rights reserved
 */
package com.openhis.web.pharmacymanage.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.administration.domain.Practitioner;
import com.openhis.web.pharmacymanage.dto.EncounterInfoDto;
import com.openhis.web.pharmacymanage.dto.EncounterInfoSearchParam;
import com.openhis.web.pharmacymanage.dto.ItemDispenseOrderDto;

@Repository
public interface WesternMedicineDispenseMapper {

    /**
     * 就诊病人列表分页查询
     *
     * @param page 分页
     * @param queryWrapper 查询条件
     * @param statusEnum 发药状态
     * @param inProgress 发药状态:待发药
     * @param completed 发药状态:已发药
     * @param preparation 发药状态:待配药
     * @param prepared 发药状态:已配药
     * @return 就诊病人列表
     */
    Page<EncounterInfoDto> selectEncounterInfoListPage(@Param("page") Page<EncounterInfoDto> page,
        @Param(Constants.WRAPPER) QueryWrapper<EncounterInfoSearchParam> queryWrapper,
        @Param("statusEnum") Integer statusEnum, @Param("inProgress") Integer inProgress,
        @Param("completed") Integer completed, @Param("preparation") Integer preparation,
        @Param("prepared") Integer prepared);

    /**
     * 发药单查询
     *
     * @param page 分页
     * @param queryWrapper 查询条件
     * @param inProgress 发药状态:待发药
     * @param completed 发药状态:已发药
     * @param preparation 发药状态:待配药
     * @param prepared 发药状态:已配药
     * @param dispenseStatus 发药状态
     * @return 发耗材单列表
     */
    Page<ItemDispenseOrderDto> selectMedicineDispenseOrderPage(@Param("page") Page<ItemDispenseOrderDto> page,
        @Param(Constants.WRAPPER) QueryWrapper<ItemDispenseOrderDto> queryWrapper,
        @Param("inProgress") Integer inProgress, @Param("completed") Integer completed,
        @Param("preparation") Integer preparation, @Param("prepared") Integer prepared,
        @Param("dispenseStatus") Integer dispenseStatus);

    /**
     * 获取配药人下拉选列表
     *
     * @param pharmacist 参与者类型：药师
     * @return 配药人下拉选列表
     */
    List<Practitioner> getPreparerDoctorList(@Param("pharmacist") String pharmacist);
}
