remove id men
This commit is contained in:
@@ -17,9 +17,9 @@ public interface MenusRepository extends JpaRepository<Menus, Long> {
|
||||
|
||||
@Query(value = "SELECT m " +
|
||||
"FROM Menus m " +
|
||||
"WHERE m.id in (SELECT DISTINCT(s.parentId) from Menus s " +
|
||||
"order by s.parentId) " +
|
||||
"AND m.isDelete = false")
|
||||
"WHERE m.parentId = 0 " +
|
||||
"AND m.isDelete = false " +
|
||||
"ORDER BY m.urutan")
|
||||
List<Menus> findAllParentMenu();
|
||||
|
||||
|
||||
|
@@ -1,7 +1,11 @@
|
||||
package com.iconplus.smartproc.repository;
|
||||
|
||||
import com.iconplus.smartproc.model.entity.RksTemplate;
|
||||
import com.iconplus.smartproc.model.projection.RksTemplateView;
|
||||
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;
|
||||
|
||||
import java.util.Optional;
|
||||
@@ -11,4 +15,19 @@ public interface RksTemplateRepository extends JpaRepository<RksTemplate, Long>
|
||||
|
||||
Optional<RksTemplate> findByKodeTemplateAndIsDeleteFalse(String kodeTemplate);
|
||||
|
||||
@Query(value = "SELECT rt.id as id, " +
|
||||
"rt.kode_template as kodeTemplate, " +
|
||||
"rt.namaTemplate as namaTemplate, " +
|
||||
"rt.metode_pengadaan_id as metodePengadaanId, " +
|
||||
"m.metode_pengadaan 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)
|
||||
Page<RksTemplateView> getListRksTemplate(Pageable pageable);
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user