모의투자 관리 기능 추가
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
package com.goldenchart.repository;
|
||||
|
||||
import com.goldenchart.entity.GcPaperCashLedger;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
public interface GcPaperCashLedgerRepository extends JpaRepository<GcPaperCashLedger, Long> {
|
||||
Page<GcPaperCashLedger> findByAccountIdAndCreatedAtBetweenOrderByCreatedAtDesc(
|
||||
Long accountId, LocalDateTime from, LocalDateTime to, Pageable pageable);
|
||||
|
||||
Page<GcPaperCashLedger> findByAccountIdOrderByCreatedAtDesc(Long accountId, Pageable pageable);
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.goldenchart.repository;
|
||||
|
||||
import com.goldenchart.entity.GcPaperDailySnapshot;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
public interface GcPaperDailySnapshotRepository extends JpaRepository<GcPaperDailySnapshot, Long> {
|
||||
List<GcPaperDailySnapshot> findByAccountIdAndSnapshotDateBetweenOrderBySnapshotDateAsc(
|
||||
Long accountId, LocalDate from, LocalDate to);
|
||||
|
||||
Optional<GcPaperDailySnapshot> findByAccountIdAndSnapshotDate(Long accountId, LocalDate date);
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.goldenchart.repository;
|
||||
|
||||
import com.goldenchart.entity.GcPaperOrder;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface GcPaperOrderRepository extends JpaRepository<GcPaperOrder, Long> {
|
||||
List<GcPaperOrder> findByAccountIdAndStatusOrderByCreatedAtDesc(Long accountId, String status);
|
||||
List<GcPaperOrder> findByStatusAndSymbol(String status, String symbol);
|
||||
List<GcPaperOrder> findByStatus(String status);
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.goldenchart.repository;
|
||||
|
||||
import com.goldenchart.entity.GcPaperResetLog;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
public interface GcPaperResetLogRepository extends JpaRepository<GcPaperResetLog, Long> {
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
package com.goldenchart.repository;
|
||||
|
||||
import com.goldenchart.entity.GcPaperSymbolAllocation;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
public interface GcPaperSymbolAllocationRepository extends JpaRepository<GcPaperSymbolAllocation, Long> {
|
||||
List<GcPaperSymbolAllocation> findByAccountIdOrderBySortOrderAscSymbolAsc(Long accountId);
|
||||
Optional<GcPaperSymbolAllocation> findByAccountIdAndSymbol(Long accountId, String symbol);
|
||||
void deleteByAccountId(Long accountId);
|
||||
}
|
||||
@@ -1,10 +1,33 @@
|
||||
package com.goldenchart.repository;
|
||||
|
||||
import com.goldenchart.entity.GcPaperTrade;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
import org.springframework.data.repository.query.Param;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
public interface GcPaperTradeRepository extends JpaRepository<GcPaperTrade, Long> {
|
||||
List<GcPaperTrade> findTop100ByAccountIdOrderByCreatedAtDesc(Long accountId);
|
||||
|
||||
@Query("""
|
||||
SELECT t FROM GcPaperTrade t WHERE t.accountId = :accountId
|
||||
AND (:symbol IS NULL OR t.symbol = :symbol)
|
||||
AND (:side IS NULL OR t.side = :side)
|
||||
AND (:source IS NULL OR t.source = :source)
|
||||
AND (:from IS NULL OR t.createdAt >= :from)
|
||||
AND (:to IS NULL OR t.createdAt <= :to)
|
||||
ORDER BY t.createdAt DESC
|
||||
""")
|
||||
Page<GcPaperTrade> findFiltered(
|
||||
@Param("accountId") Long accountId,
|
||||
@Param("symbol") String symbol,
|
||||
@Param("side") String side,
|
||||
@Param("source") String source,
|
||||
@Param("from") LocalDateTime from,
|
||||
@Param("to") LocalDateTime to,
|
||||
Pageable pageable);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user