package com.prolog.eis.service.config.impl;

import com.prolog.eis.dao.BcrConfigMapper;
import com.prolog.eis.dto.wcs.BcrConfigDto;
import com.prolog.eis.model.config.BcrConfig;
import com.prolog.eis.service.config.BcrConfigService;
import com.prolog.framework.utils.MapUtils;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
@RequiredArgsConstructor
public class BcrConfigServiceImpl implements BcrConfigService {

    private final BcrConfigMapper bcrConfigMapper;

    @Override
    public List<BcrConfigDto> findAllConfig() {
        return bcrConfigMapper.findAllConfig();
    }

    @Override
    public BcrConfig findByLocationNo(String locationNo) {
        return bcrConfigMapper.findByMap(MapUtils.put("locationNo",locationNo).getMap(), BcrConfig.class).get(0);
    }

    @Override
    public List<BcrConfig> findByMap(Map<String, Object> map) {
        return bcrConfigMapper.findByMap(map, BcrConfig.class);
    }
}
