diff --git a/src/main/java/cn/teammodel/repository/ArtRepository.java b/src/main/java/cn/teammodel/repository/ArtRepository.java index b2552de..a2f767e 100644 --- a/src/main/java/cn/teammodel/repository/ArtRepository.java +++ b/src/main/java/cn/teammodel/repository/ArtRepository.java @@ -14,7 +14,7 @@ public interface ArtRepository extends CosmosRepository { /** * 动态投影, 查询还是要将所有的值查出来,类的动态查询不能嵌套 */ - @Query("select s.id,s.name,s.classes,s.startTime,s.endTime,s.subjects,s.progress,s.settings from Art as s where s.period.id = @periodId and s.code = @code " + + @Query("select s.id,s.name,s.classes,s.startTime,s.endTime,s.subjects,s.progress,s.settings from Art as s where s.progress = 'finish' and s.period.id = @periodId and s.code = @code " + "and (IS_NULL(@startTime) or s.startTime >= @startTime) " + "and (IS_NULL(@endTime) or s.startTime < @endTime) ") List findPeriodById(@Param("periodId")String periodId, @Param("code")String code, @Param("startTime")Long startTime, @Param("endTime")Long endTime);