服务:
public Page<ExportDto> findBySearch(FirmDto firm, List<String> product1, List<String> country1, ExDocumentTypeDto exDocumentType, Date documentDate, Date documentDateEnd, String documentSerial, String invoiceNumber, CurrencyGtoDto currencygto, Pageable pageable) {
if(firm.getId()!=null ) {
parametre=parametre + "p.firm.id=:" + firm.getId();
}
Page<Export> exports = dao.findBySearchDao(pageable,parametre);
}
DAO:
@Query("SELECT p FROM Export p WHERE p=:parametre")
Page<Export> findBySearchDao(Pageable pageable, @Param("parametre") String parametre);