package com.gyee.wisdom.dao.sql.control;

import com.gyee.wisdom.common.data.DataUtil;
import com.gyee.wisdom.common.data.control.GycpCmdInfo;
import com.gyee.wisdom.dao.control.IGycpCmdInfoDao;
import com.gyee.wisdom.dao.sql.Windturbine.entity.ProjectEntity;
import com.gyee.wisdom.dao.sql.control.entity.GycpCmdInfoEntity;
import com.gyee.wisdom.dao.sql.control.repository.GycpCmdInfoRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @descrition:
 * @author:Wanghs
 * @date:2019-09-02
 */
@Component
public class JpaGycpCmdInfoDao implements IGycpCmdInfoDao {

    @Autowired
    private GycpCmdInfoRepository gycpCmdInfoRepository;


    @Override
    public List<GycpCmdInfo> getAll() {
        return DataUtil.convertDataList(gycpCmdInfoRepository.findAll());
    }

    @Override
    public List<GycpCmdInfo> getByWindturbineId(String windturbineId) {
        return DataUtil.convertDataList(gycpCmdInfoRepository.findAllByWindturbineId(windturbineId));

    }
}
