package cn.cecep.talroad.mapper.analysis;

import cn.cecep.talroad.domain.analysis.SRaRealTimeAnalysisRun;
import cn.cecep.talroad.vo.query.analysis.SRaRealTimeAnalysisRunQuery;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.sql.Timestamp;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * 企业装备运行情况实时分析Mapper接口
 *
 * @author szhpt
 * @date 2023-03-24*/
@Mapper
public interface SRaRealTimeAnalysisRunMapper extends BaseMapper<SRaRealTimeAnalysisRun>
{
    /**
     * 查询企业装备运行情况实时分析列表
     *
     * @param sRaRealTimeAnalysisRun 企业装备运行情况实时分析
     * @return 企业装备运行情况实时分析集合
     */
    public List<SRaRealTimeAnalysisRun> selectSRaRealTimeAnalysisRunList(SRaRealTimeAnalysisRunQuery sRaRealTimeAnalysisRun);

    /**
     * 获取设备名称options
     * @return
     */
    List<Map<String, Object>> pullDeviceNameOptions(@Param("factoryName") String factoryName);

    /**
     * @Author: Mr.Yanghongtao
     * @data: 2023/3/31 4:54 PM
     * @Deseription: 查询企业装备运行情况实时分析列表
     * @Params: null
     * @Return:
     * @Throws:
     */
    List<SRaRealTimeAnalysisRun> selectListByDate(@Param("startTime") Timestamp startTime,
                                                  @Param("endTime") Timestamp endTime,
                                                  @Param("updateTime") Timestamp updateTime
    );

    /**
     * @Author: Mr.Yanghongtao
     * @data: 2023/3/31 4:54 PM
     * @Deseription: 查询企业装备运行情况实时分析列表
     * @Params: null
     * @Return:
     * @Throws:
     */
    List<SRaRealTimeAnalysisRun> threadSelectListByDate(@Param("startTime") Timestamp startTime,
                                                  @Param("endTime") Timestamp endTime,
                                                  @Param("updateTime") Timestamp updateTime
    );

    /**
     * @Author: Mr.Yanghongtao
     * @data: 2023/4/1 2:30 PM
     * @Deseription: 查询企业装备运行情况实时分析列表
     * @Params: null
     * @Return:
     * @Throws:
     */
    List<SRaRealTimeAnalysisRun> selectSRaRealTimeAnalysisRunListByDeviceIdAndTime(@Param("deviceId") List<String> deviceId, @Param("dateTime") Timestamp dateTime);


    /**
     * @Author: Mr.Yanghongtao
     * @data: 2023/4/5 10:25 PM
     * @Deseription: 插入
     * @Params: null
     * @Return:
     * @Throws:
     */
    void insertSRaRealTimeAnalysisRun(SRaRealTimeAnalysisRun sRaRealTimeAnalysisRun);


    /**
     * @Author: Mr.Yanghongtao
     * @data: 2023/4/5 10:25 PM
     * @Deseription: 批量插入
     * @Params: null
     * @Return:
     * @Throws:
     */
    void insertSRaRealTimeAnalysisRuns(List<SRaRealTimeAnalysisRun> sRaRealTimeAnalysisRun);


    List<SRaRealTimeAnalysisRun> selectAnalysisRunByParams(SRaRealTimeAnalysisRun oldBasDevice);

    List<SRaRealTimeAnalysisRun> analysisCurve(@Param("deviceId") String deviceId, @Param("monitoringStartTime") Date monitoringStartTime, @Param("monitoringEndTime") Date monitoringEndTime);

    String selectListMaxTime(@Param("deviceId") String deviceId, @Param("monitoringStartTime") Date monitoringStartTime, @Param("monitoringEndTime") Date monitoringEndTime);
}

