package com.jiayue.ipfcst.common.data.repository;

import com.jiayue.ipfcst.common.data.entity.ReportWindTowerStatusData;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.Date;
import java.util.List;

/**
 * 上报测风塔数据实体仓储
 *
 * @author zzy
 * @version 1.0
 * @since 2019/8/6 13:08
 */
public interface ReportWindTowerStatusDataRepository extends JpaRepository<ReportWindTowerStatusData, Integer>, JpaSpecificationExecutor<ReportWindTowerStatusData> {
    void deleteByTimeBetween(Date startTime, Date endTime);
    void deleteAllByTime(Date time);
    /**
     * 根据设备号和时间段获取测风塔数据
     *
     * @param equipmentNo
     * @param startTime
     * @param endTime
     * @return
     */
    List<ReportWindTowerStatusData> findByEquipmentNoAndTimeBetween(Integer equipmentNo, Date startTime, Date endTime);
}
