|
|
@@ -13,6 +13,7 @@ import org.springframework.lang.NonNull;
|
|
|
|
|
|
import javax.transaction.Transactional;
|
|
|
import java.time.LocalDateTime;
|
|
|
+import java.util.Collection;
|
|
|
import java.util.List;
|
|
|
import java.util.Optional;
|
|
|
|
|
|
@@ -195,4 +196,16 @@ public interface UserRepo extends JpaRepository<User, Long>, JpaSpecificationExe
|
|
|
@Transactional
|
|
|
@Modifying
|
|
|
void setAuthStatus(Long id, AuthStatus status, Long authId);
|
|
|
+
|
|
|
+ @Query(nativeQuery = true, value = "select collection_invitor" +
|
|
|
+ " from user" +
|
|
|
+ " where collection_id = ?1" +
|
|
|
+ " group by collection_invitor" +
|
|
|
+ " having count(id) >= ?2")
|
|
|
+ List<Long> findAllByCollectionId(Long collectionId, int size);
|
|
|
+
|
|
|
+ @Transactional
|
|
|
+ @Modifying
|
|
|
+ @Query("update User set vipPoint = 1 where vipPoint = 0 and id in ?1")
|
|
|
+ void updateAllByInvitor(Collection<Long> ids);
|
|
|
}
|