package com.huatek.busi.mapper;

import java.util.List;

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

import com.github.pagehelper.Page;
import com.huatek.busi.dto.BusiEvaMonitorConfigDto;
import com.huatek.busi.vo.BusiEvaMonitorConfigVo;
import com.huatek.busi.vo.BusiEvaMonitorEquipmentVo;
import com.huatek.busi.vo.BusiEvaMonitorRefVo;
import com.huatek.busi.vo.BusiEvaMonitorUnitIndicatorsVo;
import com.huatek.busi.vo.BusiEvaMonitorUnitVo;

/**
 * 考评指标配置 Mapper
 *
 * @author anker_cheng
 * @date Jul 23, 2019 9:50:26 AM
 */
@Repository
public interface BusiEvaMonitorConfigMapper {

    /**
     * 获取监测设备(类型)名称列表
     * 
     * @return
     */
    List<BusiEvaMonitorEquipmentVo> findBusiEvaMonitorEquipmentList();

    /**
     * 获取监测单元列表
     * 
     * @param equipTypeId
     *            监测设备（类型）ID
     * @return
     */
    List<BusiEvaMonitorUnitVo> findBusiEvaMonitorUnitList(@Param("equipTypeId") String equipTypeId);

    /**
     * 获取单元考核指标列表
     * 
     * @param unitId
     *            监测单元
     * @return
     */
    List<BusiEvaMonitorUnitIndicatorsVo> findBusiEvaMonitorUnitIndicators(@Param("unitId") String unitId);

    /**
     * 分页查询 考评指标配置
     *
     * @param busiEvaMonitorConfigDto
     *            考评指标配置Dto
     * @return Page 考评指标配置List
     */
    Page<BusiEvaMonitorConfigVo> selectBusiEvaMonitorConfigPage(BusiEvaMonitorConfigDto busiEvaMonitorConfigDto);
    
    
    /**
     * 导出考评指标配置
     *
     * @param busiEvaMonitorConfigDto
     *            考评指标配置Dto
     * @return 考评指标配置List
     */
    List<BusiEvaMonitorConfigVo> exportBusiEvaMonitorConfigData(BusiEvaMonitorConfigDto busiEvaMonitorConfigDto);
//
//    /**
//     * 查询sensorId配置的考评指标
//     * 
//     * @param sensorId
//     *            传感器ID
//     * @return
//     */
//    List<String> selectShowAttr(@Param("sensorId")String sensorId);

    /**
     * 获取传感器编码配置的考评指标
     * 
     * @param sensorCode
     *            传感器编码
     * @return 考评指标
     */
    List<BusiEvaMonitorUnitIndicatorsVo> findIndicatorsBySensorCode(@Param("sensorCode")String sensorCode);

    /**
     * 重复性校验
     * 
     * @param sensorCode
     *            传感器编码
     * @param unitIndicatorsId
     *            单元考核指标
     * @param id
     *            主键ID
     * @return sensorName
     */
    String checkExist(@Param("sensorCode") String sensorCode, @Param("unitIndicatorsId") String unitIndicatorsId,
        @Param("id") String id);

    /**
     * 根据ID获取
     * 
     * @param id
     * @return
     */
    BusiEvaMonitorConfigVo findBusiEvaMonitorConfigVo(@Param("id")String id);
    
    /**
     * 获取监测单元信息
     */
    BusiEvaMonitorUnitVo findBusiEvaMonitorUnit(@Param("equipmentType")String equipmentType, @Param("type")String type);
    
    /**
     * 获取监测单元考核指标List
     */
    List<BusiEvaMonitorRefVo> findBusiEvaMonitorRefList(@Param("unitId")String unitId,@Param("phase")String phase);
    
    /**
     * 获取传感器考核指标
     * @param sensorId
     * @return
     */
    List<BusiEvaMonitorUnitIndicatorsVo> findBusiEvaMonitorUnitIndicatorsList(@Param("sensorId")String sensorId);
    
    /**
     * 删除传感器考核指标
     */
    int deleteBusiEvaMonitorConfig(@Param("sensorId")String sensorCode);

}