package com.ozs.da.service;

import java.util.List;

import org.springframework.web.multipart.MultipartFile;

import com.ozs.da.entity.dataquality.ListDataDTO;
import com.ozs.da.entity.dataquality.QuerySqlDTO;
import com.ozs.da.entity.dataquality.UpdateDataDTO;
import com.ozs.da.entity.remotedb.MdmInfoDatabase;
import com.ozs.da.entity.remotedb.MdmInfoTable;
import com.ozs.da.utils.R;

/**
 * 
 * @ClassName: DataQualityService
 * @Description:数据质量管理
 * @author: Zhao You Kai
 * @date: Apr 3, 2019 2:13:36 PM
 */
public interface DataQualityService {

	/**
	 * 获取表中数据
	 * 
	 * @param tableId
	 * @param sql
	 * @param page
	 * @param pageSize
	 * @return
	 */
	R<ListDataDTO> listData(String tableId, String sql, Integer page, Integer pageSize) throws Exception;

	/**
	 * 获取数据库列表--非原始库
	 * 
	 * @param resourceName
	 * @return
	 */
	R<List<MdmInfoDatabase>> listDatabase(String resourceName) throws Exception;

	/**
	 * 通过数据库ID获取表数据列表
	 * 
	 * @param databaseId
	 * @return
	 */
	R<List<MdmInfoTable>> listTableByDatabaseId(String databaseId) throws Exception;

	R<QuerySqlDTO> getQuerySql(String tableId) throws Exception;

	/**
	 * 修改数据
	 * 
	 * @param updateData
	 * @return
	 */
	R<String> updateData(UpdateDataDTO updateData) throws Exception;

	/**
	 * 删除数据
	 * 
	 * @param updateData
	 * @return
	 */
	R<String> deleteData(UpdateDataDTO updateData) throws Exception;

	/**
	 * 下载数据模板
	 * 
	 * @param fileName
	 * @param tableId
	 * @param sql
	 * @return
	 * @throws Exception
	 */
	String downloadTemplateData(String fileName, String tableId, String sql) throws Exception;

	/**
	 * 上传数据
	 * 
	 * @param tableId
	 * @param file
	 * @return
	 * @throws Exception
	 */
	R<String> loadTemplateData(String tableId, MultipartFile file) throws Exception;

}
