Améliorations

This commit is contained in:
2024-12-05 16:39:22 +01:00
parent d7a23c63d4
commit bc7c67be4a
2 changed files with 17 additions and 5 deletions

View File

@@ -166,9 +166,15 @@ public class Database {
List<String> series = new ArrayList<>();
try {
String query = "SELECT name FROM Series " +
"WHERE creation_date BETWEEN ? AND ? " +
"ORDER BY creation_date DESC " +
"LIMIT ? OFFSET ?";
"WHERE creation_date BETWEEN ? AND ? " +
"ORDER BY " +
" CASE " +
" WHEN name LIKE 'Série custom%' THEN CAST(REGEXP_SUBSTR(name, '[0-9]+') AS UNSIGNED) " + // Extraction numérique pour 'Série custom'
" ELSE NULL " +
" END ASC, " + // Tri par numéro pour 'Série custom'
" created_by_developer DESC, " + // Tri par développeur ou joueur
" name ASC " + // Tri alphabétique
"LIMIT ? OFFSET ?";
PreparedStatement statement = this.database.prepareStatement(query);
statement.setDate(1, new java.sql.Date(startDate.getTime()));