package com.xhpc.general.service;

import com.xhpc.common.core.web.domain.AjaxResult;
import com.xhpc.common.domain.XhpcDictBiz;
import com.xhpc.general.domain.XhpcDictionary;

import java.util.List;

/**
 * 业务字典Service接口
 *
 * @author yuyang
 * @date 2021-07-19
 */
public interface IXhpcDictBizService {

    /**
     * 根据code获取数据
     *
     * @param code 字典code
     * @return 电站
     */
    public List<XhpcDictBiz> getCode(String code);

    /**Adding a parent item to the table(xhpc_dict_biz)
     *
     * @param name the dictionary's name
     * @param code the dictionary's code
     * @param sort the dictionary's sortValue
     * @return
     */
    AjaxResult addADictionaryItem(String name, String code, Integer sort);

    /**
     * Getting a dictionary data.
     *
     * The id map to dictionary table is dict_biz_id.
     * @param id
     * @return
     */
    AjaxResult selectDictionaryItem(Long id);

    /**
     * Adding a childIem to the table(xhpc_dict_biz)
     * @param parentId
     * @param code
     * @param dictKey
     * @param dictValue
     * @return
     */
    AjaxResult addAChildDictionaryItem(Long parentId,String code,String dictKey,String dictValue,Integer sort);

    /**
     * Deleting a dictionary item by id(dict_biz_id)
     * @param id
     * @return
     */
    AjaxResult deleteChildDictionaryItem(Long id);


    AjaxResult deleteParentItem(Long id);

    /**
     * Getting a list of the parent dict items by code and name.
     * @param code
     * @param name
     * @return
     */
    List<XhpcDictionary> getMainItems(String code,String name);

    /**
     * Getting a list of the child dict items by code,code,parentId.
     * @param parentId
     * @param code
     * @param name
     * @return
     */
    List<XhpcDictionary> getDetailsItems(Long parentId, String code, String name);

    /**
     * Updating the main item by code,dictValue,sort
     * @param dictBizId
     * @param code
     * @param keyValue the item's name
     * @param sort
     * @return
     */
    AjaxResult updateMainItem(Long id,String code,String dictValue,Integer sort);

    /**
     * Updating a child item by value,key.
     * @param parentId
     * @param id
     * @param value
     * @param key
     * @Param sort
     * @return
     */
    AjaxResult updateChildItem(Long parentId, Long id, String value, String key, Integer sort);

    /**
     * Deleting a bundle of child item.
     * @param ids
     * @return
     */
    AjaxResult deleteChildItems(String ids);


    /**
     * Deleting a bundle of parent item.
     */
    AjaxResult deleteParentItems(String ids);



}
