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.ModuleService;
import com.samsung.embo.kpi.dao.ModuleDao;
@Service
public class ModuleServiceImpl implements ModuleService{
	private static final String MODULE_HEADER = "KM";
	private final ModuleDao  moduleDao;
	private final UtilDao utilDao;

	public ModuleServiceImpl(ModuleDao moduleDao,UtilDao utilDao) {

		this.moduleDao = moduleDao;
		this.utilDao = utilDao;
	}

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

	@Override
	public String insertModule(Map<String, Object> params) {
		params.put("kpiModuleId", MODULE_HEADER+utilDao.selectSeqKpiMaster());
		return moduleDao.insertModule(params);
	}

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

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

		return moduleDao.deleteModule(params);
	}
}
