|
@@ -11,38 +11,38 @@ import javax.transaction.Transactional;
|
|
|
public interface TagRepo extends JpaRepository<Tag, Long>, JpaSpecificationExecutor<Tag> {
|
|
public interface TagRepo extends JpaRepository<Tag, Long>, JpaSpecificationExecutor<Tag> {
|
|
|
|
|
|
|
|
@Query(nativeQuery = true, value = "insert into asset_tag (asset_id, tag_id) " +
|
|
@Query(nativeQuery = true, value = "insert into asset_tag (asset_id, tag_id) " +
|
|
|
- "select id, ?1 from asset where name like ?2")
|
|
|
|
|
|
|
+ "select id, ?1 from asset where name like ?2 and company_id = ?3")
|
|
|
@Transactional
|
|
@Transactional
|
|
|
@Modifying
|
|
@Modifying
|
|
|
- int addTagForAssetEasy(Long id, String pattern);
|
|
|
|
|
|
|
+ int addTagForAssetEasy(Long id, String pattern, Long companyId);
|
|
|
|
|
|
|
|
@Query(nativeQuery = true, value = "insert into collection_tag (collection_id, tag_id) " +
|
|
@Query(nativeQuery = true, value = "insert into collection_tag (collection_id, tag_id) " +
|
|
|
- "select id, ?1 from collection_info where name like ?2")
|
|
|
|
|
|
|
+ "select id, ?1 from collection_info where name like ?2 and company_id = ?3")
|
|
|
@Transactional
|
|
@Transactional
|
|
|
@Modifying
|
|
@Modifying
|
|
|
- int addTagForCollectionEasy(Long id, String pattern);
|
|
|
|
|
|
|
+ int addTagForCollectionEasy(Long id, String pattern , Long companyId);
|
|
|
|
|
|
|
|
@Query(nativeQuery = true, value = "insert into asset_tag (asset_id, tag_id) " +
|
|
@Query(nativeQuery = true, value = "insert into asset_tag (asset_id, tag_id) " +
|
|
|
- "select id, ?1 from asset where name regexp ?2")
|
|
|
|
|
|
|
+ "select id, ?1 from asset where name regexp ?2 and company_id = ?3")
|
|
|
@Transactional
|
|
@Transactional
|
|
|
@Modifying
|
|
@Modifying
|
|
|
- int addTagForAssetRegex(Long id, String pattern);
|
|
|
|
|
|
|
+ int addTagForAssetRegex(Long id, String pattern , Long companyId);
|
|
|
|
|
|
|
|
@Query(nativeQuery = true, value = "insert into collection_tag (collection_id, tag_id) " +
|
|
@Query(nativeQuery = true, value = "insert into collection_tag (collection_id, tag_id) " +
|
|
|
- "select id, ?1 from collection_info where name regexp ?2")
|
|
|
|
|
|
|
+ "select id, ?1 from collection_info where name regexp ?2 and company_id = ?3")
|
|
|
@Transactional
|
|
@Transactional
|
|
|
@Modifying
|
|
@Modifying
|
|
|
- int addTagForCollectionRegex(Long id, String pattern);
|
|
|
|
|
|
|
+ int addTagForCollectionRegex(Long id, String pattern , Long companyId);
|
|
|
|
|
|
|
|
- @Query(nativeQuery = true, value = "select count(id) from asset where name like ?1")
|
|
|
|
|
- long countAssetEasy(String pattern);
|
|
|
|
|
|
|
+ @Query(nativeQuery = true, value = "select count(id) from asset where name like ?1 and company_id = ?2")
|
|
|
|
|
+ long countAssetEasy(String pattern, Long companyId);
|
|
|
|
|
|
|
|
- @Query(nativeQuery = true, value = "select count(id) from collection_info where name like ?1")
|
|
|
|
|
- long countCollectionEasy(String pattern);
|
|
|
|
|
|
|
+ @Query(nativeQuery = true, value = "select count(id) from collection_info where name like ?1 and company_id = ?2")
|
|
|
|
|
+ long countCollectionEasy(String pattern, Long companyId);
|
|
|
|
|
|
|
|
- @Query(nativeQuery = true, value = "select count(id) from asset where name regexp ?1")
|
|
|
|
|
- long countAssetRegex(String pattern);
|
|
|
|
|
|
|
+ @Query(nativeQuery = true, value = "select count(id) from asset where name regexp ?1 and company_id = ?2")
|
|
|
|
|
+ long countAssetRegex(String pattern, Long companyId);
|
|
|
|
|
|
|
|
- @Query(nativeQuery = true, value = "select count(id) from collection_info where name regexp ?1")
|
|
|
|
|
- long countCollectionRegex(String pattern);
|
|
|
|
|
|
|
+ @Query(nativeQuery = true, value = "select count(id) from collection_info where name regexp ?1 and company_id = ?2")
|
|
|
|
|
+ long countCollectionRegex(String pattern, Long companyId);
|
|
|
}
|
|
}
|