package com.madeu.service.web.webmedicine.impl;

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

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

import com.madeu.constants.Constants;
import com.madeu.dao.web.webauthmenurelation.WebAuthMenuRelationSqlMapDAO;
import com.madeu.dao.web.webmedicine.WebMedicineSqlMapDAO;
import com.madeu.dao.web.webmember.WebMemberSqlMapDAO;
import com.madeu.service.web.webmedicine.WebMedicineService;

import lombok.extern.slf4j.Slf4j;

@Slf4j
@Service("WebMedicineService")
public class WebMedicineServiceImpl implements WebMedicineService {
	
	@Autowired
	private WebMedicineSqlMapDAO webMedicineSqlMapDAO;
	
	@Autowired
	private WebMemberSqlMapDAO webMemberSqlMapDAO;
	
	@Autowired
	private WebAuthMenuRelationSqlMapDAO webAuthMenuRelationSqlMapDAO;
	
	/**
	 * 약품 리스트 조회 (List, option)
	 *
	 *
	 * @param paramMap
	 * @return
	 * @throws Exception
	 */
	@Override
	public HashMap<String, Object> selectListMedicineOption(
			HashMap<String, Object> paramMap) throws Exception {
		log.debug("WebMedicineServiceImpl selectListMedicineOption START");

		HashMap<String, Object> map = new HashMap<String, Object>();

		log.debug("loginMemberId       :"+paramMap.get("loginMemberId"));
		
		log.debug("searchKeywordParam  :"+paramMap.get("searchKeywordParam"));

		try{
			boolean check  = true;
			
			if(true == check){
				List<Map<String, Object>> listMap = webMedicineSqlMapDAO.selectListMedicineOption(paramMap);

				map.put("msgCode", Constants.OK);
				map.put("success","true");
				map.put("rows",listMap);
			}
		}
		catch(Exception e){
			e.printStackTrace();
			throw e;
		}
		log.debug("WebMedicineServiceImpl selectListMedicineOption END");
		return map;
	}
	
}
