package com.openhis.administration.mapper;

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

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.openhis.administration.domain.ChargeItemDefinition;
import com.openhis.administration.dto.ChargeItemDefDetailPriceDto;

/**
 * 费用定价管理Mapper接口
 *
 * @author system
 * @date 2025-02-20
 */
@Repository
public interface ChargeItemDefinitionMapper extends BaseMapper<ChargeItemDefinition> {
    /**
     * Desc: 根据 conditionCode 和 药品ID 获取 原价和零售价
     * 
     * @param conditionCode
     * @param instanceId
     * @Author raymond
     * @Date 21:44 2025/11/1
     * @return com.openhis.administration.domain.ChargeItemDefinition
     **/
    ChargeItemDefDetailPriceDto getMedPriceByParam(@Param("conditionCode") String conditionCode,
        @Param("instanceId") Long instanceId);

    /**
     * Desc: 根据 conditionCode 和 耗材ID 获取 原价和零售价
     * 
     * @param conditionCode
     * @param instanceId
     * @Author raymond
     * @Date 07:23 2025/11/4
     * @return com.openhis.administration.dto.ChargeItemDefDetailPriceDto
     **/
    ChargeItemDefDetailPriceDto getDevicePriceByParam(@Param("conditionCode") String conditionCode,
        @Param("instanceId") Long instanceId);

    /**
     * Desc: 根据 状态和货品ID 加载诊疗或挂号的最新零售价
     * 
     * @param statusEnum
     * @param instanceId
     * @Author raymond
     * @Date 22:02 2025/11/1
     * @return com.openhis.administration.dto.ChargeItemDefDetailPriceDto
     **/
    ChargeItemDefDetailPriceDto getProductPrice(@Param("statusEnum") Integer statusEnum,
        @Param("instanceId") Long instanceId);

}