package ink.wgink.module.map.dao.grid;

import ink.wgink.exceptions.RemoveException;
import ink.wgink.exceptions.SaveException;
import ink.wgink.exceptions.SearchException;
import ink.wgink.exceptions.UpdateException;
import ink.wgink.interfaces.init.IInitBaseTable;
import ink.wgink.module.map.pojo.dtos.grid.GridDTO;
import ink.wgink.module.map.pojo.pos.grid.GridPO;
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 extends IInitBaseTable {
    /**
     * 保存网格
     *
     * @param params
     * @throws SaveException
     */
    void save(Map<String, Object> params) throws SaveException;

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

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

    /**
     * 更新网格
     *
     * @param params
     * @throws UpdateException
     */
    void update(Map<String, Object> params) throws UpdateException;

    /**
     * 网格详情
     *
     * @param params
     * @return
     * @throws SearchException
     */
    GridDTO get(Map<String, Object> params) throws SearchException;

    /**
     * 网格详情
     *
     * @param params
     * @return
     * @throws SearchException
     */
    GridPO getPO(Map<String, Object> params) throws SearchException;

    /**
     * 获取网格列表
     *
     * @param params
     * @return
     * @throws SearchException
     */
    List<GridDTO> list(Map<String, Object> params) throws SearchException;

    /**
     * 网格列表group
     *
     * @param params
     * @return
     * @throws SearchException
     */
    List<GridDTO> listGroup(Map<String, Object> params) throws SearchException;

    /**
     * 区域最后网格
     *
     * @param params
     * @return
     * @throws SearchException
     */
    GridPO getAreaLastPO(Map<String, Object> params) throws SearchException;
}
