inisialisasi kembali

This commit is contained in:
tias
2024-06-15 17:04:28 +07:00
parent 3e97011f66
commit 0f99b87e47
151 changed files with 9074 additions and 224 deletions

View File

@@ -0,0 +1,61 @@
package org.sadigit.repository.service;
import java.util.List;
import org.hibernate.Session;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.inject.Inject;
import jakarta.persistence.Tuple;
@ApplicationScoped
public class PlnMobileServiceRepository {
@Inject
Session session;
public List<Tuple> get10PengaduanTerbaruByIdPel(String idpel) {
// log.info("idpel: {}", idpel);
String query = """
(
select
g.id_pelanggan_no_meter as idpel,
g.no_laporan as noLaporan,
g.alamat_pelapor as alamatPelapor,
g.created_date as createdDate,
g.nama_pelapor as namaPelapor,
r1.nama as namaRegu,
g.keterangan as keterangan
from
Gangguan g
left join MasterRegu r1 on g.regu.id = r1.id
where
g.id_pelanggan_no_meter = :idpel and
g.created_date is not null
union all
select
k.id_pelanggan_no_meter as idpel,
k.no_laporan as noLaporan,
k.alamat_pelapor as alamatPelapor,
k.created_date as createdDate,
k.nama_pelapor as namaPelapor,
r2.nama as namaRegu,
k.keterangan as keterangan
from
Keluhan k
left join MasterRegu r2 on k.regu.id = r2.id
where
k.id_pelanggan_no_meter = :idpel and
k.created_date is not null
)
order by createdDate asc
""";
return session.createQuery(query, Tuple.class)
.setParameter("idpel", idpel)
.setMaxResults(10)
.getResultList();
}
}