package com.hai.service.impl;

import com.alibaba.fastjson.JSONObject;
import com.hai.dao.order.OrderStatisticsMapperExt;
import com.hai.service.OrderStatisticsService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@Service("orderStatisticsService")
public class OrderStatisticsServiceImpl implements OrderStatisticsService {

    @Resource
    private OrderStatisticsMapperExt orderStatisticsMapperExt;

    @Override
    public List<Map<String, Object>> orderStatisticsByYMD(JSONObject object) {
        return orderStatisticsMapperExt.orderStatisticsByYMD(object.getInteger("dateType"), object.getInteger("num"));
    }

    @Override
    public List<Map<String, Object>> orderStatisticsByProductType(JSONObject object) {
        return orderStatisticsMapperExt.orderStatisticsByProductType(object.getInteger("dateType"));
    }
}
