package com.jiayue.ipfcst.service;

import com.jiayue.ipfcst.common.data.entity.WeatherStationInfo;
import com.jiayue.ipfcst.common.data.repository.WeatherStationInfoRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 环境设备信息业务层
 *
 * @author yh
 * @version 1.0
 * @since 2019/8/5 16:02
 */
@Service
public class WeatherStationInfoService {
    private final WeatherStationInfoRepository weatherStationInfoRepository;
    @Autowired
    public WeatherStationInfoService(WeatherStationInfoRepository weatherStationInfoRepository){
        this.weatherStationInfoRepository = weatherStationInfoRepository;
    }
    /**
     * 根据ID排序查出所有气象设备信息
     * yh
     */
    @Transactional(propagation = Propagation.NOT_SUPPORTED, readOnly = true)
    public List<WeatherStationInfo> findAllByOrderByIdAsc(){
        return weatherStationInfoRepository.findAllByOrderByIdAsc();
    }

}
