package com.eactive.eai.rms.onl.manage.serviceinfo.bzwk2service;

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

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

import com.eactive.eai.rms.bap.common.base.BapBaseService;
import com.eactive.eai.rms.common.acl.user.BizDao;

@Service("bzwkToServiceService")
public class BzwkToServiceService extends BapBaseService {

	@Autowired
	@Qualifier("bzwkToServiceDao")
	private BzwkToServiceDao dao;

	@Autowired
	@Qualifier("bizDao")
	private BizDao bizDao;
	public HashMap<String, Object> selectList(int startNum,int endNum, HashMap<String, Object> paramMap) throws Exception {
 
		// 전체 목록수 얻기
		int totalCount = dao.selectListCount(paramMap);

		paramMap.put("startNum" , startNum);// 시작 record
		paramMap.put("endNum"   , endNum);// 끝 record

		List<Map<String, Object>> list = dao.selectList(paramMap);
		HashMap<String, Object> map = new HashMap<String, Object>();

		map.put("totalCount", totalCount);
		map.put("list", list);
		
		return map;
	}	
	public HashMap selectDetailCombo(String userId) throws Exception {
		HashMap paramMap = new HashMap();
		paramMap.put("userId", userId);
 
		//업무구분
		List listBiz = bizDao.selectUserBizCodes(paramMap);
		
		HashMap map = new HashMap();

		map.put("bizList", listBiz);


		return map;
	}	
	public HashMap<String, Object> selectDetail(String eaiBzwkDstcd) throws Exception {
		HashMap<String, Object> list;

		list   = dao.selectDetail(eaiBzwkDstcd);

		HashMap<String, Object> map = new HashMap<String, Object>();
		map.put("list", list);
		
		return map;

	}	

	public void update(HashMap<String, Object> paramMap) throws Exception {
		dao.update(paramMap);
	}

	public void insert(HashMap<String, Object> paramMap) throws Exception {
		dao.insert(paramMap);
	}

	public void delete(HashMap<String, Object> paramMap) throws Exception {
		dao.delete(paramMap);
	}

	
}