/**
 * 
 */
package com.huatek.busi.service;

import com.huatek.busi.dto.BusiSiteTreeDto;
import com.huatek.busi.dto.BusiSiteTreeRootNodeDto;
import com.huatek.busi.entity.BusiSiteTree;
import com.huatek.busi.vo.BusiEquipmentVo;
import com.huatek.busi.vo.BusiTreeNodeVo;
import com.huatek.busi.vo.SensiorIdExportVo;
import com.huatek.busi.vo.TransformerTmpVo;

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

/**
  * @ClassName: BusiSiteTreeService
  * @FullClassPath: com.huatek.busi.service.BusiSiteTreeService
  * @Description: 站点树服务
  * @author: Arno
  * @date: Jun 21, 2019 10:22:41 AM
  * @version: 1.0
  */
public interface BusiSiteTreeService {

	/** 
	* @Title: findByPK 
	* @Description: TODO 
	* @createDate: Jul 19, 2019 3:30:59 PM
	* @param    pk 主键
	* @return   BusiSiteTree    
	*/ 
	BusiSiteTree findByPK(String pk);
	
	/** 
	* @Title: insertSiteNode 
	* @Description: 新增站点节点 
	* @createDate: Jun 24, 2019 10:03:30 AM
	* @param    siteId     -->> 站点ID
	* @param    siteName   -->> 站点名称
	* @return   Boolean    
	*/ 
	public Boolean insertSiteNode(String siteId, String siteName); 
	
	
	
	/** 
	* @Title: insertSiteTypeNode 
	* @Description: 新增设备类型节点 
	* @createDate: Jun 24, 2019 10:03:30 AM
	* @param    parentId     -->> 站点节点ID
	* @param    equipmentMap   -->> 站点名称
	* @return   Boolean    
	*/ 
	public Boolean insertSiteTypeNode(String parentId, Map<String, Object> equipmentMap); 
	
	
	/** 
	* @Title: insertSiteEquipmentNode 
	* @Description: 新增站点设备 
	* @createDate: Jun 24, 2019 10:03:30 AM
	* @param    parentId     -->> 设备类型节点ID
	* @param    count       -->> 设备数量
	* @return   Boolean    
	*/ 
	public Boolean insertSiteEquipmentNode(String parentId, Integer count);


	BusiSiteTreeRootNodeDto getSiteEquipmentNodeBySiteIdAndEquType(String siteId, String equType);
	
	
	/** 
	* @Title: updateNode 
	* @Description: 修改节点名称
	* @createDate: Jun 24, 2019 4:52:56 PM
	* @param    nodeId  节点ID
	* @param    newName  节点新名称
	* @return   Boolean    
	*/ 
	public Boolean updateNode(BusiSiteTreeDto busiSiteTreeDto);
	
	
	/** 
	* @Title: updateNodeFromEquipment 
	* @Description: 修改节点名称
	* @createDate: Jun 24, 2019 4:52:56 PM
	* @param    nodeId  节点ID
	* @param    newName  节点新名称
	* @return   Boolean    
	*/ 
	public Boolean updateNodeFromEquipment(String nodeId, String newName);
	
	
	/** 
	* @Title: deleteNode 
	* @Description: 删除节点
	* @createDate: Jun 24, 2019 4:52:56 PM
	* @param    nodeId  节点ID
	* @return   Boolean    
	*/ 
	public Boolean deleteNode(String nodeId);
	
	
	/** 
	* @Title: getChildrens 
	* @Description: 获取子节点节点
	* @createDate: Jun 24, 2019 4:52:56 PM
	* @param    nodeId  节点ID
	* @return   Boolean    
	*/ 
	public List<BusiSiteTree> getChildrens(String nodeId);
	
	/**
	 * 根据设备编码获取站点信息
	 */
	BusiSiteTree  geBusiSiteTreeBysystemCode(String systemCode);
	/**
	 * 根据站点ID获取站点树信息
	 */
	List<BusiSiteTree> findListBySiteId(String siteId);
    
    /**
     * 导出Sensior编号
     */
	List<SensiorIdExportVo> exportSensiorData(String systemCode);
    
    
    List<BusiTreeNodeVo> siteTree(String parentId);

	List<BusiTreeNodeVo> siteTreeForCalculate(String parentId);

	Boolean updateSiteTreeName(String siteId, String newName);

    /**
     * 获取站点设备树上的主设备列表
     * 
     * @param equipmentType
     *            类型
     * @return
     */
	List<BusiTreeNodeVo> findMainEquipmentList(String[] equipmentTypes);

	List<BusiTreeNodeVo> findGisMainEquipmentList(String equipmentType);


	/** 
	* @Title: findByTransformerBySiteId 
	* @Description: 根据站点id获取变压器数据 
	* @createDate: Aug 21, 2019 3:38:07 PM
	* @param    siteId 站点ID
	* @return   List<Object>    
	*/ 
	List<TransformerTmpVo> findByTransformerBySiteId(String siteId);

	String getDefaultSiteId();
	
	/**
	 * 获取站点设备树名称
	 */
	BusiEquipmentVo findBySensorCode(String sensorCode, String type);
	
	/** 
	* @Title: selectByTransformerAndBindRelationBySiteId 
	* @Description: 根据站点id查询站点变压器绑定信息
	* @createDate: Aug 21, 2019 3:38:07 PM
	* @param    siteId 站点ID
	* @return   List<Object>    
	*/ 
	List<TransformerTmpVo> selectByTransformerAndBindRelationBySiteId(String siteId,String equipmentId);
	
	/**
	 * 获取数据输入站点树
	 */
	List<BusiTreeNodeVo> inputDataTree(String parentId);

	BusiSiteTree findByEquType(String equType);

	BusiTreeNodeVo findByNameAndEquType(String equName, String eqType);

	BusiTreeNodeVo findByIdAndEquType(String id, String eqType);

	List<BusiSiteTree> findByParentId(String id);

	List<BusiSiteTree> findByParentIds(List<String> ids);

	BusiTreeNodeVo findByEquNumAndequNameAndEquType(String systemCode, String equName, String eqType);

	List<BusiTreeNodeVo> findAll();

	List<BusiTreeNodeVo> findByEquTypes(String equType);

	List<BusiTreeNodeVo> findThirdLevelByEquTypes(String type, String equType);

	BusiSiteTree findByMainEquipmentIdAndSiteId(String mainEquipmentId, String siteId);
}
