package com.mcwl.pay.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mcwl.pay.domain.OrderTrade;
import com.mcwl.pay.domain.PaymentResult;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * @Author：ChenYan
 * @Project：McWl
 * @Package：com.mcwl.pay.mapper
 * @Filename：OrderTradeMapper
 * @Description TODO
 * @Date：2025/1/3 14:51
 */
@Mapper
public interface OrderTradeMapper extends BaseMapper<OrderTrade> {

    PaymentResult chargeCard(Integer totalAmount, String paymentMethod);

    /**
     * 获取今日收益
     * @return Double
     */
    Double getTodayIncome();

    /**
     * 获取本月收益
     * @return Double
     */
    Double getMonthIncome();

    /**
     * 获取指定年月收益
     * @return Double
     */
    Double getIncomeByMonth(@Param("year") Integer year, @Param("month") Integer month);

    /**
     * 获取年度收益
     * @return Double
     */
    Double getYearIncome();

    /**
     * 获取指定年收益
     * @return Double
     */
    Double getIncomeByYear(@Param("year") Integer year);

    /**
     * 获取总收益
     * @return Double
     */
    Double getTotalIncome();

}
