package cn.com.ctop.toutiao.modules.report.service.impl;

import cn.com.ctop.toutiao.modules.report.mapper.BytedanceVideoReportMapper;
import cn.com.ctop.toutiao.modules.report.service.IBytedanceVideoReportService;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BytedanceVideoReportServiceImpl implements IBytedanceVideoReportService {

    @Autowired
    BytedanceVideoReportMapper bytedanceVideoReportMapper;

    @Override
    public PageInfo<JSONObject> getVideoReportBy(JSONArray accountIds, String startDate, String endDate, String filed, String target, String order, String clip, String shot, String plan, int pageSize, int pageNo) {
        PageHelper.startPage(pageNo,pageSize);
        List<JSONObject> jsonObjectList=bytedanceVideoReportMapper.queryVideoReportBy(accountIds,startDate,endDate,filed,target,order,clip,shot,plan);
        return new PageInfo<>(jsonObjectList);
    }

    @Override
    public List<JSONObject> getVideoDetailBy(JSONArray accountIds, String startDate, String endDate, String filed, String signature) {
        return bytedanceVideoReportMapper.queryVideoDetailBy(accountIds,startDate,endDate,filed,signature);
    }

    @Override
    public List<JSONObject> exportExcelReportBy(JSONArray accountIds, String startDate, String endDate, String filed, String target, String order, String clip, String shot, String plan) {
        return bytedanceVideoReportMapper.queryVideoReportBy(accountIds,startDate,endDate,filed,target,order,clip,shot,plan);
    }

}
