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

import cn.com.ctop.toutiao.modules.material.vo.BytedanceVideoVo;
import cn.com.ctop.toutiao.modules.report.entity.BytedanceReportMaterialDaily;
import cn.com.ctop.toutiao.modules.report.entity.BytedanceVideoEtlInfo;
import cn.com.ctop.toutiao.modules.report.mapper.BytedanceReportMaterialDailyMapper;
import cn.com.ctop.toutiao.modules.report.service.IBytedanceReportMaterialDailyService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 素材报表
 * @author jeecg-boot
 * @date   2020-04-16
 * @version V1.0
 */
@Service
@Primary

public class BytedanceReportMaterialDailyServiceImpl extends ServiceImpl<BytedanceReportMaterialDailyMapper, BytedanceReportMaterialDaily> implements IBytedanceReportMaterialDailyService {
    @Autowired
    private BytedanceReportMaterialDailyMapper bytedanceReportMaterialDailyMapper;
    @Override
    public List<BytedanceReportMaterialDaily> getListByParams(String date) {
        QueryWrapper<BytedanceReportMaterialDaily>queryWrapper = new QueryWrapper<>();
        if(null != date&&!"".equals(date.trim())){
            queryWrapper.eq("stat_datetime",date);
        }
        queryWrapper.orderByAsc("stat_datetime");
        return this.list(queryWrapper);
    }

    @Override
    public List<BytedanceVideoVo> getVideoVoByDate(String date) {
        return bytedanceReportMaterialDailyMapper.getVideoVoByDate(date);
    }

    @Override
    public List<BytedanceVideoEtlInfo> getSignatureByDate(String date) {
        return bytedanceReportMaterialDailyMapper.getSignatureByDate(date);
    }

    @Override
    public BytedanceVideoEtlInfo getEtlDataByParams(String signature, String date) {
        return bytedanceReportMaterialDailyMapper.getEtlDataByParams(signature,date);
    }


}
