package com.base.plan.service;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.base.orbit.utils.BizUtils;
import com.base.plan.mapper.AlgSchemeWindowPassMapper;
import com.base.plan.model.entity.AlgSchemeWindowPass;
import com.plan.api.model.AlgSchemeWindowPassRpcDTO;
import org.springframework.stereotype.Service;
import java.util.List;

@Service
public class AlgSchemeWindowsPassService extends ServiceImpl<AlgSchemeWindowPassMapper, AlgSchemeWindowPass> {

    public List<AlgSchemeWindowPassRpcDTO> getWindowsPass(List<String> windowIds) {
        QueryWrapper<AlgSchemeWindowPass> queryWrapper = new QueryWrapper<>();
        queryWrapper.in("scheme_step_window_id", windowIds);
        List<AlgSchemeWindowPass> algSchemeWindowPasses = this.list(queryWrapper);
        List<AlgSchemeWindowPassRpcDTO> algSchemeWindowPassRpcDTOS = BizUtils.copyEntityToDto(AlgSchemeWindowPassRpcDTO.class, algSchemeWindowPasses);
        return algSchemeWindowPassRpcDTOS;
    }
}
