package com.yc.ship.module.trade.service.business;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yc.ship.framework.common.pojo.PageResult;
import com.yc.ship.module.trade.controller.admin.business.vo.DailyBusinessStatisticsReqVO;
import com.yc.ship.module.trade.controller.admin.business.vo.DailyBusinessStatisticsRespVO;
import com.yc.ship.module.trade.dal.mysql.order.TradeOrderMapper;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;

import javax.annotation.Resource;
import java.io.File;
import java.io.InputStream;

@Service
@Validated
public class DailyBusinessStatisticsServiceImpl implements DailyBusinessStatisticsService {
    @Resource
    private TradeOrderMapper tradeOrderMapper;

    @Override
    public PageResult<DailyBusinessStatisticsRespVO> getDailyBusinessStatisticsPage(DailyBusinessStatisticsReqVO pageReqVO) {
        IPage<DailyBusinessStatisticsRespVO> page = new Page<>(pageReqVO.getPageNo(), pageReqVO.getPageSize());
        IPage<DailyBusinessStatisticsRespVO> resultPage = tradeOrderMapper.getDailyBusinessStatisticsPage(page, pageReqVO);
        return new PageResult<>(resultPage.getRecords(), resultPage.getTotal());
    }

}
