Change SQL requests

This commit is contained in:
jacques 2022-07-14 13:40:13 +02:00
parent b35b57e437
commit b2c60c8c24
3 changed files with 4 additions and 4 deletions

View file

@ -82,7 +82,7 @@ public class UtilDate {
* @return int numbers of days between date and today * @return int numbers of days between date and today
* Number of days between date (older than today) and today * Number of days between date (older than today) and today
*/ */
static int nbOfDaysBetweenDateAndToday(Date date) { public static int nbOfDaysBetweenDateAndToday(Date date) {
Date oldDate = dateAtNoon(date); // Be sure that the old date is at Noon Date oldDate = dateAtNoon(date); // Be sure that the old date is at Noon
Date todayDate = dateAtNoon(new Date()); // Be sure that we use today at Noon Date todayDate = dateAtNoon(new Date()); // Be sure that we use today at Noon

View file

@ -12,7 +12,7 @@ public interface MedicinesDAO {
@Query("SELECT * FROM drugs") @Query("SELECT * FROM drugs")
List<Medicine> getAllMedicines(); List<Medicine> getAllMedicines();
@Query("SELECT * FROM drugs WHERE cip13 = :cip13") @Query("SELECT COALESCE(label_group,name), * FROM drugs WHERE cip13 = :cip13")
Medicine getMedicineByCIP13(String cip13); Medicine getMedicineByCIP13(String cip13);
@Query("SELECT count(*) FROM drugs") @Query("SELECT count(*) FROM drugs")

View file

@ -21,10 +21,10 @@ public interface PrescriptionsDAO {
@Delete @Delete
void delete(Prescription prescription); void delete(Prescription prescription);
@Query("SELECT * FROM prescriptions") @Query("SELECT COALESCE(label_group,name), * FROM prescriptions")
List<Prescription> getAllMedics(); List<Prescription> getAllMedics();
@Query("SELECT * FROM prescriptions WHERE cip13 = :cip13") @Query("SELECT COALESCE(label_group,name), * FROM prescriptions WHERE cip13 = :cip13")
Prescription getMedicByCIP13(String cip13); Prescription getMedicByCIP13(String cip13);
@Query("SELECT count(*) FROM prescriptions") @Query("SELECT count(*) FROM prescriptions")