package com.njcn.influx.imapper;

import com.njcn.influx.ano.Param;
import com.njcn.influx.ano.Select;
import com.njcn.influx.base.InfluxDbBaseMapper;
import com.njcn.influx.pojo.bo.HarmonicHistoryData;
import com.njcn.influx.pojo.dto.StatisticalDataDTO;
import com.njcn.influx.pojo.po.PowerQualityData;
import com.njcn.influx.query.InfluxQueryWrapper;

import java.util.List;

/**
 * 类的介绍：
 *
 * @author xuyang
 * @version 1.0.0
 * @createTime 2023/5/5 14:39
 */

public interface CommonMapper extends InfluxDbBaseMapper<PowerQualityData> {

    StatisticalDataDTO getLineRtData(InfluxQueryWrapper influxQueryWrapper);

    List<StatisticalDataDTO> getDeviceRtData(InfluxQueryWrapper influxQueryWrapper);

    List<StatisticalDataDTO> getDeviceRtDataByTime(InfluxQueryWrapper influxQueryWrapper);

    StatisticalDataDTO getLineHistoryData(InfluxQueryWrapper influxQueryWrapper);

    @Select(value = "#{sql}",resultType = StatisticalDataDTO.class)
    StatisticalDataDTO selectBySql(@Param("sql") StringBuilder sql);

    @Select(value = "#{sql}",resultType = StatisticalDataDTO.class)
    List<?> selectLimitTargetBySql(@Param("sql")String sql);

    @Select(value = "#{sql}",resultType = HarmonicHistoryData.class)
    List<HarmonicHistoryData> getHistoryResult(@Param("sql")String sql);
}
