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

import cn.com.ctop.toutiao.modules.report.entity.BytedanceAccountReportTaskRecord;
import cn.com.ctop.toutiao.modules.report.mapper.BytedanceAccountReportTaskRecordMapper;
import cn.com.ctop.toutiao.modules.report.service.IBytedanceAccountReportTaskRecordService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 头条账户报表任务执行记录信息
 * @author jeecg-boot
 * @date   2021-01-20
 * @version V1.0
 */
@Service
public class BytedanceAccountReportTaskRecordServiceImpl extends ServiceImpl<BytedanceAccountReportTaskRecordMapper, BytedanceAccountReportTaskRecord> implements IBytedanceAccountReportTaskRecordService {

    @Override
    public List<BytedanceAccountReportTaskRecord> listByParams(Integer status, String reportType) {
        QueryWrapper<BytedanceAccountReportTaskRecord> queryWrapper = new QueryWrapper<>();
        if(null!=status){
            queryWrapper.eq("status",status);
        }
        if(null!=reportType&&!"".equals(reportType)){
            queryWrapper.eq("type",reportType);
        }
        return this.list(queryWrapper);
    }
}
