package com.xzzn.ems.mapper;

import com.xzzn.ems.domain.EmsPointConfig;
import com.xzzn.ems.domain.vo.GeneralQueryPointOptionVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface EmsPointConfigMapper {
    EmsPointConfig selectEmsPointConfigById(Long id);

    List<EmsPointConfig> selectEmsPointConfigList(EmsPointConfig emsPointConfig);

    int insertEmsPointConfig(EmsPointConfig emsPointConfig);

    int insertBatchEmsPointConfig(@Param("list") List<EmsPointConfig> list);

    int updateEmsPointConfig(EmsPointConfig emsPointConfig);

    int updateEmsPointConfigForImport(EmsPointConfig emsPointConfig);

    int deleteEmsPointConfigById(Long id);

    int deleteEmsPointConfigByIds(Long[] ids);

    int countBySiteId(@Param("siteId") String siteId);

    int deleteBySiteId(@Param("siteId") String siteId);

    int copyTemplateToSite(@Param("templateSiteId") String templateSiteId,
                           @Param("targetSiteId") String targetSiteId,
                           @Param("operName") String operName);

    String getRegisterAddress(@Param("siteId") String siteId,
                              @Param("deviceCategory") String deviceCategory,
                              @Param("deviceId") String deviceId,
                              @Param("dataKey") String dataKey);

    List<GeneralQueryPointOptionVo> getPointNameList(@Param("siteIds") List<String> siteIds,
                                                     @Param("deviceCategory") String deviceCategory,
                                                     @Param("deviceId") String deviceId,
                                                     @Param("pointName") String pointName);

    List<EmsPointConfig> getConfigListForGeneralQuery(@Param("siteIds") List<String> siteIds,
                                                      @Param("deviceCategory") String deviceCategory,
                                                      @Param("pointIds") List<String> pointIds,
                                                      @Param("pointNames") List<String> pointNames,
                                                      @Param("deviceIds") List<String> deviceIds);

    List<EmsPointConfig> selectBySiteIdAndPointIds(@Param("siteId") String siteId,
                                                   @Param("pointIds") List<String> pointIds);

    List<EmsPointConfig> selectModbusCollectPointConfigs(@Param("siteId") String siteId);
}
