package com.huatek.busi.mapper;

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

import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import com.github.pagehelper.Page;
import com.huatek.busi.dto.BusiOfflineGisRepairDto;
import com.huatek.busi.vo.BusiOfflineGisRepairVo;

/**
 * GIS检修记录 Mapper
 *
 * @author anker_cheng
 * @date Jul 4, 2019 2:00:06 PM
 */
@Repository
public interface  BusiOfflineGisRepairMapper {

	/**
	 * 分页查询 GIS检修记录
     *
	 * @param busiOfflineGisRepairDto GIS检修记录Dto
	 * @return Page GIS检修记录List
	 */
	Page<BusiOfflineGisRepairVo> selectBusiOfflineGisRepairPage(BusiOfflineGisRepairDto busiOfflineGisRepairDto);
	/**
	 * 
	 * @param id
	 * @return
	 */
	BusiOfflineGisRepairVo getBusiOfflineGisRepairVo(String id);
	/**
	 * 
	 * @param idList
	 * @return
	 */
	int deleteBusiOfflineGisRepair(@Param("idList")List<String> idList);
	/**
	 * 
	 * @param idList
	 * @param dealReasult
	 * @return
	 */
	int dealGisRepair(@Param("idList")List<String> idList,@Param("dealReasult") String dealReasult);

    /**
     * 变压器维修次数统计</br>
     * params.subEquipmentId 设备ID</br>
     * params.sensorCode 传感器编码</br>
     * params.startTime 开始时间</br>
     * params.endTime 结束时间</br>
     * 如果参数都不传，则统计所有的数据
     * 
     * @param params
     *            参数map
     * @return 维修次数
     */
    Integer getRepairCountForGis(Map<String, Object> params);
    
    Integer getRepairCount(Map<String, Object> params);


	List<BusiOfflineGisRepairVo> findBusiOfflineGisRepair(@Param("siteId") String siteId, @Param("mainTreeId") String mainTreeId);
    
    BusiOfflineGisRepairVo isFinishedOverhaul(@Param("malfunctionId") String malfunctionId);
}