package common.repository;

import common.model.PdAttachment;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface PdAttachmentRepository extends JpaRepository<PdAttachment, Long> {

    List<PdAttachment> findBycontractCode(String code);

    @Query(value = "select * from pd_attachment where contract_code=?1 and upload_date >= ?2 and upload_date <= ?3", nativeQuery = true)
    List<PdAttachment> findBycontractCodeAndDate(String code, String startDate, String endDate);
}
