package com.hfkj.service;
import com.alibaba.fastjson.JSONObject;
import com.hfkj.entity.SecDictionary;
import com.hfkj.entity.SecRegion;

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


public interface CommonService {

    /**
     * @Title: getDictionaries
     * @Description: 获取所有的数据字典
     * @author: 机器猫
     * @param: @param codeType
     * @param: @return
     * @return: List<BaseDictionary>
     * @throws
     */
    Map<String, List<SecDictionary>> getDictionaries();

    /**
     * @Title: getDictionary
     * @Description: 精确查找数据字典值
     * @author: 机器猫
     * @param: @param codeType
     * @param: @param codeValue
     * @param: @return
     * @param: @throws Exception
     * @return: SysDictionary
     * @throws
     */
    String getDictionaryCodeName(String codeType, String codeValue);

    /**
     * @Title: mappingSysCode
     * @Description: 根据codetype，codevalue获取系统字典数据
     * @author: 机器猫
     * @param: @param codeType
     * @param: @param codeValue
     * @param: @return
     * @param: @throws Exception
     * @return: SysDictionary
     * @throws
     */
    SecDictionary mappingSysCode(String codeType, String codeValue);

    /**
     * @ClassName CommonService.java
     * @author Sum1Dream
     * @version 1.0.0
     * @Description //TODO
     * @createTime 14:53 2021/6/23
     **/
    Boolean findValue(String codeType, String codeValue);


    /**
     * @ClassName CommonService.java
     * @author Sum1Dream
     * @version 1.0.0
     * @Description //TODO
     * @createTime 16:30 2021/6/23
     **/
    List<SecDictionary> mappingSysNameOl(String codeType);

    /**
     * 根据codeType获取该类的所有字典数据
     * @param codeType
     * @return
     */
    List<SecDictionary> getDictionarys(String codeType);

    /**
     * 根据codeType获取该类的所有字典数据
     * @param codeType
     * @return
     */
    List<SecDictionary> getDictionarysAndExt(String codeType, String ext1);

    List<JSONObject> getIdAndName(String codeType);

    /**
     *
     * @Title: getProvinces
     * @Description: 获取城市信息
     * @author: 机器猫
     * @param: @return
     * @return: List<BaseRegion>
     * @throws
     */
    List<SecRegion> getCities();

    /**
     *
     * @Title: getCities
     * @Description: 根据parentID获取地市列表
     * @author: 机器猫
     * @param: @param provinceId
     * @param: @return
     * @return: List<BaseRegion>
     * @throws
     */
    List<SecRegion> getRegionsByParentId(Long parentId);

    /**
     *
     * @Title: getCities
     * @Description: 根据regionId 查询
     * @author: 胡锐
     * @param: @param provinceId
     * @param: @return
     * @return: List<BaseRegion>
     * @throws
     */
    SecRegion getRegionsById(Long regionId);

    /**
     *
     * @Title: getParentInfoByRegionId
     * @Description: 根据区域Id获取父级目录
     * @author: 机器猫
     * @param: @param regionId
     * @param: @return
     * @return: Map<String,BaseRegion>   key:province,city,region
     * @throws
     */
    Map<String, SecRegion> getParentInfoByRegionId(Long regionId);

    /**
     *
     * @Title: getRegionName
     * @Description: 组装区域名称
     * @author: 杜江
     * @Date: 2020/7/8 17:37
     * @param: [regionId]
     * @return: java.lang.String
     * @throws
     */
    String getRegionName(Long regionId);

}
