package com.yeejoin.amos.fas.business.dao.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.fas.business.vo.AssoEquipsVo;
import com.yeejoin.amos.fas.business.vo.EquipmentPointVo;
import com.yeejoin.amos.fas.business.vo.EquipmentSpecificForRiskVo;
import com.yeejoin.amos.fas.business.vo.EquipmentSpecificVo;
import com.yeejoin.amos.fas.dao.entity.EquipmentSpecific;
import com.yeejoin.amos.fas.dao.entity.FmeaEquipmentPoint;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

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

/**
 * 设备配置 Mapper 接口
 *
 * @author zjw
 * @date 2020-11-04
 */
@Repository
public interface EquipmentSpecificMapper extends BaseMapper<EquipmentSpecificVo> {

    Long saveBatch(List<FmeaEquipmentPoint> list);

    int deletPointBuFmeaId(@Param("fmeaId")Long fmeaId,@Param("importantEquipId")Long importantEquipId);

    List<AssoEquipsVo>getAssoEquips(@Param("fmeaId")Long fmeaId, @Param("indexIds")List<Long> indexIds, @Param("pageNumber")int pageNumber,@Param("pageSize") int pageSize);
    /**
     * 查询设备指标
     * @param fmeaId
     * @param importantEquipId
     * @param equimentId
     * @param equipmentPointName
     * @return
     */
    List<EquipmentPointVo> getBindEquipment(@Param("fmeaId")Long fmeaId, @Param("importantEquipId")Long importantEquipId, @Param("equimentId")Long equimentId, @Param("equipmentPointName")String equipmentPointName);
    /**
     * 获取配置数据
     * @param pageNumber
     * @param pageSize
     * @param name
     * @param code
     * @param equipmentId
     * @return
     */
    List<EquipmentSpecificVo> getEquipmentBySpe(@Param("pageNumber") int pageNumber, @Param("pageSize") int pageSize, @Param("name")String name, @Param("code")String code,@Param("equipmentId") String equipmentId, @Param("equipmentIdList") List<Long> equipmentIdList);
    int getEquipmentBySpeCount( @Param("name")String name, @Param("code")String code,@Param("equipmentId") String equipmentId, @Param("equipmentIdList") List<Long> equipmentIdList);


    /**
     * 查询绑定关系设备
     * @param equipmentId
     * @param fname
     * @return
     */
    List<EquipmentSpecificVo> getFireEquiments(@Param("equipmentId")String equipmentId, @Param("fname")String fname);

    String findEquipNameById(@Param("id")long id);

    /**
      * <pre>
      * @Description: 通过id查询
      * </pre>
      *
      * @MethodName:
      * @Param: [id]
      * @Return: EquipmentSpecific
      * @Throws
      * @Author keyong
      * @Date 2020/11/17 19:32
      */
    EquipmentSpecificForRiskVo getOneById(@Param("id")long id);

    /**
     * 查询重点设备关联消防炮
     * @param equipmentId
     * @return
     */
    Map queryFireMonitor(@Param("equipmentId") String equipmentId, @Param("code") String fireMonitor);

    int getOneByQrcode(@Param("qrCode") String qrCode);

    EquipmentSpecific getSpecificById(@Param("id") Long id);

    Long getIndexByIndexId(@Param("indexId") Long indexId);
}
