package com.huatek.frame.base.mapper;

import com.github.pagehelper.Page;
import com.huatek.frame.base.dto.ModelDTO;
import com.huatek.frame.base.entity.*;
import com.huatek.frame.base.vo.*;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

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

/**
 * 模型 Mapper
 *
 * @date 2023-2-8 14:03:45
 */

@Repository
public interface ModelMapper {

	/**
	 * 同步 模型
     *
	 * @param  list 模型名称列表
	 */
	void updateModelList(List<ModelDTO> list);


	/**
	 * 分页查询 模型列表
	 * @return Page 模型列表List
	 */
	Page<ModelVO> selectModelList(ModelDTO dto);

	List<ModelVO> selectModelListRemoveSelf(ModelDTO dto);

	/**
	 * 更新 模型信息
	 *
	 * @param  dto 模型信息
	 */
	void updateModel(ModelDTO dto);

	void updateModelParams(ModelDTO dto);
	void enableModelComponentData(@Param("enableType") String enableType, @Param("ids") String[] ids);

	/**
	 * 查询装置列表
	 *
	 * @param  modelType 模型类型
	 */
	List<SysModelDevice>  selectDeviceListList(String modelType);

	/**
	 * 查询站点列表
	 *
	 */
	List<SiteVo> selectStationList();


	List<BusiSiteTree> selectGisStatus(String siteId);
	/**
	 * 子树列表
	 */
	// 变压器
	List<BusiTransfromerSubTree> findListByEquipmentIdAndType(@Param("equipmentId") String equipmentId, @Param("equipmentType") String equipmentType);

	// GIS
	List<BusiGisSubTree> findListByEquipmentIdAndTypeGis(@Param("equipmentId") String equipmentId, @Param("equipmentType") String equipmentType);

	// 避雷器
	List<BusiArresterSubTree> findListByEquipmentIdAndTypeBlq(@Param("equipmentId") String equipmentId, @Param("equipmentType") String equipmentType);

	// 电缆
	List<BusiCableSubTree> findListByEquipmentIdAndTypeDl(@Param("equipmentId") String equipmentId, @Param("equipmentType") String equipmentType);

	// 发电机
	List<BusiGeneratorSubTree> findListByEquipmentIdAndTypeGen(@Param("equipmentId") String equipmentId, @Param("equipmentType") String equipmentType);

	/**
	 * 传感器列表
	 */
	// 变压器
	List<BusiSensorVo> querySensorByEquipmentId(@Param("equipmentId") String equipmentId);

	// GIS
	List<BusiSensorVo> querySensorByEquipmentIdGis(@Param("equipmentId") String equipmentId);

	// 避雷器
	List<BusiSensorVo> querySensorByEquipmentIdBlq(@Param("equipmentId") String equipmentId);

	// 开关柜
	List<BusiSensorVo> querySensorByEquipmentIdCw(@Param("equipmentId") String equipmentId);

	// 电缆
	List<BusiSensorVo> querySensorByEquipmentIdDl(@Param("equipmentId") String equipmentId);

	// 发电机
	List<BusiSensorVo> querySensorByEquipmentIdGen(@Param("equipmentId") String equipmentId);

	/*变压器*/
	Map<String, Object> selectYspRecentlyData(@Param("sensorId")String sensorId);

	Map<String, Object> selectJfRecentlyData(@Param("sensorId")String sensorId);

	Map<String, Object> selectTxRecentlyData(@Param("sensorId")String sensorCode);

	Map<String, Object> selectHwRecentlyData(@Param("sensorId")String sensorCode);

	List<Map<String, Object>> selectTpRecentlyDataList(@Param("sensorId")String sensorCode);

	Map<String, Object> selectRxRecentlyData(@Param("sensorId")String sensorCode, @Param("type") String type);

	String selectVideoUrl(String sensorCode);

	Map<String, Object> selectQxRecentlyData(@Param("sensorId")String sensorCode);

	/**
	 * 变压器测温装置
	 * @param sensorCode
	 * @return
	 */
	Map<String, Object> selectCwzzRecentlyData(@Param("sensorId")String sensorCode);

	/**
	 * 变压器绕组测温
	 * @param sensorCode
	 * @return
	 */
	Map<String, Object> selectRzcwRecentlyData(@Param("sensorId")String sensorCode);

	/*GIS*/
	Map<String, Object> selectSf6RecentlyData(@Param("sensorId")String sensorCode);

	Map<String, Object> selectTpRecentlyDataGis(@Param("sensorId")String sensorCode);

	Map<String, Object> selectSf6EnvRecentlyData(@Param("sensorId")String sensorCode);

	/*出线场*/
	Map<String, Object> selectJyRecentlyData(@Param("sensorId")String sensorCode);

	Map<String, Object> selectTpRecentlyDataBlq(@Param("sensorId")String sensorCode);

	/*开关柜*/
	Map<String, Object> selectCwRecentlyData(@Param("sensorCodes") List<String> sensorCodes);

	/*电缆*/
	Map<String, Object> selectDlhlRecentlyData(@Param("sensorId")String sensorCode); // 电缆环流

	Map<String, Object> selectDlgRecentlyData(@Param("sensorId")String sensorCode); // 电缆沟环境

	/*发电机*/
	Map<String, Object> selectZdRecentlyData(@Param("sensorId")String sensorId); // 振动

	Map<String, Object> selectYlRecentlyData(@Param("sensorId")String sensorId); // 压力

	Map<String, Object> selectGenJfRecentlyData(@Param("sensorId")String sensorId); // 压力

	List<MasterStationPartVO> selectMasterStation(@Param("modelId") String modelId);

	List<BusiSensorNewVo> querySensorByEquipmentIdCwNew(@Param("mainTreeId") String mainTreeId);
}


