|
@@ -6,9 +6,11 @@ import org.springframework.data.domain.Pageable;
|
|
|
import org.springframework.data.jpa.domain.Specification;
|
|
|
import org.springframework.data.jpa.repository.JpaRepository;
|
|
|
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
|
|
+import org.springframework.data.jpa.repository.Modifying;
|
|
|
import org.springframework.data.jpa.repository.Query;
|
|
|
import org.springframework.data.repository.CrudRepository;
|
|
|
import org.springframework.data.repository.PagingAndSortingRepository;
|
|
|
+import org.springframework.data.repository.query.Param;
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
@@ -27,4 +29,7 @@ public interface TechnicalArticlesDao extends PagingAndSortingRepository<Technic
|
|
|
@Query(nativeQuery = true, value = "select * from technical_articles order by TA_READING DESC")
|
|
|
List<TechnicalArticlesPO> findReading(Pageable pageable);
|
|
|
|
|
|
+ @Modifying
|
|
|
+ @Query(nativeQuery = true,value="update technical_articles set TA_READING=TA_READING+1 where TA_ID=?")
|
|
|
+ int updateReading(@Param("id") long id);
|
|
|
}
|