package com.cm.plugin.map.dao;

import com.cm.common.exception.RemoveException;
import com.cm.common.exception.SaveException;
import com.cm.common.exception.SearchException;
import com.cm.plugin.map.pojo.dto.GridDTO;
import com.cm.plugin.map.pojo.dto.GridPointDTO;
import com.cm.plugin.map.pojo.dto.GridRelationDTO;
import org.springframework.stereotype.Repository;

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

/**
 * When you feel like quitting. Think about why you started
 * 当你想要放弃的时候，想想当初你为何开始
 *
 * @ClassName: IGridDao
 * @Description: 网格业务
 * @Author: WangGeng
 * @Date: 2020/10/21 11:16
 * @Version: 1.0
 **/
@Repository
public interface IGridDao {
    /**
     * 保存网格
     *
     * @param params
     * @throws SaveException
     */
    void saveGrid(Map<String, Object> params) throws SaveException;

    /**
     * 保存网格关联关系
     *
     * @param params
     * @throws SaveException
     */
    void saveGridRelation(Map<String, Object> params) throws SaveException;

    /**
     * 保存网格点
     *
     * @param params
     * @throws SaveException
     */
    void saveGridPoint(Map<String, Object> params) throws SaveException;

    /**
     * 删除网格
     *
     * @param params
     * @throws RemoveException
     */
    void deleteGrid(Map<String, Object> params) throws RemoveException;

    /**
     * 删除网格点
     *
     * @param params
     * @throws RemoveException
     */
    void deleteGridPoint(Map<String, Object> params) throws RemoveException;

    /**
     * 删除网格关联关系
     *
     * @param params
     * @throws RemoveException
     */
    void deleteGridRelation(Map<String, Object> params) throws RemoveException;

    /**
     * 获取关联关系列表
     *
     * @param params
     * @return
     * @throws SearchException
     */
    List<GridRelationDTO> listGridRelation(Map<String, Object> params) throws SearchException;

    /**
     * 获取网格列表
     *
     * @param relationId 关联ID
     * @return
     * @throws SearchException
     */
    List<GridDTO> listGridByRelationId(String relationId) throws SearchException;

    /**
     * 获取网格点列表
     *
     * @param gridId 网格ID
     * @return
     * @throws SearchException
     */
    List<GridPointDTO> listPointByGridId(String gridId) throws SearchException;

    /**
     * 获取网格点列表
     *
     * @param relationIds 关联ID列表
     * @return
     * @throws SearchException
     */
    List<GridDTO> listGridByRelationIds(List<String> relationIds) throws SearchException;

    /**
     * 网格列表group
     *
     * @param relationIds
     * @return
     * @throws SearchException
     */
    List<GridDTO> listGridGroupByRelationIds(List<String> relationIds) throws SearchException;

    /**
     * 获取网格点列表
     *
     * @param gridIds 网格ID列表
     * @return
     * @throws SearchException
     */
    List<GridPointDTO> listPointByGridIds(List<String> gridIds) throws SearchException;

}
