package incheon.ags.aip.service.impl;

import java.util.List;
import java.util.Map;

import org.egovframe.rte.fdl.cmmn.EgovAbstractServiceImpl;
import org.springframework.stereotype.Service;

import incheon.ags.aip.mapper.AipMapper;
import incheon.ags.aip.service.AipService;
import incheon.ags.aip.vo.AipSearchVO;
import lombok.RequiredArgsConstructor;

@Service("AipService")
@RequiredArgsConstructor
public class AipServiceImpl extends EgovAbstractServiceImpl implements AipService {
	private final AipMapper aipMapper;
	
	/**
	 * 적출물 년도 리스트 조회
	 * @param param
	 * @return
	 * @exception Exception
	 */
	@Override
	public List<Map<String, Object>> juckYearList() throws Exception {
		return aipMapper.juckYearList();
	}
	
	/**
	 * 북마크 리스트 조회
	 * @param param
	 * @return
	 * @exception Exception
	 */
	@Override
	public List<Map<String, Object>> getBmkList(AipSearchVO vo) throws Exception {
		return aipMapper.getBmkList(vo);
	}
	
	/**
	 * 북마크 count
	 * @param param
	 * @return
	 * @exception Exception
	 */
	@Override
	public int getBmkCount(AipSearchVO vo) throws Exception {
		return aipMapper.getBmkCount(vo);
	}
	
	/**
	 * 북마크 삭제
	 * @param param
	 * @return
	 * @exception Exception
	 */
	@Override
	public int deleteBookmarks(Map<String, Object> param) throws Exception {
		return aipMapper.deleteBookmarks(param);
	}

	/**
	 * 년도별 적출물 list total
	 * @param param
	 * @return
	 * @exception Exception
	 */
	@Override
	public List<Map<String, Object>> getExtracObjtListTotal(Map<String, Object> param) throws Exception {
		return aipMapper.getExtracObjtListTotal(param);
	}
	
	/**
	 * 년도별 적출물 list
	 * @param param
	 * @return
	 * @exception Exception
	 */
	@Override
	public List<Map<String, Object>> getExtracObjtList(Map<String, Object> param) throws Exception {
		return aipMapper.getExtracObjtList(param);
	}
	
	/**
	 * 년도별 적출물 chart
	 * @param param
	 * @return
	 * @exception Exception
	 */
	@Override
	public List<Map<String, Object>> getExtracObjtChart(Map<String, Object> param) throws Exception {
		return aipMapper.getExtracObjtChart(param);
	}
	
	
	/**
	 * 파일정보
	 * @param param
	 * @return
	 * @exception Exception
	 */
	@Override
	public Map<String, Object> selectAipFile(String gubun, Long fileId) throws Exception {
		if("juckchul".equals(gubun)) return aipMapper.selectJuckchulFile(fileId);
		if("intpr_rqst".equals(gubun)) return aipMapper.selectIntprRqstFile(fileId);
		if("intpr_rslt".equals(gubun)) return aipMapper.selectIntprRsltFile(fileId);
		return null;
	}

}