package com.cm.common.plugin.dao.dataarea;

import com.cm.common.exception.RemoveException;
import com.cm.common.exception.SaveException;
import com.cm.common.exception.SearchException;
import com.cm.common.exception.UpdateException;
import com.cm.common.plugin.pojo.dtos.dataarea.DataAreaDTO;
import com.cm.common.pojo.dtos.ZTreeDTO;
import org.springframework.stereotype.Repository;

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

/**
 * @ClassName: IAreaDao
 * @Description: 地区字典
 * @Author: WangGeng
 * @Date: 2019/1/6 3:49 PM
 * @Version: 1.0
 **/
@Repository
public interface IDataAreaDao {

    /**
     * 新增地区字典
     *
     * @param params
     * @throws SaveException
     */
    void saveArea(Map<String, Object> params) throws SaveException;

    /**
     * 删除地区字典
     *
     * @param params
     * @throws RemoveException
     */
    void removeArea(Map<String, Object> params) throws RemoveException;

    /**
     * 修改地区字典
     *
     * @param params
     * @throws UpdateException
     */
    void updateArea(Map<String, Object> params) throws UpdateException;

    /**
     * 地区字典列表
     *
     * @param params
     * @return
     * @throws SearchException
     */
    List<DataAreaDTO> listArea(Map<String, Object> params) throws SearchException;

    /**
     * 地区字典详情
     *
     * @param params
     * @return
     * @throws SearchException
     */
    DataAreaDTO getArea(Map<String, Object> params) throws SearchException;

    /**
     * 获取最后一个字地区字典
     *
     * @param areaParentId
     * @return
     * @throws SearchException
     */
    DataAreaDTO getLastByParentId(String areaParentId) throws SearchException;

    /**
     * 地区字典ZTree列表
     *
     * @param params
     * @return
     * @throws SearchException
     */
    List<ZTreeDTO> listZTreeArea(Map<String, Object> params) throws SearchException;

    /**
     * 子列表个数
     *
     * @param id
     * @return
     * @throws SearchException
     */
    Integer countByParentId(String id) throws SearchException;

}
