/*
 * 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.DispenseFormSearchParam;
import com.openhis.web.inhospitalnursestation.dto.MedicineDispenseFormDto;
import com.openhis.web.inhospitalnursestation.dto.MedicineSummaryFormDto;
import com.openhis.web.inhospitalnursestation.dto.MedicineSummaryInfoDto;

@Repository
public interface MedicineSummaryAppMapper {

    /**
     * 查询领药列表
     *
     * @param page 分页信息
     * @param queryWrapper 查询条件
     * @param completed 医嘱状态：已完成
     * @param active 住院位置状态：使用中
     * @param bed 位置类型：病床
     * @param admittingDoctor 住院医生
     * @param personalCashAccount 个人现金账户
     * @param billable 收费状态：待结算
     * @param billed 收费状态：已结算
     * @param refunded 收费状态：已退费
     * @param summarized 发药状态：已汇总
     * @return 领药列表
     */
    Page<MedicineDispenseFormDto> selectMedicineDispenseFormPage(@Param("page") Page<MedicineDispenseFormDto> page,
        @Param(Constants.WRAPPER) QueryWrapper<DispenseFormSearchParam> queryWrapper,
        @Param("completed") Integer completed, @Param("active") Integer active, @Param("bed") Integer bed,
        @Param("admittingDoctor") String admittingDoctor, @Param("personalCashAccount") String personalCashAccount,
        @Param("billable") Integer billable, @Param("billed") Integer billed, @Param("refunded") Integer refunded,
        @Param("summarized") Integer summarized);

    /**
     * 查询汇总单分页列表
     *
     * @param page 分页信息
     * @param queryWrapper 查询条件
     * @param completed 发药状态：已完成
     * @param inProgress 发药状态：待发药
     * @param summaryDispense 单据类型：汇总发药
     * @return 汇总单列表
     */
    Page<MedicineSummaryFormDto> selectMedicineSummaryFormPage(@Param("page") Page<MedicineSummaryFormDto> page,
        @Param(Constants.WRAPPER) QueryWrapper<DispenseFormSearchParam> queryWrapper,
        @Param("completed") Integer completed, @Param("inProgress") Integer inProgress,
        @Param("summaryDispense") Integer summaryDispense);

    /**
     * 获取汇总单详情
     *
     * @param summaryNo 汇总单号
     * @return 汇总单详情
     */
    List<MedicineSummaryInfoDto> selectMedicineSummaryFormDetail(@Param("summaryNo") String summaryNo);
}
