package com.zhongshu.card.server.core.dao.payment.extend;

import com.zhongshu.card.client.model.payment.ExpenseFlowCount;
import com.zhongshu.card.client.model.payment.ExpenseFlowSearch;
import com.zhongshu.card.client.model.payment.statistic.StatisticItem;
import com.zhongshu.card.client.model.school.BookInfoSearch;
import com.zhongshu.card.server.core.domain.payment.ExpenseFlow;
import com.zhongshu.card.server.core.domain.school.BookInfo;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

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

/**
 * @Author TRX
 * @CreateDate: 2023/7/7
 * @Version: 1.0
 */
public interface ExpenseFlowDaoExtend {

    /**
     * 查询消费流水记录
     *
     * @param pageable
     * @param param
     * @return
     */
    Page<ExpenseFlow> page(Pageable pageable, ExpenseFlowSearch param);

    /**
     * 统计消费
     *
     * @param param
     * @return
     */
    ExpenseFlowCount countUserPayment(ExpenseFlowSearch param);

    /**
     * 统计商户总的收入
     *
     * @param param
     * @return
     */
    ExpenseFlowCount countBuinessMainPayment(ExpenseFlowSearch param);

    // 统计数量
    long countExpenseFlows(ExpenseFlowSearch param);

    ExpenseFlow init(String mqttDataId, String token);

    // 分组统计
    Map<String, BigDecimal> statisticItems(ExpenseFlowSearch param);

}
