package com.skyversation.poiaddr.service;

import com.skyversation.poiaddr.entity.TestData;
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;

@Repository
public interface TestDataRepository extends JpaRepository<TestData, Long> {
    // 使用原生 SQL 进行模糊查询并分页
    @Query(value = "SELECT * FROM test_data WHERE update_time is null", nativeQuery = true)
//    @Query(value = "SELECT * FROM test_data WHERE sk_hjdz like '%新松江路%' and standardized_address like '%新路%'", nativeQuery = true)
    Page<TestData> findByAddress1Containing(Pageable pageable);
}
