Skip to content

Commit

Permalink
Fix : Amélioration requête date / auteur / titre en limitant le nb de…
Browse files Browse the repository at this point in the history
… résultat sur la première moitié de la requête
  • Loading branch information
pierre-maraval committed Jan 17, 2025
1 parent 300db17 commit 88fbe71
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,16 @@ public List<String> 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);
Expand Down

0 comments on commit 88fbe71

Please sign in to comment.