package com.ruoyi.bst.bonusRefund.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ruoyi.bst.bonusRefund.domain.BonusRefundQuery;
import com.ruoyi.bst.bonusRefund.domain.vo.BonusRefundDailyStatVO;
import com.ruoyi.bst.bonusRefund.domain.vo.BonusRefundStatVO;
import com.ruoyi.bst.bonusRefund.mapper.BonusRefundMapper;
import com.ruoyi.bst.bonusRefund.service.BonusRefundDashboard;
import com.ruoyi.common.utils.MathUtils;
import com.ruoyi.dashboard.constants.StatKeys;

@Service
public class BonusRefundDashboardImpl implements BonusRefundDashboard {

    @Autowired
    private BonusRefundMapper bonusRefundMapper;

    @Override
    public BonusRefundStatVO selectStat(BonusRefundQuery query, List<String> keys) {
        BonusRefundStatVO vo = new BonusRefundStatVO();
        if (keys.contains(StatKeys.BONUS_REFUND_AMOUNT)) {
            vo.setAmount(MathUtils.dv(bonusRefundMapper.selectSumOfAmount(query)));
        }
        return vo;
    }

    @Override
    public List<BonusRefundDailyStatVO> selectDailyStat(BonusRefundQuery query, List<String> keys) {
        return bonusRefundMapper.selectDailyStat(query, keys);
    }
    
}
