package io.renren.modules.levelManage.service;

import com.baomidou.mybatisplus.extension.service.IService;
import io.renren.common.utils.PageUtils;
import io.renren.modules.levelManage.entity.UniversalTableEntity;

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

/**
 *
 *
 * @author chenshun
 * @email sunlightcs@gmail.com
 * @date 2022-03-30 16:57:16
 */

public interface UniversalTableService extends IService<UniversalTableEntity> {

    PageUtils queryPage(Map<String, Object> params);

    Integer removeByIdsFromTableName(List<Long> ids,String tableName);

    Map<String,Object> selectById(Long id,String tableName,List<String> tableCols);

    List<Map<String,Object>> list(String tableName,List<String> tableCols,Integer page,Integer size);

    List<Map<String,Object>> selectByName(String tableName,List<String> tableCols,Integer page,Integer limit,String name);

    List<Map<String,Object>> selectByNameWithParent(String tableName,List<String> tableCols,Integer page,Integer limit,
                                                    String name,Long parentRowId,Long tableId);

    Integer getCountByName(String tableName,String name);

    Long saveWithCols(String tableName,List<Map<String,Object>> cols,UniversalTableEntity universalTableEntity);

    Integer updateWithCols(String tableName,List<Map<String,Object>> cols,Long id);

    List<Map<String,Object>> listAllItem(String tableName);

    List<Map<String,Object>> listNotLeafItem(String tableName);

    List<Map<String,Object>> listLeafItem(String tableName, List<String> tableCols);

    List<Map<String, Object>> listBySonIds(String tableName, List<String> tableCols, List<Long> ids, Integer page, Integer size);

    boolean updateHbaseTableName(String tableName, Long id, String hbaseTableName);

    String selectNameById(String tableName, Long id);

    Integer getCount(String tableName);

    Integer getCountByNameWithParent(String tableName, String name, Long parentRowId, Long tableId);

    List<Map<String,Object>> listItemWithLeafInfo(String tableName);

    List<Map<String,Object>> listNotLeafItemInfo(String tableName, List<String> tableCols);

    List<Map<String,Object>>  listAllItemInfo(String tableName, List<String> tableCols);

    List<Map<String, Object>> listBySonIdsNotLimit(String tableName, List<String> tableCols, List<Long> sonIds);
}

