2019,Happy New Year!

pull/73/head v0.3.0
ruibaby 2019-01-01 00:05:51 +08:00
parent 885a6d146f
commit af91bc3150
3 changed files with 7 additions and 7 deletions

View File

@ -21,6 +21,6 @@ public interface LogsRepository extends JpaRepository<Logs, Long> {
* *
* @return List * @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(); List<Logs> findTopFive();
} }

View File

@ -119,7 +119,7 @@ public interface PostRepository extends JpaRepository<Post, Long> {
* *
* @return List * @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(); List<Object[]> findPostGroupByYearAndMonth();
/** /**
@ -127,7 +127,7 @@ public interface PostRepository extends JpaRepository<Post, Long> {
* *
* @return List * @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(); List<Object[]> findPostGroupByYear();
/** /**
@ -137,7 +137,7 @@ public interface PostRepository extends JpaRepository<Post, Long> {
* @param month month * @param month month
* @return List * @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); List<Post> findPostByYearAndMonth(@Param("year") String year, @Param("month") String month);
/** /**
@ -146,7 +146,7 @@ public interface PostRepository extends JpaRepository<Post, Long> {
* @param year year * @param year year
* @return List * @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); List<Post> findPostByYear(@Param("year") String year);
/** /**
@ -157,7 +157,7 @@ public interface PostRepository extends JpaRepository<Post, Long> {
* @param pageable pageable * @param pageable pageable
* @return Page * @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); Page<Post> findPostByYearAndMonth(@Param("year") String year, @Param("month") String month, Pageable pageable);
/** /**

View File

@ -1,5 +1,5 @@
<footer class="main-footer"> <footer class="main-footer">
<#-- 虽然Halo使用了宽松的GPL协议但开发不易希望您可以保留一下版权声明。笔芯~ --> <#-- 虽然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> Thanks for using <strong><a data-pjax="true" href="/admin/halo">Halo</a>.</strong>
</footer> </footer>