diff --git a/src/main/java/com/example/PLADIALMArchiving/archiving/repository/MaterialRepository.java b/src/main/java/com/example/PLADIALMArchiving/archiving/repository/MaterialRepository.java index ec931b3..2c8828e 100644 --- a/src/main/java/com/example/PLADIALMArchiving/archiving/repository/MaterialRepository.java +++ b/src/main/java/com/example/PLADIALMArchiving/archiving/repository/MaterialRepository.java @@ -11,9 +11,5 @@ @Repository public interface MaterialRepository extends JpaRepository { - -// @Query("SELECT mt FROM Material mt WHERE :extension LIKE CONCAT('%', mt.extension, '%') ") -// List findByProject(Project project, @Param("extension") String extension); - - Page findByProjectAndExtensionIn(Project project, List extensions, Pageable pageable); + Page findByProjectAndExtensionInAndNameContaining(Project project, List extensions, String cond, Pageable pageable); } diff --git a/src/main/java/com/example/PLADIALMArchiving/archiving/service/ArchivingService.java b/src/main/java/com/example/PLADIALMArchiving/archiving/service/ArchivingService.java index 9df642e..feec7a1 100644 --- a/src/main/java/com/example/PLADIALMArchiving/archiving/service/ArchivingService.java +++ b/src/main/java/com/example/PLADIALMArchiving/archiving/service/ArchivingService.java @@ -60,7 +60,7 @@ public Page searchMaterial(Long projectId, SearchMaterialReq } else if (category == Category.DOCS) { extension = List.of(Constants.EXTENSION.DOCS.split(" ")); } - filteredMaterials = materialRepository.findByProjectAndExtensionIn(project, extension, pageable); + filteredMaterials = materialRepository.findByProjectAndExtensionInAndNameContaining(project, extension, searchMaterialReq.getCond(), pageable); } else { filteredMaterials = materialRepository.findAll(pageable); }