package com.yc.ship.module.trade.dal.mysql.order;


import com.yc.ship.framework.mybatis.core.mapper.BaseMapperX;
import com.yc.ship.module.trade.dal.dataobject.order.TradeOrderPayDO;
import com.yc.ship.module.trade.controller.admin.report.vo.RefundStatisticsVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

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


/**
 * 订单支付 Mapper
 *
 * @author 管理员
 */
@Mapper
public interface TradeOrderPayMapper extends BaseMapperX<TradeOrderPayDO> {

    BigDecimal selectHadPayAmount(@Param("orderId") Long orderId);
    TradeOrderPayDO selectPayOrderBySupplierOrderNo(@Param("supplierOrderNo") String supplierOrderNo);
    TradeOrderPayDO getOrderPayType(@Param("orderId") Long orderId);

    /**
     * 查询退款统计数据（按退款时间分组）
     *
     * @param startDateTime 开始时间
     * @param endDateTime   结束时间
     * @return 退款统计列表
     */
    List<RefundStatisticsVO> selectRefundStatistics(@Param("startDateTime") LocalDateTime startDateTime,
                                                     @Param("endDateTime") LocalDateTime endDateTime);
}