add rks
This commit is contained in:
@@ -26,4 +26,6 @@ public interface RksDaftarIsiRepository extends JpaRepository<RksDaftarIsi, Long
|
||||
|
||||
Optional<RksDaftarIsi> findByKodeTemplateAndIsDeleteFalse(String kodeTemplate);
|
||||
|
||||
Optional<RksDaftarIsi> findByIdAndIsDeleteFalse(Long id);
|
||||
|
||||
}
|
||||
|
||||
@@ -4,10 +4,19 @@ import com.iconplus.smartproc.model.entity.RksIsi;
|
||||
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.Modifying;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
import org.springframework.data.repository.query.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
public interface RksIsiRepository extends JpaRepository<RksIsi, Long> {
|
||||
|
||||
Page<RksIsi> findByRksDaftarIsiIdAndIsDeleteFalse(Long rksDaftarIsiId, Pageable pageable);
|
||||
|
||||
@Modifying
|
||||
@Query(value = "update RksIsi ri " +
|
||||
"set ri.isDelete = true " +
|
||||
"where ri.rksDaftarIsiId = :rksDaftarIsiId")
|
||||
void deleteRksIsi(@Param("rksDaftarIsiId") Long rksDaftarIsiId);
|
||||
}
|
||||
|
||||
@@ -15,19 +15,21 @@ public interface RksTemplateRepository extends JpaRepository<RksTemplate, Long>
|
||||
|
||||
Optional<RksTemplate> findByKodeTemplateAndIsDeleteFalse(String kodeTemplate);
|
||||
|
||||
Optional<RksTemplate> findByIdAndIsDeleteFalse(Long id);
|
||||
|
||||
@Query(value = "SELECT rt.id as id, " +
|
||||
"rt.kode_template as kodeTemplate, " +
|
||||
"rt.kodeTemplate as kodeTemplate, " +
|
||||
"rt.namaTemplate as namaTemplate, " +
|
||||
"rt.metode_pengadaan_id as metodePengadaanId, " +
|
||||
"m.metode_pengadaan as metodePengadaan, " +
|
||||
"rt.metodePengadaanId as metodePengadaanId, " +
|
||||
"m.metodePengadaan as metodePengadaan, " +
|
||||
"rt.versi as versi, " +
|
||||
"rt.rks_daftar_isi_id as rksDaftarIsiId, " +
|
||||
"rdi.nama_template as daftarIsi, " +
|
||||
"rt.is_active as isActive " +
|
||||
"FROM rks_template as rt " +
|
||||
"JOIN rks_daftar_isi rdi ON rdi.id = rt.rks_daftar_isi_id " +
|
||||
"JOIN metode_pengadaan m ON m.id = rt.metode_pengadaan_id " +
|
||||
"WHERE rt.is_delete = 0", nativeQuery = true)
|
||||
"rt.rksDaftarIsiId as rksDaftarIsiId, " +
|
||||
"rdi.namaTemplate as daftarIsi, " +
|
||||
"rt.isActive as isActive " +
|
||||
"FROM RksTemplate as rt " +
|
||||
"JOIN RksDaftarIsi rdi ON rdi.id = rt.rksDaftarIsiId " +
|
||||
"JOIN MetodePengadaan m ON m.id = rt.metodePengadaanId " +
|
||||
"WHERE rt.isDelete = 0")
|
||||
Page<RksTemplateView> getListRksTemplate(Pageable pageable);
|
||||
|
||||
}
|
||||
|
||||
@@ -61,6 +61,7 @@ public interface UsersRepository extends JpaRepository<Users, Long> {
|
||||
"u.instansiId as instansiId, " +
|
||||
"i.instansi as instansi, " +
|
||||
"u.email as email, " +
|
||||
"u.telepon as telepon, " +
|
||||
"u.isActive as isActive, " +
|
||||
"u.isDelete as isDelete " +
|
||||
"FROM Users u " +
|
||||
@@ -86,6 +87,7 @@ public interface UsersRepository extends JpaRepository<Users, Long> {
|
||||
"u.instansiId as instansiId, " +
|
||||
"i.instansi as instansi, " +
|
||||
"u.email as email, " +
|
||||
"u.telepon as telepon, " +
|
||||
"u.isActive as isActive, " +
|
||||
"u.isDelete as isDelete " +
|
||||
"FROM Users u " +
|
||||
|
||||
Reference in New Issue
Block a user