package cn.hnthyy.thmz.mapper.his;

import cn.hnthyy.thmz.entity.his.YpBase;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * 药库库存持久化类
 */
public interface YpBaseMapper {
    /**
     * 查询药品药库库存数量
     * @param chargeCode
     * @param serial
     * @param groupNo
     * @return
     */
    @Select("select stock_amount from yp_base where charge_code=#{chargeCode} and serial=#{serial} and group_no=#{groupNo}")
    Double selectStockAmount(@Param("chargeCode") String chargeCode, @Param("serial") String serial, @Param("groupNo") String groupNo);

    /**
     * 查询药品药库库存信息
     * @param chargeCode
     * @param serial
     * @param groupNo
     * @return
     */
    @Select("select specification2,self_flag,suprice_flag,separate_flag,drug_flag,py_code,drug_id,charge_code,serial,group_no,mini_unit,specification from yp_base where charge_code=#{chargeCode} and serial=#{serial} and group_no=#{groupNo}")
    YpBase selectYpBase(@Param("chargeCode") String chargeCode, @Param("serial") String serial, @Param("groupNo") String groupNo);
}
