Skip to content

Commit

Permalink
✨ 2019,Happy New Year!
Browse files Browse the repository at this point in the history
  • Loading branch information
ruibaby committed Dec 31, 2018
1 parent 885a6d1 commit af91bc3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/main/java/cc/ryanc/halo/repository/LogsRepository.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ public interface LogsRepository extends JpaRepository<Logs, Long> {
*
* @return List
*/
@Query(value = "SELECT * FROM halo_logs ORDER BY log_created DESC LIMIT 5", nativeQuery = true)
@Query(value = "SELECT * FROM HALO_LOGS ORDER BY LOG_CREATED DESC LIMIT 5", nativeQuery = true)
List<Logs> findTopFive();
}
10 changes: 5 additions & 5 deletions src/main/java/cc/ryanc/halo/repository/PostRepository.java
Original file line number Diff line number Diff line change
Expand Up @@ -119,15 +119,15 @@ public interface PostRepository extends JpaRepository<Post, Long> {
*
* @return List
*/
@Query(value = "select year(post_date) as year,month(post_date) as month,count(*) as count from halo_post where post_status=0 and post_type='post' group by year(post_date),month(post_date) order by year desc,month desc", nativeQuery = true)
@Query(value = "SELECT YEAR(POST_DATE) AS YEAR,MONTH(POST_DATE) AS MONTH,COUNT(*) AS COUNT FROM HALO_POST WHERE POST_STATUS=0 and POST_TYPE='post' GROUP BY YEAR(post_date),MONTH(POST_DATE) ORDER BY YEAR DESC,MONTH DESC", nativeQuery = true)
List<Object[]> findPostGroupByYearAndMonth();

/**
* 查询文章归档信息 根据年份
*
* @return List
*/
@Query(value = "select year(post_date) as year,count(*) as count from halo_post where post_status=0 and post_type='post' group by year(post_date) order by year desc", nativeQuery = true)
@Query(value = "SELECT YEAR(POST_DATE) AS YEAR,COUNT(*) AS COUNT FROM HALO_POST WHERE POST_STATUS=0 AND POST_TYPE='post' GROUP BY YEAR(POST_DATE) ORDER BY YEAR DESC", nativeQuery = true)
List<Object[]> findPostGroupByYear();

/**
Expand All @@ -137,7 +137,7 @@ public interface PostRepository extends JpaRepository<Post, Long> {
* @param month month
* @return List
*/
@Query(value = "select *,year(post_date) as year,month(post_date) as month from halo_post where post_status=0 and post_type='post' and year(post_date)=:year and month(post_date)=:month order by post_date desc", nativeQuery = true)
@Query(value = "SELECT *,YEAR(POST_DATE) AS YEAR,MONTH(POST_DATE) AS MONTH FROM HALO_POST WHERE POST_STATUS=0 and POST_TYPE='post' AND YEAR(POST_DATE)=:year AND MONTH(POST_DATE)=:month ORDER BY POST_DATE DESC", nativeQuery = true)
List<Post> findPostByYearAndMonth(@Param("year") String year, @Param("month") String month);

/**
Expand All @@ -146,7 +146,7 @@ public interface PostRepository extends JpaRepository<Post, Long> {
* @param year year
* @return List
*/
@Query(value = "select *,year(post_date) as year from halo_post where post_status=0 and post_type='post' and year(post_date)=:year order by post_date desc", nativeQuery = true)
@Query(value = "SELECT *,YEAR(post_date) AS YEAR FROM HALO_POST WHERE POST_STATUS=0 AND POST_TYPE='post' AND YEAR(POST_DATE)=:year ORDER BY POST_DATE DESC", nativeQuery = true)
List<Post> findPostByYear(@Param("year") String year);

/**
Expand All @@ -157,7 +157,7 @@ public interface PostRepository extends JpaRepository<Post, Long> {
* @param pageable pageable
* @return Page
*/
@Query(value = "select * from halo_post where post_status=0 and post_type='post' and year(post_date)=:year and month(post_date)=:month order by post_date desc", countQuery = "select count(*) from halo_post where post_status=0 and year(post_date)=:year and month(post_date)=:month", nativeQuery = true)
@Query(value = "SELECT * FROM HALO_POST WHERE POST_STATUS=0 and POST_TYPE='post' AND YEAR(POST_DATE)=:year AND MONTH(POST_DATE)=:month ORDER BY POST_DATE DESC", countQuery = "SELECT COUNT(*) FROM HALO_POST WHERE POST_STATUS=0 AND YEAR(POST_DATE)=:year AND MONTH(POST_DATE)=:month", nativeQuery = true)
Page<Post> findPostByYearAndMonth(@Param("year") String year, @Param("month") String month, Pageable pageable);

/**
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/templates/admin/module/_footer.ftl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<footer class="main-footer">
<#-- 虽然Halo使用了宽松的GPL协议,但开发不易,希望您可以保留一下版权声明。笔芯~ -->
<div class="pull-right hidden-xs"><a target="_blank" href="https://github.com/ruibaby/halo/releases/tag/v0.2.2">0.2.2</a></div>
<div class="pull-right hidden-xs"><a target="_blank" href="https://github.com/ruibaby/halo/releases/tag/v0.3.0">0.3.0</a></div>
Thanks for using <strong><a data-pjax="true" href="/admin/halo">Halo</a>.</strong>
</footer>

0 comments on commit af91bc3

Please sign in to comment.