|
@@ -22,9 +22,11 @@ public interface NewsRepository extends JpaSpecificationExecutor<News>, JpaRepos
|
|
|
* @param taskName
|
|
|
* @return
|
|
|
*/
|
|
|
- @Query(value = "select c.id from jpress_content c where c.id in (\n" +
|
|
|
- "\tselect m.content_id from jpress_mapping m where m.taxonomy_id in (\n" +
|
|
|
- "\t\tselect t.id from jpress_taxonomy t where t.slug= :name ))\n",nativeQuery = true)
|
|
|
+ @Query(value = "select c.id from\n" +
|
|
|
+ "jpress_content c \n" +
|
|
|
+ "join jpress_mapping m on c.id = m.content_id \n" +
|
|
|
+ "join jpress_taxonomy t on m.taxonomy_id = t.id \n" +
|
|
|
+ "where 1=1 and t.slug= :name ",nativeQuery = true)
|
|
|
@QueryHints({@QueryHint(name = "org.hibernate.cacheable", value ="true")})
|
|
|
List<Long> findNewsIdByTaxonomySlug (@Param("name")String taskName);
|
|
|
}
|