Merge pull request 'Show advertisements distinct.' (#122) from feature/show_ads_distinct into master
Reviewed-on: #122 Reviewed-by: Jannik Seiler <seil0@mosad.xyz>
This commit is contained in:
commit
31bff55a20
|
@ -23,7 +23,7 @@ public interface ArticleRepository extends JpaRepository<Article, Long> {
|
||||||
@Query("SELECT a FROM Article a")
|
@Query("SELECT a FROM Article a")
|
||||||
List<Article> findAll();
|
List<Article> findAll();
|
||||||
|
|
||||||
@Query(value = "Select a.* from articles as a, article_offers as ao, warehouse_booking_position_entries as wbpe where a.related_id = ao.id and wbpe.article_id = a.id and ao.should_be_advertised = true group by wbpe.slot_id having max(wbpe.id) and wbpe.new_sum_slot != 0", nativeQuery = true)
|
@Query(value = "SELECT DISTINCT a.* from articles as a, article_offers as ao, warehouse_booking_position_entries as wbpe where a.related_id = ao.id and wbpe.article_id = a.id and ao.should_be_advertised = true group by wbpe.slot_id having max(wbpe.id) and wbpe.new_sum_slot != 0", nativeQuery = true)
|
||||||
List<Article> getAdvertisedArticles();
|
List<Article> getAdvertisedArticles();
|
||||||
|
|
||||||
@Query("SELECT a FROM CustomerOrderPosition cop JOIN cop.order co JOIN co.customer c JOIN cop.article a ORDER BY co.id DESC")
|
@Query("SELECT a FROM CustomerOrderPosition cop JOIN cop.order co JOIN co.customer c JOIN cop.article a ORDER BY co.id DESC")
|
||||||
|
|
Reference in New Issue