package com.base.biz.service;


import com.base.biz.mapper.SatelliteStationMatchMapper;
import com.base.biz.model.dto.response.SatelliteStationMatchDTO;
import com.base.biz.model.entity.SatelliteStationMatch;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;

@Service
public class SatelliteStationMatchService {

    @Resource
    SatelliteStationMatchMapper satelliteStationMatchMapper;

    public List<SatelliteStationMatchDTO> getBySatelliteCodeAndStationCode(List<String> satelliteCodeList, List<String> stationCodeList){
        List<SatelliteStationMatchDTO> res = new ArrayList<>();
        List<SatelliteStationMatch> list = satelliteStationMatchMapper.getBySatelliteCodeAndStationCode(satelliteCodeList,stationCodeList);
        for (SatelliteStationMatch satelliteStationMatch:list){
            SatelliteStationMatchDTO satelliteStationMatchDTO = new SatelliteStationMatchDTO();
            BeanUtils.copyProperties(satelliteStationMatch,satelliteStationMatchDTO);
            res.add(satelliteStationMatchDTO);
        }
        return res;
    }

}