add api drp list rekomendasi
This commit is contained in:
@@ -2,6 +2,8 @@ package com.iconplus.smartproc.repository;
|
||||
|
||||
import com.iconplus.smartproc.model.entity.DrpRekomendasi;
|
||||
import com.iconplus.smartproc.model.projection.DrpRekomendasiView;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
import org.springframework.stereotype.Repository;
|
||||
@@ -23,4 +25,34 @@ public interface DrpRekomendasiRepository extends JpaRepository<DrpRekomendasi,
|
||||
"WHERE dr.isDelete = false " +
|
||||
"AND dr.jenisPengadaanId = :jenisPengadaanId")
|
||||
List<DrpRekomendasiView> getListDrpRekomendasi(Long jenisPengadaanId);
|
||||
|
||||
@Query(value = "SELECT dr.id as id, " +
|
||||
"da.isApprove as isApprove, " +
|
||||
"j.jabatan as jabatan, " +
|
||||
"dr.rekomendasi as rekomendasi, " +
|
||||
"dr.rekomendasiDate as rekomendasiDate " +
|
||||
"FROM DrpRekomendasi dr " +
|
||||
"JOIN DrpApproval da ON da.id = dr.drpApprovalId " +
|
||||
"JOIN Users u ON u.id = dr.userId " +
|
||||
"JOIN Jabatan j ON j.id = u.jabatanId " +
|
||||
"WHERE dr.isDelete = false " +
|
||||
"AND dr.jenisPengadaanId = :jenisPengadaanId")
|
||||
Page<DrpRekomendasiView> getListDrpRekomendasi(Long jenisPengadaanId, Pageable pageable);
|
||||
|
||||
@Query(value = "SELECT dr.id as id, " +
|
||||
"dp.nomor as nomor, " +
|
||||
"dp.namaPengadaan as namaPengadaan, " +
|
||||
"da.isApprove as isApprove, " +
|
||||
"da.level as level, " +
|
||||
"j.jabatan as jabatan, " +
|
||||
"dr.rekomendasi as rekomendasi, " +
|
||||
"dr.rekomendasiDate as rekomendasiDate " +
|
||||
"FROM DrpRekomendasi dr " +
|
||||
"JOIN DrpApproval da ON da.id = dr.drpApprovalId " +
|
||||
"JOIN Users u ON u.id = dr.userId " +
|
||||
"JOIN Jabatan j ON j.id = u.jabatanId " +
|
||||
"JOIN DrpPengadaan dp ON dp.id = dr.jenisPengadaanId " +
|
||||
"WHERE dr.isDelete = false " +
|
||||
"AND dr.drpId = :drpId")
|
||||
Page<DrpRekomendasiView> getListDrpRekomendasiByDrpId(Long drpId, Pageable pageable);
|
||||
}
|
||||
|
@@ -44,4 +44,15 @@ public interface DrpRepository extends JpaRepository<Drp, Long> {
|
||||
"FROM Drp d " +
|
||||
"WHERE d.isDelete = false")
|
||||
Page<DrpApprovalView> getListApprovalDrp(Pageable pageable);
|
||||
|
||||
|
||||
|
||||
@Query(value = "SELECT d.id as id, " +
|
||||
"d.tahun as tahun, " +
|
||||
"d.isPrint as isPrint, " +
|
||||
"d.printDate as printDate " +
|
||||
"FROM Drp d " +
|
||||
"WHERE d.isDelete = false")
|
||||
Page<DrpView> getListPrintDrp(Pageable pageable);
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user