|
@@ -10,6 +10,8 @@ import org.springframework.data.jpa.repository.Query;
|
10
|
10
|
import org.springframework.data.repository.query.Param;
|
11
|
11
|
import org.springframework.stereotype.Repository;
|
12
|
12
|
|
|
13
|
+import java.util.List;
|
|
14
|
+
|
13
|
15
|
@Repository
|
14
|
16
|
public interface MaterialInfoRepository extends JpaRepository<MaterialInfo, Integer> {
|
15
|
17
|
|
|
@@ -48,4 +50,8 @@ public interface MaterialInfoRepository extends JpaRepository<MaterialInfo, Inte
|
48
|
50
|
@Param("materialType") Integer materialType,
|
49
|
51
|
Pageable pageable,
|
50
|
52
|
@Param("userId") Integer userId);
|
|
53
|
+ @Query(nativeQuery = true,
|
|
54
|
+ value = "select * from material_info where (:materialName = '' or material_name like concat('%', :materialName, '%'))"
|
|
55
|
+ )
|
|
56
|
+ List<MaterialInfo> findAllByName(@Param("materialName") String materialName);
|
51
|
57
|
}
|