package com.ywt.domain.entity.glasses;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

public interface PostAddressRepository extends JpaRepository<PostAddress, Integer>, JpaSpecificationExecutor<PostAddress> {

    /**
     * 根据主键找到地址
     *
     * @param addressId 地址主键ID
     * @return {@link PostAddress}
     */
    @Query(value = "select * from post_address where deleted = 0 and id = ? limit 1;", nativeQuery = true)
    PostAddress findOneById(int addressId);
}