package com.yihu.hos.datacollect.dao.intf;

import com.yihu.hos.datacollect.model.DtoJobDataset;
import com.yihu.hos.datacollect.model.RsJobDataset;
import com.yihu.hos.web.framework.dao.XSQLGeneralDAO;
import com.yihu.hos.web.framework.model.DataGridResult;
import com.yihu.hos.web.framework.model.SimpleChartItem;
import com.yihu.hos.resource.model.RsDatasourceDataset;

import java.util.List;
import java.util.Map;

/**
 * Created by hzp on 2016/1/11.
 */
public interface IDatacollectDao extends XSQLGeneralDAO {

    /**
     * 通过机构代码获取版本号
     */
    public String getVersionByQLC(String orgCode) throws Exception;

    /**
     * 根据JobId获取Cron表达式
     */
    public String getCronByJobId(String jobId);

    /**
     * 获取任务列表
     * @return
     */
    public DataGridResult getJobList(Map<String, Object> conditionMap, Integer page, Integer pageSize) throws Exception;

    /**
     * 获取任务数据集
     * @return
     * @throws Exception
     */
    public List<RsJobDataset> getJobDataset(String jobId) throws Exception;

    /**
     * 获取版本名称
     */
    public String getSchemeAndVersion(String schemeVersionId) throws Exception;

    /**
     * 修改任务状态
     */
    public void validJob(String id, String valid) throws Exception;

    /**
     * 删除任务关联数据集
     */
    public void deleteJobDatasetByJobId(String jobId) throws Exception;

    /**
     * 通过版本获取配置的数据集--数据源
     * @throws Exception
     */
    public List<RsDatasourceDataset> getDatasourceDataset(String stdVersion) throws Exception;

    /**
     * 删除数据集数据源关联
     */
    public void deleteDatasourceDatasetById(String id) throws Exception;


    /**
     * 通过任务ID获取相关数据集
     */
    public List<DtoJobDataset> getDatacollectDataset(String jobId) throws Exception;

    /**
     * 获取任务日志列表
     */
    public DataGridResult getJobLogDetail(Map<String, Object> conditionMap, Integer page, Integer pageSize) throws Exception;

    /**
     * 获取任务日志列表
     */
    public DataGridResult getJobLog(Map<String, Object> conditionMap, Integer page, Integer pageSize) throws Exception;

    /**
     * 获取采集日志统计
     */
    public List<Map<String, Object>> getJobLogCount(String logId) throws Exception;

    /**
     * 任务详细根据数据集分组
     */
    public List<SimpleChartItem> getJobLogDataset(String logId) throws Exception;
}
