Browse Source

预约流程代码优化

ouyang 3 years ago
parent
commit
b433099e14
1 changed files with 4 additions and 1 deletions
  1. 4 1
      src/main/java/com/izouma/nineth/repo/CollectionRepo.java

+ 4 - 1
src/main/java/com/izouma/nineth/repo/CollectionRepo.java

@@ -88,7 +88,8 @@ public interface CollectionRepo extends JpaRepository<Collection, Long>, JpaSpec
 
     @Transactional
     @Modifying
-    @Query("update Collection c set c.scheduleSale = false, c.startTime = null, c.onShelf = ?2, c.salable = true where c.id = ?1")
+//    @Query("update Collection c set c.scheduleSale = false, c.startTime = null, c.onShelf = ?2, c.salable = true where c.id = ?1")
+    @Query("update Collection c set c.scheduleSale = false, c.onShelf = ?2, c.salable = true where c.id = ?1")
     @CacheEvict(value = "collection", key = "#id")
     void scheduleOnShelf(Long id, boolean onShelf);
 
@@ -143,4 +144,6 @@ public interface CollectionRepo extends JpaRepository<Collection, Long>, JpaSpec
     @Query("select c.vipQuota from Collection c where c.id = ?1")
     Integer getVipQuota(Long id);
 
+    @Query("select c.id, c.assetId, c.stock, c.startTime, c.endTime, c.publishTime, c.purchaseTime from Collection c where c.endTime >= ?1 and c.endTime <= ?2")
+    List<Collection> findByStartTimeAfter(LocalDateTime startTime , LocalDateTime endTime);
 }