Skip to content

Commit

Permalink
refactor : Retouche sauts de lignes, suppression @column
Browse files Browse the repository at this point in the history
  • Loading branch information
pierre-maraval committed Nov 12, 2024
1 parent d920f05 commit 2d36caf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 0 additions & 2 deletions core/src/main/java/fr/abes/item/core/dto/DemandeDto.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import fr.abes.item.core.entities.baseXml.LibProfile;
import fr.abes.item.core.entities.item.Demande;
import jakarta.persistence.Column;
import lombok.Getter;
import lombok.Setter;

Expand All @@ -14,7 +13,6 @@
public class DemandeDto {
private Demande demande;

@Column(name = "NB_LIGNEFICHIER")
private Integer nbLignes;

public DemandeDto(Demande demande, Integer nbLignes) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,26 @@
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Optional;

@Repository
@ItemConfiguration
public interface IDemandeSuppDao extends JpaRepository<DemandeSupp, Integer> {

@Query("select new fr.abes.item.core.dto.DemandeDto(d, COUNT(l)) FROM DemandeSupp d JOIN d.ligneFichierSupps l WHERE d.etatDemande.numEtat NOT IN (9, 10) GROUP BY d")
List<DemandeDto> getAllActiveDemandesSuppForAdminExtended();

@Query("select new fr.abes.item.core.dto.DemandeDto(d, COUNT(l)) FROM DemandeSupp d JOIN d.ligneFichierSupps l where d.iln = :iln and d.etatDemande.numEtat not in (9, 10) GROUP BY d")
List<DemandeDto> getAllActiveDemandesSuppForAdmin(@Param("iln") String iln);

@Query("select new fr.abes.item.core.dto.DemandeDto(d, COUNT(l)) FROM DemandeSupp d JOIN d.ligneFichierSupps l where d.iln = :iln and d.etatDemande.numEtat = 9 GROUP BY d")
List<DemandeDto> getAllArchivedDemandesSupp(@Param("iln") String iln);

@Query("select d from DemandeSupp d where d.iln = :iln and d.etatDemande.numEtat not in (9, 2, 10)")
List<DemandeDto> getActiveDemandesSuppForUserExceptedPreparedStatus(@Param("iln") String iln);

@Query("select new fr.abes.item.core.dto.DemandeDto(d, COUNT(l)) FROM DemandeSupp d JOIN d.ligneFichierSupps l where d.etatDemande.numEtat = 9 GROUP BY d")
List<DemandeDto> getAllArchivedDemandesSuppExtended();

List<DemandeSupp> findDemandeSuppsByEtatDemande_IdOrderByDateModificationAsc(Integer id);

@Query("select d from DemandeSupp d where d.etatDemande.numEtat = 7 and (day(current_date) - day(d.dateModification)) > 90 order by d.dateModification asc")
Expand Down

0 comments on commit 2d36caf

Please sign in to comment.