package com.gyee.wisdom.alarm.sharding.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gyee.wisdom.alarm.sharding.entity.DeviceMetrics;
import com.gyee.wisdom.alarm.sharding.entity.DeviceModel;
import com.gyee.wisdom.alarm.sharding.entity.DeviceStructure;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;


@Mapper
public interface DeviceMetricsMapper extends BaseMapper<DeviceMetrics> {

    DeviceMetrics getDeviceMetricsByCode(@Param("deviceId")String deviceId,
                                             @Param("metricCode")String metricCode);


    List<DeviceMetrics> getDeviceMetricsByDeviceId(@Param("deviceId")String deviceId);

    List<DeviceMetrics> getDeviceMetricsByStructureCode(@Param("deviceId")String deviceId,
                                                      @Param("structureCode")String nodeCode);


    DeviceMetrics selectByMetricsId(@Param("id")long id);

    int updateByMetricsId(DeviceMetrics metrics);

    int insertByMetrics(DeviceMetrics metrics);

    IPage<DeviceMetrics> pageQueryAll(Page page, String deviceId,String categorydata,String keyword,String model, String structureCode);

    DeviceMetrics selectByMetriccode(@Param("metriccode")String metriccode);
}
