package com.samsung.embo.kpi.impl;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Service;

import com.samsung.embo.common.util.dao.UtilDao;
import com.samsung.embo.kpi.ParameterService;
import com.samsung.embo.kpi.dao.ParameterDao;
@Service
public class ParameterServiceImpl implements ParameterService{
	private static final String MODULE_HEADER = "PT";
	private final ParameterDao  parameterDao;
	private final UtilDao utilDao;

	public ParameterServiceImpl(ParameterDao parameterDao,UtilDao utilDao) {

		this.parameterDao = parameterDao;
		this.utilDao = utilDao;
	}

	@Override
	public List<Map<String, Object>> selectParameter(Map<String, Object> params) {
		return parameterDao.selectParameter(params);
	}

	@Override
	public String insertParameter(Map<String, Object> params) {
		params.put("parameterType", MODULE_HEADER+utilDao.selectSeqKpiMaster());
		return parameterDao.insertParameter(params);
	}

	@Override
	public void updateParameter(Map<String, Object> params) {
		 parameterDao.updateParameter(params);
	}

	@Override
	public int deleteParameter(Map<String, Object> params) {

		return parameterDao.deleteParameter(params);
	}
}
