package com.jiayue.ipfcst.service;

import com.jiayue.ipfcst.common.data.entity.InverterInfo;
import com.jiayue.ipfcst.common.data.repository.InverterInfoRepository;
import com.jiayue.ipfcst.common.data.service.BaseService;
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 InverterInfoService extends BaseService {

    private final InverterInfoRepository inverterInfoRepository;
    @Autowired
    public InverterInfoService(InverterInfoRepository inverterInfoRepository){
        this.inverterInfoRepository = inverterInfoRepository;
    }
    /**
     * 根据ID排序查出所有逆变器设备信息
     * yh
     */
    @Transactional(propagation = Propagation.NOT_SUPPORTED, readOnly = true)
    public List<InverterInfo> findAllByOrderByIdAsc(){
        return inverterInfoRepository.findAllByOrderByIdAsc();
    }
}
