package com.dayou.mapper;

import com.dayou.entity.OrderFund;
import com.dayou.dao.CustomBaseMapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

/**
 * <p>
 * 订单应收款 Mapper 接口
 * </p>
 *
 * @author wucl
 * @since 2023-12-14
 */
public interface OrderFundMapper extends CustomBaseMapper<OrderFund> {

    void updateRealAmount(@Param("id") Long id, @Param("thisTimeAmount") BigDecimal thisTimeAmount);

    void updateRealAmountByOrderId(@Param("orderId") String orderId, @Param("thisTimeAmount") BigDecimal thisTimeAmount);

    BigDecimal residueNotAllotAmount(@Param("orderFundId") Long orderFundId);

    /**
     * 更新折扣比例
     * @param orderFundId 订单收款信息id
     */
    void updateDiscountByOrderIdAfter(@Param("orderFundId") Long orderFundId);

    List<OrderFund> getAllOrderFund();
}
