springboot jpa sql查询与传值

时间:2024-05-04 17:37:38
public interface ARepository extends PagingAndSortingRepository<A, APK>, JpaSpecificationExecutor<A> {
@Query(value="select field1, field2 from table1 WHERE param1=:param1", nativeQuery=true)
    List<Object[]> method1(@Param("param1") String param1);
}