/*
 * Copyright ©2023 CJB-CNIT Team. All rights reserved
 */
package com.openhis.web.chargemanage.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.chargemanage.dto.EncounterPatientPageDto;
import com.openhis.web.chargemanage.dto.EncounterPatientPageParam;
import com.openhis.web.chargemanage.dto.EncounterPatientPrescriptionDto;

/**
 * 门诊收费 appMapper
 *
 * @author zwh
 * @date 2025-03-13
 */
@Repository
public interface OutpatientChargeAppMapper {

    /**
     * 查询就诊患者分页列表
     *
     * @param page 分页
     * @param queryWrapper 查询条件
     * @param amb 就诊类型：门诊
     * @return 就诊患者分页列表
     */
    Page<EncounterPatientPageDto> selectEncounterPatientPage(@Param("page") Page<EncounterPatientPageDto> page,
        @Param(Constants.WRAPPER) QueryWrapper<EncounterPatientPageParam> queryWrapper, @Param("amb") Integer amb);

    /**
     * 根据就诊id查询患者处方列表
     *
     * @param encounterId 就诊id
     * @param activity 项目
     * @param medication 药品
     * @param device 耗材
     * @param register 挂号费
     * @param planned 收费状态：待收费
     * @param billable 收费状态：待结算
     * @param billed 收费状态：已结算
     * @param refunding 收费状态：退费中
     * @param refunded 收费状态：全部退费
     * @param partRefund 收费状态：部分退费
     * @return 患者处方列表
     */
    List<EncounterPatientPrescriptionDto> selectEncounterPatientPrescription(@Param("encounterId") Long encounterId,
        @Param("activity") Integer activity, @Param("medication") Integer medication, @Param("device") Integer device,
        @Param("register") Integer register, @Param("planned") Integer planned, @Param("billable") Integer billable,
        @Param("billed") Integer billed, @Param("refunding") Integer refunding, @Param("refunded") Integer refunded,
        @Param("partRefund") Integer partRefund);

}
