|
|
@@ -122,5 +122,10 @@ public interface AssetRepo extends JpaRepository<Asset, Long>, JpaSpecificationE
|
|
|
"where asset.user_id = ?1 and asset_tag.tag_id in ?2 group by tag_id", nativeQuery = true)
|
|
|
long checkHoldingTags(Long userId, List<Long> tagIds);
|
|
|
|
|
|
- List<Asset> findByUserIdAndStatusAndTagsIdIn(Long userId, AssetStatus status, List<Long> tagIds);
|
|
|
+ @Query(value = "select asset.* from asset left join asset_tag on asset.id = asset_tag.asset_id " +
|
|
|
+ "where asset_tag.tag_id in ?2 " +
|
|
|
+ "and asset.user_id = ?1 " +
|
|
|
+ "and asset.status = 'NORMAL' " +
|
|
|
+ "group by asset.id",nativeQuery = true)
|
|
|
+ List<Asset> findByTagsContain(Long userId, List<Long> tagIds);
|
|
|
}
|