package com.jiayue.ipfcst.service;

import com.jiayue.ipfcst.common.data.entity.WindTurbineInfo;
import com.jiayue.ipfcst.common.data.repository.WindTurbineInfoRepository;
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 WindTurbineInfoService {
    private final WindTurbineInfoRepository windTurbineInfoRepository;
    @Autowired
    public WindTurbineInfoService(WindTurbineInfoRepository windTurbineInfoRepository){
        this.windTurbineInfoRepository = windTurbineInfoRepository;
    }
    /**
     * 根据ID排序查出所有 测风塔设备信息
     * yh
     */
    @Transactional(propagation = Propagation.NOT_SUPPORTED, readOnly = true)
    public List<WindTurbineInfo> findAllByOrderByIdAsc(){
        return windTurbineInfoRepository.findAllByOrderByIdAsc();
    }

}
