diff --git a/src/main/java/fr/abes/sudoc/component/BaseXmlFunctionsCaller.java b/src/main/java/fr/abes/sudoc/component/BaseXmlFunctionsCaller.java index 30d25b8..0be9d2c 100644 --- a/src/main/java/fr/abes/sudoc/component/BaseXmlFunctionsCaller.java +++ b/src/main/java/fr/abes/sudoc/component/BaseXmlFunctionsCaller.java @@ -51,16 +51,16 @@ public List datToPpn(Integer date, String auteur, String titre) throws U request.append(" JOIN AUTORITES.bib_100$a b"); request.append(" ON a.ppn=b.ppn"); if (auteur != null) { - request.append(" WHERE a.typerecord in ('c','n') and a.typecontrol = 'm' and CONTAINS(a.citation1, '(").append(titre).append(") AND (").append(auteur).append(")')>0 and (substr(b.datas,10,4) = '").append(date).append("' or substr(b.datas,14,4)='").append(date).append("')"); + request.append(" WHERE (a.typerecord in ('c','n') and a.typecontrol = 'm' and CONTAINS(a.citation1, '(").append(titre).append(") AND (").append(auteur).append(")')>0 and rownum < 10) and (substr(b.datas,10,4) = '").append(date).append("' or substr(b.datas,14,4)='").append(date).append("')"); } else { - request.append(" WHERE a.typerecord in ('c','n') and a.typecontrol = 'm' and CONTAINS(a.citation1, '(").append(titre).append(")')>0 and (substr(b.datas,10,4) = '").append(date).append("' or substr(b.datas,14,4)='").append(date).append("')"); + request.append(" WHERE (a.typerecord in ('c','n') and a.typecontrol = 'm' and CONTAINS(a.citation1, '(").append(titre).append(")')>0 and rownum < 10) and (substr(b.datas,10,4) = '").append(date).append("' or substr(b.datas,14,4)='").append(date).append("')"); } } else { request.append(" FROM biblio_table_generale a"); if (auteur != null) { - request.append(" WHERE a.typerecord in ('c','n') and a.typecontrol = 'm' and CONTAINS(a.citation1, '(").append(titre).append(") AND (").append(auteur).append(")')>0"); + request.append(" WHERE (a.typerecord in ('c','n') and a.typecontrol = 'm' and CONTAINS(a.citation1, '(").append(titre).append(") AND (").append(auteur).append(")')>0 and rownum < 10)"); } else { - request.append(" WHERE a.typerecord in ('c','n') and a.typecontrol = 'm' and CONTAINS(a.citation1, '(").append(titre).append(")')>0"); + request.append(" WHERE (a.typerecord in ('c','n') and a.typecontrol = 'm' and CONTAINS(a.citation1, '(").append(titre).append(")')>0 and rownum < 10)"); } } return baseXmlJdbcTemplate.queryForList(request.toString(), String.class);