package cn.hnthyy.thmz.mapper.his;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.math.BigDecimal;

/**
 * 药品库存操作
 */
public interface YpBaseYfMapper {
    /**
     * 减虚拟库存
     * @return
     */
    @Update("update yp_base_yf set stock_amount_virtual =stock_amount_virtual - #{amountVirtual,jdbcType=DECIMAL} where charge_code =#{chargeCode,jdbcType=CHAR} and serial =#{serial,jdbcType=CHAR} and group_no =#{groupNo,jdbcType=CHAR} ")
    int updateStockAmountVirtual(@Param("chargeCode") String chargeCode, @Param("serial") String serial, @Param("groupNo") String groupNo, @Param("amountVirtual") BigDecimal amountVirtual);



    /**
     * 增加虚拟库存
     * @return
     */
    @Update("update yp_base_yf set stock_amount_virtual =stock_amount_virtual + #{amountVirtual,jdbcType=DECIMAL} where charge_code =#{chargeCode,jdbcType=CHAR} and serial =#{serial,jdbcType=CHAR} and group_no =#{groupNo,jdbcType=CHAR} ")
    int updateStockAmountVirtualAdd(@Param("chargeCode") String chargeCode, @Param("serial") String serial, @Param("groupNo") String groupNo, @Param("amountVirtual") BigDecimal amountVirtual);
}
