package com.eactive.eai.rms.onl.manage.useDate;

import java.util.HashMap;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import com.eactive.eai.rms.common.base.BaseService;
import com.eactive.eai.rms.common.combo.ComboService;

@Service("useDateControlService")
public class UseDateControlService extends BaseService {

	@Autowired
	@Qualifier("useDateControlDao")
	private UseDateControlDao dao;
	
    @Autowired
    @Qualifier("comboService")
    public ComboService comboService;		
	
	
	public HashMap selectList(int startNum,int endNum, String searchName) throws Exception {
		
		HashMap paramMap = new HashMap();
		//검색 조건 
		paramMap.put("searchName", searchName.toUpperCase());
		
		// 전체 목록수 얻기
		int totalCount = dao.selectListCount(paramMap);
		
		paramMap.put("startNum" , startNum);// 시작 record
		paramMap.put("endNum"   , endNum);// 끝 record
		
		List list = dao.selectList(paramMap);
		
		HashMap map = new HashMap();
		
		map.put("totalCount", totalCount);
		
		map.put("list", list);
		
		return map;
	}
	public HashMap selectDetail(String name) throws Exception {
		HashMap paramMap = new HashMap();
		paramMap.put("name", name);
		
		return dao.selectDetail(paramMap);
		
	}
	
	public void merge(HashMap paramMap)
	{
		dao.merge(paramMap);
	}
	
	public void delete(HashMap paramMap)
	{
		dao.delete(paramMap);
	}

}
