xiongzhu 4 years ago
parent
commit
de932ce517
1 changed files with 4 additions and 1 deletions
  1. 4 1
      src/main/java/com/izouma/nineth/repo/AssetRepo.java

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

@@ -83,6 +83,9 @@ public interface AssetRepo extends JpaRepository<Asset, Long>, JpaSpecificationE
     @Query(value = "update Asset a set a.holdDays = ?2 where a.id = ?1")
     @Query(value = "update Asset a set a.holdDays = ?2 where a.id = ?1")
     void updateHoldDays(Long id, Integer holdDays);
     void updateHoldDays(Long id, Integer holdDays);
 
 
-    @Query("select a from Asset a join a.tags t on t.id = ?2 where a.userId = ?1")
+    @Query("select a from Asset a " +
+            "  join a.tags t on t.id = ?2 " +
+            "where a.userId = ?1 " +
+            "  and a.status = com.izouma.nineth.enums.AssetStatus.NORMAL")
     Page<Asset> byTag(Long userId, Long tagId, Pageable pageable);
     Page<Asset> byTag(Long userId, Long tagId, Pageable pageable);
 }
 }