/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package sikd.sikd5.sikd5ejb.dao;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import org.apache.ibatis.session.SqlSession;

import sikd.sikd5.sikd5bean.fault.SIKDServiceException;
import sikd.sikd5.sikd5bean.laporan.Lampiran1Apbd;
import sikd.sikd5.sikd5bean.query.InfoPengiriman;
import sikd.sikd5.sikd5bean.query.MonitorSimpatikDataKirimPemdaChart;
import sikd.sikd5.sikd5bean.query.MonitorSimpatikPemdaKoneksi;
import sikd.sikd5.sikd5ejb.mapper.LraMapper;

/**
 *
 * @author : agus
 * @tanggal : Jan 10, 2019
 */
public class LraDao {

	public List<InfoPengiriman> getInfoPengirimanXmlPerBulan(String kodeSatker, short tahun, SqlSession session)
			throws SIKDServiceException {
		List<InfoPengiriman> hasil = new ArrayList<InfoPengiriman>();
		try {
			LraMapper mapper = session.getMapper(LraMapper.class);
			hasil = mapper.getInfoPengirimanXmlPerBulan(kodeSatker, tahun);
			return hasil;
		} catch (Exception e) {
			throw new SIKDServiceException(e.getMessage());
		}
	}
	public List<InfoPengiriman> getInfoPengirimanXmlPerPemda(short tahun,short bulan, Date tgawal, Date tgakhir, SqlSession session)
			throws SIKDServiceException {
		List<InfoPengiriman> hasil = new ArrayList<InfoPengiriman>();
		try {
			LraMapper mapper = session.getMapper(LraMapper.class);
			hasil = mapper.getInfoPengirimanXmlPerPemda(tahun, bulan, tgawal, tgakhir);
			return hasil;
		} catch (Exception e) {
			throw new SIKDServiceException(e.getMessage());
		}
	}
        
	public List<MonitorSimpatikPemdaKoneksi> getMonitorPemdaKoneksi(short tahun, SqlSession session)
			throws SIKDServiceException {
		List<MonitorSimpatikPemdaKoneksi> hasil = new ArrayList();
		try {
			LraMapper mapper = session.getMapper(LraMapper.class);
			hasil = mapper.getMonitorPemdaKoneksi(tahun);
			return hasil;
		} catch (Exception e) {
			throw new SIKDServiceException(e.getMessage());
		}
	}
        
	public List<MonitorSimpatikDataKirimPemdaChart> getMonitorDataKirimChartNasional(Date tanggal, SqlSession session)
			throws SIKDServiceException {
		List<MonitorSimpatikDataKirimPemdaChart> hasil = new ArrayList();
		try {
			LraMapper mapper = session.getMapper(LraMapper.class);
			hasil = mapper.getMonitorDataKirimChartNasional(tanggal);
			return hasil;
		} catch (Exception e) {
			throw new SIKDServiceException(e.getMessage());
		}
	}
        
	public List<MonitorSimpatikDataKirimPemdaChart> getMonitorDataKirimChartPemda(Date tanggal, String kodesatker, SqlSession session)
			throws SIKDServiceException {
		List<MonitorSimpatikDataKirimPemdaChart> hasil = new ArrayList();
		try {
			LraMapper mapper = session.getMapper(LraMapper.class);
			hasil = mapper.getMonitorDataKirimChartPemda(tanggal, kodesatker);
			return hasil;
		} catch (Exception e) {
			throw new SIKDServiceException(e.getMessage());
		}
	}
        
}
