package sikd.sikd5.sikd5ejb.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import sikd.sikd5.sikd5bean.laporan.Lampiran1Apbd;


/**
 * @author  : soraturaes
 */

public interface LaporanMapper {

    @Select("with aa as(\n"
            + "	select \n"
            + "kodeakunutama, namaakunutama,kodeakunkelompok,namaakunkelompok, kodeakunjenis,namaakunjenis, saldonormal,\n"
            + "case when saldonormal='D' then debet-kredit\n"
            + "     when saldonormal='K' then kredit-debet\n"
            + "     end\n"
            + "nilairealisasi\n"
            + "from\n"
            + "(select  a.kodesatker, a.kodepemda, a.namapemda, a.tahunanggaran, a.jeniscoa, \n"
            + "b.kodeakunutama, b.namaakunutama, b.kodeakunkelompok, b.namaakunkelompok, b.kodeakunjenis, b.namaakunjenis, b.saldonormal,\n"
            + "sum(b.nilaidebet) debet, sum(b.nilaikredit) kredit\n"
            + "from transaksi.headerjurnal a\n"
            + "join transaksi.jurnal b on a.headerjurnalid=b.headerjurnalid\n"
            + "where b.kodeakunutama in('4','5','6','7') "
            + " and kodeposting=1 and a.tanggalbukti >= date(#{tanggal1}) and a.tanggalbukti <= date(#{tanggal2}) \n"
            + "group by  a.kodesatker, a.kodepemda, a.namapemda, a.tahunanggaran, a.jeniscoa,  b.saldonormal,\n"
            + "b.kodeakunutama, b.namaakunutama, b.kodeakunkelompok, b.namaakunkelompok, b.kodeakunjenis, b.namaakunjenis \n"
            + "--b.saldonormal, b.nilaidebet, b.nilaikredit\n"
            + "order by b.kodeakunutama, b.kodeakunkelompok, b.kodeakunjenis) RE\n"
            + "),\n"
            + "acc as(\n"
            + "	select distinct kodeakunutama kode, namaakunutama nama from aa\n"
            + "	union select distinct kodeakunutama||'.'||kodeakunkelompok kode, namaakunkelompok nama from aa\n"
            + "	union select distinct kodeakunutama||'.'||kodeakunkelompok||'.'||kodeakunjenis kode, namaakunjenis nama from aa\n"
            + "),\n"
            + "bb as(\n"
            + "--select kodeakunutama, namaakunutama, kodeakunkelompok, namaakunkelompok from aa where kodeakunutama = '7'\n"
            + "select kodeakunutama nomor, sum(nilairealisasi) nilai from aa\n"
            + "group by kodeakunutama\n"
            + "union\n"
            + "select kodeakunutama||'.'||kodeakunkelompok nomor, sum(nilairealisasi) nilai from aa\n"
            + "group by kodeakunutama||'.'||kodeakunkelompok\n"
            + "union\n"
            + "select kodeakunutama||'.'||kodeakunkelompok||'.'||kodeakunjenis nomor, sum(nilairealisasi) nilai from aa\n"
            + "group by kodeakunutama||'.'||kodeakunkelompok||'.'||kodeakunjenis\n"
            + "order by nomor\n"
            + "),\n"
            + "bb7 as(\n"
            + "	select 7::text nomor, sum(nilai) nilai from(\n"
            + "      	select nomor, nilai from bb where nomor = '7.1'\n"
            + "		union\n"
            + "		select nomor, -nilai from bb where nomor = '7.2'\n"
//            + "		union\n"
//            + "		select nomor, nilai from bb where nomor = '7.3'"
            + ") bbb\n"
            + "),\n"
            + "semua as(\n"
            + "  select nomor, nilai from bb where nomor <> '7'  and nomor not like '7.3%' \n"
            + "  union select nomor, nilai from bb7\n"
            + ")\n"
            + "select kode nomor, nama, nilai from acc\n"
            + "left join semua on acc.kode=semua.nomor\n"
            + " where nomor not like '7.3%' "
            + "order by nomor")
	@Results({ 
			@Result(property = "nomor", column = "nomor"),
			@Result(property = "uraian", column = "nama"),
			@Result(property = "nilai", column = "nilai"),
			})
    public List<Lampiran1Apbd> getLaporanPostingedLraNasional(@Param("tanggal1") String tanggal1, @Param("tanggal2") String tanggal2);
    
    
    @Select( 
            "with aa as(\n"
            + "	select \n"
            + "kodeakunutama, namaakunutama,kodeakunkelompok,namaakunkelompok, kodeakunjenis,namaakunjenis, saldonormal,\n"
            + "case when saldonormal='D' then debet-kredit\n"
            + "     when saldonormal='K' then kredit-debet\n"
            + "     end\n"
            + "nilairealisasi\n"
            + "from\n"
            + "(select  a.kodesatker, a.kodepemda, a.namapemda, a.tahunanggaran, a.jeniscoa, \n"
            + "b.kodeakunutama, b.namaakunutama, b.kodeakunkelompok, b.namaakunkelompok, b.kodeakunjenis, b.namaakunjenis, b.saldonormal,\n"
            + "sum(b.nilaidebet) debet, sum(b.nilaikredit) kredit\n"
            + "from transaksi.headerjurnal a\n"
            + "join transaksi.jurnal b on a.headerjurnalid=b.headerjurnalid\n"
            + "where b.kodeakunutama in('4','5','6','7') and a.kodesatker=#{kodesatker}"
            + " and kodeposting=1 and a.tanggalbukti >= date(#{tanggal1}) and a.tanggalbukti <= date(#{tanggal2}) \n"
            + "group by  a.kodesatker, a.kodepemda, a.namapemda, a.tahunanggaran, a.jeniscoa,  b.saldonormal,\n"
            + "b.kodeakunutama, b.namaakunutama, b.kodeakunkelompok, b.namaakunkelompok, b.kodeakunjenis, b.namaakunjenis \n"
            + "--b.saldonormal, b.nilaidebet, b.nilaikredit\n"
            + "order by b.kodeakunutama, b.kodeakunkelompok, b.kodeakunjenis) RE\n"
            + "),\n"
            + "acc as(\n"
            + "	select distinct kodeakunutama kode, namaakunutama nama from aa\n"
            + "	union select distinct kodeakunutama||'.'||kodeakunkelompok kode, namaakunkelompok nama from aa\n"
            + "	union select distinct kodeakunutama||'.'||kodeakunkelompok||'.'||kodeakunjenis kode, namaakunjenis nama from aa\n"
            + "),\n"
            + "bb as(\n"
            + "--select kodeakunutama, namaakunutama, kodeakunkelompok, namaakunkelompok from aa where kodeakunutama = '7'\n"
            + "select kodeakunutama nomor, sum(nilairealisasi) nilai from aa\n"
            + "group by kodeakunutama\n"
            + "union\n"
            + "select kodeakunutama||'.'||kodeakunkelompok nomor, sum(nilairealisasi) nilai from aa\n"
            + "group by kodeakunutama||'.'||kodeakunkelompok\n"
            + "union\n"
            + "select kodeakunutama||'.'||kodeakunkelompok||'.'||kodeakunjenis nomor, sum(nilairealisasi) nilai from aa\n"
            + "group by kodeakunutama||'.'||kodeakunkelompok||'.'||kodeakunjenis\n"
            + "order by nomor\n"
            + "),\n"
            + "bb7 as(\n"
            + "	select 7::text nomor, sum(nilai) nilai from(\n"
            + "      	select nomor, nilai from bb where nomor = '7.1'\n"
            + "		union\n"
            + "		select nomor, -nilai from bb where nomor = '7.2'\n"
//            + "		union\n"
//            + "		select nomor, nilai from bb where nomor = '7.3'"
                    + ") bbb\n"
            + "),\n"
            + "semua as(\n"
            + "  select nomor, nilai from bb where nomor <> '7'  and nomor not like '7.3%' \n"
            + "  union select nomor, nilai from bb7\n"
            + ")\n"
            + "select kode nomor, nama, nilai from acc\n"
            + "left join semua on acc.kode=semua.nomor\n"
                    + " where nomor not like '7.3%' "
            + "order by nomor")
	@Results({ 
			@Result(property = "nomor", column = "nomor"),
			@Result(property = "uraian", column = "nama"),
			@Result(property = "nilai", column = "nilai"),
			})
    public List<Lampiran1Apbd> getLaporanPostingedLraPemda(@Param("tanggal1") String tanggal1, @Param("tanggal2") String tanggal2, @Param("kodesatker") String kodesatker);
	
        
    @Select("with aa as(\n"
            + "	select \n"
            + "kodeakunutama, namaakunutama,kodeakunkelompok,namaakunkelompok, kodeakunjenis,namaakunjenis, saldonormal,\n"
            + "case when saldonormal='D' then debet-kredit\n"
            + "     when saldonormal='K' then kredit-debet\n"
            + "     end\n"
            + "nilairealisasi\n"
            + "from\n"
            + "(select  a.kodesatker, a.kodepemda, a.namapemda, a.tahunanggaran, a.jeniscoa, \n"
            + "b.kodeakunutama, b.namaakunutama, b.kodeakunkelompok, b.namaakunkelompok, b.kodeakunjenis, b.namaakunjenis, b.saldonormal,\n"
            + "sum(b.nilaidebet) debet, sum(b.nilaikredit) kredit\n"
            + "from transaksi.headerjurnal a\n"
            + "join transaksi.jurnal b on a.headerjurnalid=b.headerjurnalid\n"
            + "where b.kodeakunutama in('4','5','6','7') "
            + " and a.tanggalbukti >= date(#{tanggal1}) and a.tanggalbukti <= date(#{tanggal2}) \n"
            + "group by  a.kodesatker, a.kodepemda, a.namapemda, a.tahunanggaran, a.jeniscoa,  b.saldonormal,\n"
            + "b.kodeakunutama, b.namaakunutama, b.kodeakunkelompok, b.namaakunkelompok, b.kodeakunjenis, b.namaakunjenis \n"
            + "--b.saldonormal, b.nilaidebet, b.nilaikredit\n"
            + "order by b.kodeakunutama, b.kodeakunkelompok, b.kodeakunjenis) RE\n"
            + "),\n"
            + "acc as(\n"
            + "	select distinct kodeakunutama kode, namaakunutama nama from aa\n"
            + "	union select distinct kodeakunutama||'.'||kodeakunkelompok kode, namaakunkelompok nama from aa\n"
            + "	union select distinct kodeakunutama||'.'||kodeakunkelompok||'.'||kodeakunjenis kode, namaakunjenis nama from aa\n"
            + "),\n"
            + "bb as(\n"
            + "--select kodeakunutama, namaakunutama, kodeakunkelompok, namaakunkelompok from aa where kodeakunutama = '7'\n"
            + "select kodeakunutama nomor, sum(nilairealisasi) nilai from aa\n"
            + "group by kodeakunutama\n"
            + "union\n"
            + "select kodeakunutama||'.'||kodeakunkelompok nomor, sum(nilairealisasi) nilai from aa\n"
            + "group by kodeakunutama||'.'||kodeakunkelompok\n"
            + "union\n"
            + "select kodeakunutama||'.'||kodeakunkelompok||'.'||kodeakunjenis nomor, sum(nilairealisasi) nilai from aa\n"
            + "group by kodeakunutama||'.'||kodeakunkelompok||'.'||kodeakunjenis\n"
            + "order by nomor\n"
            + "),\n"
            + "bb7 as(\n"
            + "	select 7::text nomor, sum(nilai) nilai from(\n"
            + "      	select nomor, nilai from bb where nomor = '7.1'\n"
            + "		union\n"
            + "		select nomor, -nilai from bb where nomor = '7.2'\n"
//            + "		union\n"
//            + "		select nomor, nilai from bb where nomor = '7.3'"
            + ") bbb\n"
            + "),\n"
            + "semua as(\n"
            + "  select nomor, nilai from bb where nomor <> '7'  and nomor not like '7.3%'\n"
            + "  union select nomor, nilai from bb7\n"
            + ")\n"
            + "select kode nomor, nama, nilai from acc\n"
            + "left join semua on acc.kode=semua.nomor\n"
            + " where nomor not like '7.3%' "
            + "order by nomor")
	@Results({ 
			@Result(property = "nomor", column = "nomor"),
			@Result(property = "uraian", column = "nama"),
			@Result(property = "nilai", column = "nilai"),
			})
    public List<Lampiran1Apbd> getLaporanLraNasional(@Param("tanggal1") String tanggal1, @Param("tanggal2") String tanggal2);
    
    
    @Select( "with aa as(\n"
            + "	select \n"
            + "kodeakunutama, namaakunutama,kodeakunkelompok,namaakunkelompok, kodeakunjenis,namaakunjenis, saldonormal,\n"
            + "case when saldonormal='D' then debet-kredit\n"
            + "     when saldonormal='K' then kredit-debet\n"
            + "     end\n"
            + "nilairealisasi\n"
            + "from\n"
            + "(select  a.kodesatker, a.kodepemda, a.namapemda, a.tahunanggaran, a.jeniscoa, \n"
            + "b.kodeakunutama, b.namaakunutama, b.kodeakunkelompok, b.namaakunkelompok, b.kodeakunjenis, b.namaakunjenis, b.saldonormal,\n"
            + "sum(b.nilaidebet) debet, sum(b.nilaikredit) kredit\n"
            + "from transaksi.headerjurnal a\n"
            + "join transaksi.jurnal b on a.headerjurnalid=b.headerjurnalid\n"
            + "where b.kodeakunutama in('4','5','6','7') and a.kodesatker=#{kodesatker}"
            + " and a.tanggalbukti >= date(#{tanggal1}) and a.tanggalbukti <= date(#{tanggal2}) \n"
            + "group by  a.kodesatker, a.kodepemda, a.namapemda, a.tahunanggaran, a.jeniscoa,  b.saldonormal,\n"
            + "b.kodeakunutama, b.namaakunutama, b.kodeakunkelompok, b.namaakunkelompok, b.kodeakunjenis, b.namaakunjenis \n"
            + "--b.saldonormal, b.nilaidebet, b.nilaikredit\n"
            + "order by b.kodeakunutama, b.kodeakunkelompok, b.kodeakunjenis) RE\n"
            + "),\n"
            + "acc as(\n"
            + "	select distinct kodeakunutama kode, namaakunutama nama from aa\n"
            + "	union select distinct kodeakunutama||'.'||kodeakunkelompok kode, namaakunkelompok nama from aa\n"
            + "	union select distinct kodeakunutama||'.'||kodeakunkelompok||'.'||kodeakunjenis kode, namaakunjenis nama from aa\n"
            + "),\n"
            + "bb as(\n"
            + "--select kodeakunutama, namaakunutama, kodeakunkelompok, namaakunkelompok from aa where kodeakunutama = '7'\n"
            + "select kodeakunutama nomor, sum(nilairealisasi) nilai from aa\n"
            + "group by kodeakunutama\n"
            + "union\n"
            + "select kodeakunutama||'.'||kodeakunkelompok nomor, sum(nilairealisasi) nilai from aa\n"
            + "group by kodeakunutama||'.'||kodeakunkelompok\n"
            + "union\n"
            + "select kodeakunutama||'.'||kodeakunkelompok||'.'||kodeakunjenis nomor, sum(nilairealisasi) nilai from aa\n"
            + "group by kodeakunutama||'.'||kodeakunkelompok||'.'||kodeakunjenis\n"
            + "order by nomor\n"
            + "),\n"
            + "bb7 as(\n"
            + "	select 7::text nomor, sum(nilai) nilai from(\n"
            + "      	select nomor, nilai from bb where nomor = '7.1'\n"
            + "		union\n"
            + "		select nomor, -nilai from bb where nomor = '7.2'\n"
//            + "		union\n"
//            + "		select nomor, nilai from bb where nomor = '7.3'"
            + ") bbb\n"
            + "),\n"
            + "semua as(\n"
            + "  select nomor, nilai from bb where nomor <> '7'  and nomor not like '7.3%' \n"
            + "  union select nomor, nilai from bb7\n"
            + ")\n"
            + "select kode nomor, nama, nilai from acc\n"
            + "left join semua on acc.kode=semua.nomor\n"
            + " where nomor not like '7.3%' "
            + "order by nomor")
	@Results({ 
			@Result(property = "nomor", column = "nomor"),
			@Result(property = "uraian", column = "nama"),
			@Result(property = "nilai", column = "nilai"),
			})
    public List<Lampiran1Apbd> getLaporanLraPemda(@Param("tanggal1") String tanggal1, @Param("tanggal2") String tanggal2, @Param("kodesatker") String kodesatker);

    @Select("with aa as(\n"
            + "	SELECT a.kodesatker,\n"
            + "    a.kodepemda,\n"
            + "    a.namapemda,\n"
            + "    a.tahunanggaran,\n"
            + "    a.kodedata,\n"
            + "    a.statusdata,\n"
            + "    a.jeniscoa,\n"
            + "    b.kodeakunutama,\n"
            + "    b.namaakunutama,\n"
            + "    b.kodeakunkelompok,\n"
            + "    b.namaakunkelompok,\n"
            + "    b.kodeakunjenis,\n"
            + "    b.namaakunjenis,\n"
            + "    sum(b.nilaianggaran) AS nilaianggaran\n"
            + "   FROM transaksi.headerapbd a\n"
            + "     JOIN transaksi.apbd b ON a.headerapbdid = b.headerapbdid\n"
            + "	 Where tahunanggaran = #{tahun}\n"
            + "  GROUP BY a.kodesatker, a.kodepemda, a.namapemda, a.tahunanggaran, a.kodedata, a.statusdata, a.jeniscoa, b.kodeakunutama, b.namaakunutama, b.kodeakunkelompok, b.namaakunkelompok, b.kodeakunjenis, b.namaakunjenis\n"
            + "  ORDER BY a.kodesatker, a.kodepemda, b.kodeakunutama, b.kodeakunkelompok, b.kodeakunjenis\n"
            + "),\n"
            + "acc as(\n"
            + "	select distinct kodeakunutama kode, namaakunutama nama from aa\n"
            + "	union select distinct kodeakunutama||'.'||kodeakunkelompok kode, namaakunkelompok nama from aa\n"
            + "	union select distinct kodeakunutama||'.'||kodeakunkelompok||'.'||kodeakunjenis kode, namaakunjenis nama from aa\n"
            + "),\n"
            + "bb as(\n"
            + "select kodeakunutama nomor, sum(nilaianggaran) nilai from aa\n"
            + "group by kodeakunutama\n"
            + "union\n"
            + "select kodeakunutama||'.'||kodeakunkelompok nomor, sum(nilaianggaran) nilai from aa\n"
            + "group by kodeakunutama||'.'||kodeakunkelompok\n"
            + "union\n"
            + "select kodeakunutama||'.'||kodeakunkelompok||'.'||kodeakunjenis nomor, sum(nilaianggaran) nilai from aa\n"
            + "group by kodeakunutama||'.'||kodeakunkelompok||'.'||kodeakunjenis\n"
            + "order by nomor\n"
            + "),\n"
            + "bb7 as(\n"
            + "	select 7::text nomor, sum(nilai) nilai from(\n"
            + "      	select nomor, nilai from bb where nomor = '7.1'\n"
            + "		union\n"
            + "		select nomor, -nilai from bb where nomor = '7.2'\n"
//            + "		union\n"
//            + "		select nomor, nilai from bb where nomor = '7.3'"
            + ") bbb\n"
            + "),\n"
            + "semua as(\n"
            + "  select nomor, nilai from bb where nomor <> '7' and nomor not like '7.3%' \n"
            + "  union select nomor, nilai from bb7\n"
            + ")\n"
            + "select kode nomor, nama, nilai from acc\n"
            + "left join semua on acc.kode=semua.nomor\n"
            + " where nomor not like '7.3%' "
            + "order by nomor")
	@Results({ 
			@Result(property = "nomor", column = "nomor"),
			@Result(property = "uraian", column = "nama"),
			@Result(property = "nilai", column = "nilai"),
			})
    public List<Lampiran1Apbd> getLaporanApbdNasional(@Param("tahun") short tahun);
    
    
    @Select( "with aa as(\n"
            + "	SELECT a.kodesatker,\n"
            + "    a.kodepemda,\n"
            + "    a.namapemda,\n"
            + "    a.tahunanggaran,\n"
            + "    a.kodedata,\n"
            + "    a.statusdata,\n"
            + "    a.jeniscoa,\n"
            + "    b.kodeakunutama,\n"
            + "    b.namaakunutama,\n"
            + "    b.kodeakunkelompok,\n"
            + "    b.namaakunkelompok,\n"
            + "    b.kodeakunjenis,\n"
            + "    b.namaakunjenis,\n"
            + "    sum(b.nilaianggaran) AS nilaianggaran\n"
            + "   FROM transaksi.headerapbd a\n"
            + "     JOIN transaksi.apbd b ON a.headerapbdid = b.headerapbdid\n"
            + "	 Where tahunanggaran = #{tahun} and kodesatker=#{kodesatker}\n"
            + "  GROUP BY a.kodesatker, a.kodepemda, a.namapemda, a.tahunanggaran, a.kodedata, a.statusdata, a.jeniscoa, b.kodeakunutama, b.namaakunutama, b.kodeakunkelompok, b.namaakunkelompok, b.kodeakunjenis, b.namaakunjenis\n"
            + "  ORDER BY a.kodesatker, a.kodepemda, b.kodeakunutama, b.kodeakunkelompok, b.kodeakunjenis\n"
            + "),\n"
            + "acc as(\n"
            + "	select distinct kodeakunutama kode, namaakunutama nama from aa\n"
            + "	union select distinct kodeakunutama||'.'||kodeakunkelompok kode, namaakunkelompok nama from aa\n"
            + "	union select distinct kodeakunutama||'.'||kodeakunkelompok||'.'||kodeakunjenis kode, namaakunjenis nama from aa\n"
            + "),\n"
            + "bb as(\n"
            + "select kodeakunutama nomor, sum(nilaianggaran) nilai from aa\n"
            + "group by kodeakunutama\n"
            + "union\n"
            + "select kodeakunutama||'.'||kodeakunkelompok nomor, sum(nilaianggaran) nilai from aa\n"
            + "group by kodeakunutama||'.'||kodeakunkelompok\n"
            + "union\n"
            + "select kodeakunutama||'.'||kodeakunkelompok||'.'||kodeakunjenis nomor, sum(nilaianggaran) nilai from aa\n"
            + "group by kodeakunutama||'.'||kodeakunkelompok||'.'||kodeakunjenis\n"
            + "order by nomor\n"
            + "),\n"
            + "bb7 as(\n"
            + "	select 7::text nomor, sum(nilai) nilai from(\n"
            + "      	select nomor, nilai from bb where nomor = '7.1'\n"
            + "		union\n"
            + "		select nomor, -nilai from bb where nomor = '7.2'\n"
//            + "		union\n"
//            + "		select nomor, nilai from bb where nomor = '7.3'"
            + ") bbb\n"
            + "),\n"
            + "semua as(\n"
            + "  select nomor, nilai from bb where nomor <> '7' and nomor not like '7.3%' \n"
            + "  union select nomor, nilai from bb7\n"
            + ")\n"
            + "select kode nomor, nama, nilai from acc\n"
            + "left join semua on acc.kode=semua.nomor\n"
            + " where nomor not like '7.3%' "
            + "order by nomor")
	@Results({ 
			@Result(property = "nomor", column = "nomor"),
			@Result(property = "uraian", column = "nama"),
			@Result(property = "nilai", column = "nilai"),
			})
    public List<Lampiran1Apbd> getLaporanApbdPemda(@Param("tahun") short tahun, @Param("kodesatker") String kodesatker);
    
    @Select("with aa as(\n"
            + "	select \n"
            + "kodesatker, kodepemda,namapemda,tahunanggaran,jeniscoa,\n"
            + "kodeakunutama, namaakunutama,kodeakunkelompok, namaakunkelompok, kodeakunjenis,namaakunjenis, saldonormal,\n"
            + "case when saldonormal='D' then debet-kredit\n"
            + "     when saldonormal='K' then kredit-debet\n"
            + "     end\n"
            + "nilaiLO\n"
            + "from\n"
            + "(select  a.kodesatker, a.kodepemda, a.namapemda, a.tahunanggaran, a.jeniscoa, \n"
            + "b.kodeakunutama, b.namaakunutama, b.kodeakunkelompok, b.namaakunkelompok, b.kodeakunjenis, b.namaakunjenis, b.saldonormal,\n"
            + "sum(b.nilaidebet) debet, sum(b.nilaikredit) kredit\n"
            + "from transaksi.headerjurnal a\n"
            + "join transaksi.jurnal b on a.headerjurnalid=b.headerjurnalid\n"
            + "where b.kodeakunutama in('8','9')  \n"
            + " and a.tanggalbukti >= date(#{tanggal1}) and a.tanggalbukti <= date (#{tanggal2}) and kodeposting=1 \n"
            + "group by  a.kodesatker, a.kodepemda, a.namapemda, a.tahunanggaran, a.jeniscoa,  b.saldonormal,\n"
            + "b.kodeakunutama, b.namaakunutama, b.kodeakunkelompok, b.namaakunkelompok, b.kodeakunjenis, b.namaakunjenis \n"
            + "order by b.kodeakunutama, b.kodeakunkelompok, b.kodeakunjenis) RE\n"
            + "),\n"
            + "acc as(\n"
            + "	select distinct kodeakunutama kode, namaakunutama nama from aa\n"
            + "	union select distinct kodeakunutama||'.'||kodeakunkelompok kode, namaakunkelompok nama from aa\n"
            + "	union select distinct kodeakunutama||'.'||kodeakunkelompok||'.'||kodeakunjenis kode, namaakunjenis nama from aa\n"
            + "),\n"
            + "bb as(\n"
            + "select kodeakunutama nomor, sum(nilaiLO) nilai from aa\n"
            + "group by kodeakunutama\n"
            + "union\n"
            + "select kodeakunutama||'.'||kodeakunkelompok nomor, sum(nilaiLO) nilai from aa\n"
            + "group by kodeakunutama||'.'||kodeakunkelompok\n"
            + "union\n"
            + "select kodeakunutama||'.'||kodeakunkelompok||'.'||kodeakunjenis nomor, sum(nilaiLO) nilai from aa\n"
            + "group by kodeakunutama||'.'||kodeakunkelompok||'.'||kodeakunjenis\n"
            + "order by nomor\n"
            + ")\n"
            + "select kode nomor, nama, nilai from acc\n"
            + "left join bb on acc.kode=bb.nomor\n"
            + "order by nomor")
	@Results({ 
			@Result(property = "nomor", column = "nomor"),
			@Result(property = "uraian", column = "nama"),
			@Result(property = "nilai", column = "nilai"),
			})
    public List<Lampiran1Apbd> getLaporanPostingedLoNasional(@Param("tanggal1") String tanggal1, @Param("tanggal2") String tanggal2);
    
    
    @Select( "with aa as(\n"
            + "	select \n"
            + "kodesatker, kodepemda,namapemda,tahunanggaran,jeniscoa,\n"
            + "kodeakunutama, namaakunutama,kodeakunkelompok, namaakunkelompok, kodeakunjenis,namaakunjenis, saldonormal,\n"
            + "case when saldonormal='D' then debet-kredit\n"
            + "     when saldonormal='K' then kredit-debet\n"
            + "     end\n"
            + "nilaiLO\n"
            + "from\n"
            + "(select  a.kodesatker, a.kodepemda, a.namapemda, a.tahunanggaran, a.jeniscoa, \n"
            + "b.kodeakunutama, b.namaakunutama, b.kodeakunkelompok, b.namaakunkelompok, b.kodeakunjenis, b.namaakunjenis, b.saldonormal,\n"
            + "sum(b.nilaidebet) debet, sum(b.nilaikredit) kredit\n"
            + "from transaksi.headerjurnal a\n"
            + "join transaksi.jurnal b on a.headerjurnalid=b.headerjurnalid\n"
            + "where b.kodeakunutama in('8','9') and kodesatker=#{kodesatker} \n"
            + " and a.tanggalbukti >= date(#{tanggal1}) and a.tanggalbukti <= date (#{tanggal2}) and kodeposting=1\n"
            + "group by  a.kodesatker, a.kodepemda, a.namapemda, a.tahunanggaran, a.jeniscoa,  b.saldonormal,\n"
            + "b.kodeakunutama, b.namaakunutama, b.kodeakunkelompok, b.namaakunkelompok, b.kodeakunjenis, b.namaakunjenis \n"
            + "order by b.kodeakunutama, b.kodeakunkelompok, b.kodeakunjenis) RE\n"
            + "),\n"
            + "acc as(\n"
            + "	select distinct kodeakunutama kode, namaakunutama nama from aa\n"
            + "	union select distinct kodeakunutama||'.'||kodeakunkelompok kode, namaakunkelompok nama from aa\n"
            + "	union select distinct kodeakunutama||'.'||kodeakunkelompok||'.'||kodeakunjenis kode, namaakunjenis nama from aa\n"
            + "),\n"
            + "bb as(\n"
            + "select kodeakunutama nomor, sum(nilaiLO) nilai from aa\n"
            + "group by kodeakunutama\n"
            + "union\n"
            + "select kodeakunutama||'.'||kodeakunkelompok nomor, sum(nilaiLO) nilai from aa\n"
            + "group by kodeakunutama||'.'||kodeakunkelompok\n"
            + "union\n"
            + "select kodeakunutama||'.'||kodeakunkelompok||'.'||kodeakunjenis nomor, sum(nilaiLO) nilai from aa\n"
            + "group by kodeakunutama||'.'||kodeakunkelompok||'.'||kodeakunjenis\n"
            + "order by nomor\n"
            + ")\n"
            + "select kode nomor, nama, nilai from acc\n"
            + "left join bb on acc.kode=bb.nomor\n"
            + "order by nomor")
	@Results({ 
			@Result(property = "nomor", column = "nomor"),
			@Result(property = "uraian", column = "nama"),
			@Result(property = "nilai", column = "nilai"),
			})
    public List<Lampiran1Apbd> getLaporanPostingedLoPemda(@Param("tanggal1") String tanggal1, @Param("tanggal2") String tanggal2, @Param("kodesatker") String kodesatker);
	
        
    @Select("with aa as(\n"
            + "	select \n"
            + "kodesatker, kodepemda,namapemda,tahunanggaran,jeniscoa,\n"
            + "kodeakunutama, namaakunutama,kodeakunkelompok, namaakunkelompok, kodeakunjenis,namaakunjenis, saldonormal,\n"
            + "case when saldonormal='D' then debet-kredit\n"
            + "     when saldonormal='K' then kredit-debet\n"
            + "     end\n"
            + "nilaiLO\n"
            + "from\n"
            + "(select  a.kodesatker, a.kodepemda, a.namapemda, a.tahunanggaran, a.jeniscoa, \n"
            + "b.kodeakunutama, b.namaakunutama, b.kodeakunkelompok, b.namaakunkelompok, b.kodeakunjenis, b.namaakunjenis, b.saldonormal,\n"
            + "sum(b.nilaidebet) debet, sum(b.nilaikredit) kredit\n"
            + "from transaksi.headerjurnal a\n"
            + "join transaksi.jurnal b on a.headerjurnalid=b.headerjurnalid\n"
            + "where b.kodeakunutama in('8','9') \n"
            + " and a.tanggalbukti >= date(#{tanggal1}) and a.tanggalbukti <= date (#{tanggal2}) \n"
            + "group by  a.kodesatker, a.kodepemda, a.namapemda, a.tahunanggaran, a.jeniscoa,  b.saldonormal,\n"
            + "b.kodeakunutama, b.namaakunutama, b.kodeakunkelompok, b.namaakunkelompok, b.kodeakunjenis, b.namaakunjenis \n"
            + "order by b.kodeakunutama, b.kodeakunkelompok, b.kodeakunjenis) RE\n"
            + "),\n"
            + "acc as(\n"
            + "	select distinct kodeakunutama kode, namaakunutama nama from aa\n"
            + "	union select distinct kodeakunutama||'.'||kodeakunkelompok kode, namaakunkelompok nama from aa\n"
            + "	union select distinct kodeakunutama||'.'||kodeakunkelompok||'.'||kodeakunjenis kode, namaakunjenis nama from aa\n"
            + "),\n"
            + "bb as(\n"
            + "select kodeakunutama nomor, sum(nilaiLO) nilai from aa\n"
            + "group by kodeakunutama\n"
            + "union\n"
            + "select kodeakunutama||'.'||kodeakunkelompok nomor, sum(nilaiLO) nilai from aa\n"
            + "group by kodeakunutama||'.'||kodeakunkelompok\n"
            + "union\n"
            + "select kodeakunutama||'.'||kodeakunkelompok||'.'||kodeakunjenis nomor, sum(nilaiLO) nilai from aa\n"
            + "group by kodeakunutama||'.'||kodeakunkelompok||'.'||kodeakunjenis\n"
            + "order by nomor\n"
            + ")\n"
            + "select kode nomor, nama, nilai from acc\n"
            + "left join bb on acc.kode=bb.nomor\n"
            + "order by nomor")
	@Results({ 
			@Result(property = "nomor", column = "nomor"),
			@Result(property = "uraian", column = "nama"),
			@Result(property = "nilai", column = "nilai"),
			})
    public List<Lampiran1Apbd> getLaporanLoNasional(@Param("tanggal1") String tanggal1, @Param("tanggal2") String tanggal2);
    
    
    @Select( "with aa as(\n"
            + "	select \n"
            + "kodesatker, kodepemda,namapemda,tahunanggaran,jeniscoa,\n"
            + "kodeakunutama, namaakunutama,kodeakunkelompok, namaakunkelompok, kodeakunjenis,namaakunjenis, saldonormal,\n"
            + "case when saldonormal='D' then debet-kredit\n"
            + "     when saldonormal='K' then kredit-debet\n"
            + "     end\n"
            + "nilaiLO\n"
            + "from\n"
            + "(select  a.kodesatker, a.kodepemda, a.namapemda, a.tahunanggaran, a.jeniscoa, \n"
            + "b.kodeakunutama, b.namaakunutama, b.kodeakunkelompok, b.namaakunkelompok, b.kodeakunjenis, b.namaakunjenis, b.saldonormal,\n"
            + "sum(b.nilaidebet) debet, sum(b.nilaikredit) kredit\n"
            + "from transaksi.headerjurnal a\n"
            + "join transaksi.jurnal b on a.headerjurnalid=b.headerjurnalid\n"
            + "where b.kodeakunutama in('8','9') and kodesatker=#{kodesatker} \n"
            + " and a.tanggalbukti >= date(#{tanggal1}) and a.tanggalbukti <= date (#{tanggal2}) \n"
            + "group by  a.kodesatker, a.kodepemda, a.namapemda, a.tahunanggaran, a.jeniscoa,  b.saldonormal,\n"
            + "b.kodeakunutama, b.namaakunutama, b.kodeakunkelompok, b.namaakunkelompok, b.kodeakunjenis, b.namaakunjenis \n"
            + "order by b.kodeakunutama, b.kodeakunkelompok, b.kodeakunjenis) RE\n"
            + "),\n"
            + "acc as(\n"
            + "	select distinct kodeakunutama kode, namaakunutama nama from aa\n"
            + "	union select distinct kodeakunutama||'.'||kodeakunkelompok kode, namaakunkelompok nama from aa\n"
            + "	union select distinct kodeakunutama||'.'||kodeakunkelompok||'.'||kodeakunjenis kode, namaakunjenis nama from aa\n"
            + "),\n"
            + "bb as(\n"
            + "select kodeakunutama nomor, sum(nilaiLO) nilai from aa\n"
            + "group by kodeakunutama\n"
            + "union\n"
            + "select kodeakunutama||'.'||kodeakunkelompok nomor, sum(nilaiLO) nilai from aa\n"
            + "group by kodeakunutama||'.'||kodeakunkelompok\n"
            + "union\n"
            + "select kodeakunutama||'.'||kodeakunkelompok||'.'||kodeakunjenis nomor, sum(nilaiLO) nilai from aa\n"
            + "group by kodeakunutama||'.'||kodeakunkelompok||'.'||kodeakunjenis\n"
            + "order by nomor\n"
            + ")\n"
            + "select kode nomor, nama, nilai from acc\n"
            + "left join bb on acc.kode=bb.nomor\n"
            + "order by nomor")
	@Results({ 
			@Result(property = "nomor", column = "nomor"),
			@Result(property = "uraian", column = "nama"),
			@Result(property = "nilai", column = "nilai"),
			})
    public List<Lampiran1Apbd> getLaporanLoPemda(@Param("tanggal1") String tanggal1, @Param("tanggal2") String tanggal2, @Param("kodesatker") String kodesatker);
    
    @Select("with aa as(\n"
            + "	select \n"
            + "kodesatker, kodepemda,namapemda,tahunanggaran,jeniscoa,\n"
            + "kodeakunutama, namaakunutama,kodeakunkelompok, namaakunkelompok, kodeakunjenis,namaakunjenis, saldonormal,\n"
            + "case when saldonormal='D' then debet-kredit\n"
            + "     when saldonormal='K' then kredit-debet\n"
            + "     end\n"
            + "nilaineraca\n"
            + "from\n"
            + "(select  a.kodesatker, a.kodepemda, a.namapemda, a.tahunanggaran, a.jeniscoa, \n"
            + "b.kodeakunutama, b.namaakunutama, b.kodeakunkelompok, b.namaakunkelompok, b.kodeakunjenis, b.namaakunjenis, b.saldonormal,\n"
            + "sum(b.nilaidebet) debet, sum(b.nilaikredit) kredit\n"
            + "from transaksi.headerjurnal a\n"
            + "join transaksi.jurnal b on a.headerjurnalid=b.headerjurnalid\n"
            + "where b.kodeakunutama in('1','2','3') \n"
            + " and a.tanggalbukti >= date(#{tanggal1}) and a.tanggalbukti <= date (#{tanggal2}) and kodeposting=1\n"
            + "group by  a.kodesatker, a.kodepemda, a.namapemda, a.tahunanggaran, a.jeniscoa,  b.saldonormal,\n"
            + "b.kodeakunutama, b.namaakunutama, b.kodeakunkelompok, b.namaakunkelompok, b.kodeakunjenis, b.namaakunjenis \n"
            + "order by b.kodeakunutama, b.kodeakunkelompok, b.kodeakunjenis) RE\n"
            + "),\n"
            + "acc as(\n"
            + "	select distinct kodeakunutama kode, namaakunutama nama from aa\n"
            + "	union select distinct kodeakunutama||'.'||kodeakunkelompok kode, namaakunkelompok nama from aa\n"
            + "	union select distinct kodeakunutama||'.'||kodeakunkelompok||'.'||kodeakunjenis kode, namaakunjenis nama from aa\n"
            + "),\n"
            + "bb as(\n"
            + "select kodeakunutama nomor, sum(nilaineraca) nilai from aa\n"
            + "group by kodeakunutama\n"
            + "union\n"
            + "select kodeakunutama||'.'||kodeakunkelompok nomor, sum(nilaineraca) nilai from aa\n"
            + "group by kodeakunutama||'.'||kodeakunkelompok\n"
            + "union\n"
            + "select kodeakunutama||'.'||kodeakunkelompok||'.'||kodeakunjenis nomor, sum(nilaineraca) nilai from aa\n"
            + "group by kodeakunutama||'.'||kodeakunkelompok||'.'||kodeakunjenis\n"
            + "order by nomor\n"
            + ")\n"
            + "select kode nomor, nama, nilai from acc\n"
            + "left join bb on acc.kode=bb.nomor\n"
            + "order by nomor\n")
	@Results({ 
			@Result(property = "nomor", column = "nomor"),
			@Result(property = "uraian", column = "nama"),
			@Result(property = "nilai", column = "nilai"),
			})
    public List<Lampiran1Apbd> getLaporanPostingedNeracaNasional(@Param("tanggal1") String tanggal1, @Param("tanggal2") String tanggal2);
    
    
    @Select( "with aa as(\n"
            + "	select \n"
            + "kodesatker, kodepemda,namapemda,tahunanggaran,jeniscoa,\n"
            + "kodeakunutama, namaakunutama,kodeakunkelompok, namaakunkelompok, kodeakunjenis,namaakunjenis, saldonormal,\n"
            + "case when saldonormal='D' then debet-kredit\n"
            + "     when saldonormal='K' then kredit-debet\n"
            + "     end\n"
            + "nilaineraca\n"
            + "from\n"
            + "(select  a.kodesatker, a.kodepemda, a.namapemda, a.tahunanggaran, a.jeniscoa, \n"
            + "b.kodeakunutama, b.namaakunutama, b.kodeakunkelompok, b.namaakunkelompok, b.kodeakunjenis, b.namaakunjenis, b.saldonormal,\n"
            + "sum(b.nilaidebet) debet, sum(b.nilaikredit) kredit\n"
            + "from transaksi.headerjurnal a\n"
            + "join transaksi.jurnal b on a.headerjurnalid=b.headerjurnalid\n"
            + "where b.kodeakunutama in('1','2','3') and kodesatker=#{kodesatker} \n"
            + " and a.tanggalbukti >= date(#{tanggal1}) and a.tanggalbukti <= date (#{tanggal2}) and kodeposting=1\n"
            + "group by  a.kodesatker, a.kodepemda, a.namapemda, a.tahunanggaran, a.jeniscoa,  b.saldonormal,\n"
            + "b.kodeakunutama, b.namaakunutama, b.kodeakunkelompok, b.namaakunkelompok, b.kodeakunjenis, b.namaakunjenis \n"
            + "order by b.kodeakunutama, b.kodeakunkelompok, b.kodeakunjenis) RE\n"
            + "),\n"
            + "acc as(\n"
            + "	select distinct kodeakunutama kode, namaakunutama nama from aa\n"
            + "	union select distinct kodeakunutama||'.'||kodeakunkelompok kode, namaakunkelompok nama from aa\n"
            + "	union select distinct kodeakunutama||'.'||kodeakunkelompok||'.'||kodeakunjenis kode, namaakunjenis nama from aa\n"
            + "),\n"
            + "bb as(\n"
            + "select kodeakunutama nomor, sum(nilaineraca) nilai from aa\n"
            + "group by kodeakunutama\n"
            + "union\n"
            + "select kodeakunutama||'.'||kodeakunkelompok nomor, sum(nilaineraca) nilai from aa\n"
            + "group by kodeakunutama||'.'||kodeakunkelompok\n"
            + "union\n"
            + "select kodeakunutama||'.'||kodeakunkelompok||'.'||kodeakunjenis nomor, sum(nilaineraca) nilai from aa\n"
            + "group by kodeakunutama||'.'||kodeakunkelompok||'.'||kodeakunjenis\n"
            + "order by nomor\n"
            + ")\n"
            + "select kode nomor, nama, nilai from acc\n"
            + "left join bb on acc.kode=bb.nomor\n"
            + "order by nomor\n")
	@Results({ 
			@Result(property = "nomor", column = "nomor"),
			@Result(property = "uraian", column = "nama"),
			@Result(property = "nilai", column = "nilai"),
			})
    public List<Lampiran1Apbd> getLaporanPostingedNeracaPemda(@Param("tanggal1") String tanggal1, @Param("tanggal2") String tanggal2, @Param("kodesatker") String kodesatker);
	
        
    @Select("with aa as(\n"
            + "	select \n"
            + "kodesatker, kodepemda,namapemda,tahunanggaran,jeniscoa,\n"
            + "kodeakunutama, namaakunutama,kodeakunkelompok, namaakunkelompok, kodeakunjenis,namaakunjenis, saldonormal,\n"
            + "case when saldonormal='D' then debet-kredit\n"
            + "     when saldonormal='K' then kredit-debet\n"
            + "     end\n"
            + "nilaineraca\n"
            + "from\n"
            + "(select  a.kodesatker, a.kodepemda, a.namapemda, a.tahunanggaran, a.jeniscoa, \n"
            + "b.kodeakunutama, b.namaakunutama, b.kodeakunkelompok, b.namaakunkelompok, b.kodeakunjenis, b.namaakunjenis, b.saldonormal,\n"
            + "sum(b.nilaidebet) debet, sum(b.nilaikredit) kredit\n"
            + "from transaksi.headerjurnal a\n"
            + "join transaksi.jurnal b on a.headerjurnalid=b.headerjurnalid\n"
            + "where b.kodeakunutama in('1','2','3')  \n"
            + " and a.tanggalbukti >= date(#{tanggal1}) and a.tanggalbukti <= date (#{tanggal2}) \n"
            + "group by  a.kodesatker, a.kodepemda, a.namapemda, a.tahunanggaran, a.jeniscoa,  b.saldonormal,\n"
            + "b.kodeakunutama, b.namaakunutama, b.kodeakunkelompok, b.namaakunkelompok, b.kodeakunjenis, b.namaakunjenis \n"
            + "order by b.kodeakunutama, b.kodeakunkelompok, b.kodeakunjenis) RE\n"
            + "),\n"
            + "acc as(\n"
            + "	select distinct kodeakunutama kode, namaakunutama nama from aa\n"
            + "	union select distinct kodeakunutama||'.'||kodeakunkelompok kode, namaakunkelompok nama from aa\n"
            + "	union select distinct kodeakunutama||'.'||kodeakunkelompok||'.'||kodeakunjenis kode, namaakunjenis nama from aa\n"
            + "),\n"
            + "bb as(\n"
            + "select kodeakunutama nomor, sum(nilaineraca) nilai from aa\n"
            + "group by kodeakunutama\n"
            + "union\n"
            + "select kodeakunutama||'.'||kodeakunkelompok nomor, sum(nilaineraca) nilai from aa\n"
            + "group by kodeakunutama||'.'||kodeakunkelompok\n"
            + "union\n"
            + "select kodeakunutama||'.'||kodeakunkelompok||'.'||kodeakunjenis nomor, sum(nilaineraca) nilai from aa\n"
            + "group by kodeakunutama||'.'||kodeakunkelompok||'.'||kodeakunjenis\n"
            + "order by nomor\n"
            + ")\n"
            + "select kode nomor, nama, nilai from acc\n"
            + "left join bb on acc.kode=bb.nomor\n"
            + "order by nomor\n")
	@Results({ 
			@Result(property = "nomor", column = "nomor"),
			@Result(property = "uraian", column = "nama"),
			@Result(property = "nilai", column = "nilai"),
			})
    public List<Lampiran1Apbd> getLaporanNeracaNasional(@Param("tanggal1") String tanggal1, @Param("tanggal2") String tanggal2);
    
    
    @Select( "with aa as(\n"
            + "	select \n"
            + "kodesatker, kodepemda,namapemda,tahunanggaran,jeniscoa,\n"
            + "kodeakunutama, namaakunutama,kodeakunkelompok, namaakunkelompok, kodeakunjenis,namaakunjenis, saldonormal,\n"
            + "case when saldonormal='D' then debet-kredit\n"
            + "     when saldonormal='K' then kredit-debet\n"
            + "     end\n"
            + "nilaineraca\n"
            + "from\n"
            + "(select  a.kodesatker, a.kodepemda, a.namapemda, a.tahunanggaran, a.jeniscoa, \n"
            + "b.kodeakunutama, b.namaakunutama, b.kodeakunkelompok, b.namaakunkelompok, b.kodeakunjenis, b.namaakunjenis, b.saldonormal,\n"
            + "sum(b.nilaidebet) debet, sum(b.nilaikredit) kredit\n"
            + "from transaksi.headerjurnal a\n"
            + "join transaksi.jurnal b on a.headerjurnalid=b.headerjurnalid\n"
            + "where b.kodeakunutama in('1','2','3') and kodesatker=#{kodesatker} \n"
            + " and a.tanggalbukti >= date(#{tanggal1}) and a.tanggalbukti <= date (#{tanggal2})\n"
            + "group by  a.kodesatker, a.kodepemda, a.namapemda, a.tahunanggaran, a.jeniscoa,  b.saldonormal,\n"
            + "b.kodeakunutama, b.namaakunutama, b.kodeakunkelompok, b.namaakunkelompok, b.kodeakunjenis, b.namaakunjenis \n"
            + "order by b.kodeakunutama, b.kodeakunkelompok, b.kodeakunjenis) RE\n"
            + "),\n"
            + "acc as(\n"
            + "	select distinct kodeakunutama kode, namaakunutama nama from aa\n"
            + "	union select distinct kodeakunutama||'.'||kodeakunkelompok kode, namaakunkelompok nama from aa\n"
            + "	union select distinct kodeakunutama||'.'||kodeakunkelompok||'.'||kodeakunjenis kode, namaakunjenis nama from aa\n"
            + "),\n"
            + "bb as(\n"
            + "select kodeakunutama nomor, sum(nilaineraca) nilai from aa\n"
            + "group by kodeakunutama\n"
            + "union\n"
            + "select kodeakunutama||'.'||kodeakunkelompok nomor, sum(nilaineraca) nilai from aa\n"
            + "group by kodeakunutama||'.'||kodeakunkelompok\n"
            + "union\n"
            + "select kodeakunutama||'.'||kodeakunkelompok||'.'||kodeakunjenis nomor, sum(nilaineraca) nilai from aa\n"
            + "group by kodeakunutama||'.'||kodeakunkelompok||'.'||kodeakunjenis\n"
            + "order by nomor\n"
            + ")\n"
            + "select kode nomor, nama, nilai from acc\n"
            + "left join bb on acc.kode=bb.nomor\n"
            + "order by nomor\n")
	@Results({ 
			@Result(property = "nomor", column = "nomor"),
			@Result(property = "uraian", column = "nama"),
			@Result(property = "nilai", column = "nilai"),
			})
    public List<Lampiran1Apbd> getLaporanNeracaPemda(@Param("tanggal1") String tanggal1, @Param("tanggal2") String tanggal2, @Param("kodesatker") String kodesatker);
    
    @Select( "select ''::text nomor, 'lra'::text nama, count(distinct(kodesatker)) nilai from transaksi.headerjurnal where tahunanggaran=#{tahun} \n"
            + "union\n"
            + "select ''::text nomor, 'apbd'::text nama, count(distinct(kodesatker)) nilai from transaksi.headerapbd where tahunanggaran=#{tahun} \n"
            + "union\n"
            + "select ''::text nomor, 'dth'::text nama, count(distinct(kodesatker)) dth from transaksi.headerdth where tahunanggaran=#{tahun}")
	@Results({ 
			@Result(property = "nomor", column = "nomor"),
			@Result(property = "uraian", column = "nama"),
			@Result(property = "nilai", column = "nilai"),
			})
    public List<Lampiran1Apbd> getLaporanJumlahPemdaPengirim(@Param("tahun") short tahun);
	
}
