Browse Source

文章列表页面排序bug

xusonglin 4 years ago
parent
commit
2c5e45ff8d

+ 6 - 6
tianti-cms/src/main/java/com/jeff/tianti/cms/dao/ArticleDaoImpl.java

@@ -15,7 +15,7 @@ import com.jeff.tianti.common.dao.CustomBaseSqlDaoImpl;
 import com.jeff.tianti.common.entity.PageModel;
 /**
  * @author xujianfang
- * @desc ArticleDaoImpl类 
+ * @desc ArticleDaoImpl类
  * @date 2017-03-16
  */
 
@@ -29,7 +29,7 @@ public class ArticleDaoImpl extends CustomBaseSqlDaoImpl implements ArticleDaoCu
          if(articleQueryDTO != null){
         	 if(StringUtils.isNotBlank(articleQueryDTO.getRootColumnId())){
         		 hql.append(" and t.rootColumnInfo.id = :rootColumnId ");
-        		 map.put("rootColumnId", articleQueryDTO.getRootColumnId());        		 
+        		 map.put("rootColumnId", articleQueryDTO.getRootColumnId());
         	 }
         	 if(StringUtils.isNotBlank(articleQueryDTO.getColumnId())){
         		 hql.append(" and t.columnInfo.id = :columnId ");
@@ -75,8 +75,8 @@ public class ArticleDaoImpl extends CustomBaseSqlDaoImpl implements ArticleDaoCu
             		 }else if(articleQueryDTO.getType().equals("zhiding")){
             			 hql.append(" and t.isTop =1 ");
             		 }
-                     hql.append(" order by t.createDate desc ");
             	 }
+				 hql.append(" order by t.createDate desc ");
         	 }
          }
          return this.queryForPageWithParams(hql.toString(),map,articleQueryDTO.getCurrentPage(),articleQueryDTO.getPageSize());
@@ -136,12 +136,12 @@ public class ArticleDaoImpl extends CustomBaseSqlDaoImpl implements ArticleDaoCu
          }
          return articleList;
     }
-    
+
     public List<Map<String, Object>> queryStatisMapList(ArticleQueryDTO articleQueryDTO){
     	String sql = " select count(1) as totalCount,(select count(1) from cms_article where is_top=1 and delete_flag = '0') as zhidingCount,(select count(1) from cms_article where is_audit=1 and delete_flag = '0') as shenheCount,(select count(1) from cms_article where delete_flag='1') as deleteCount from cms_article a  ";
     	return this.querySqlObjects(sql);
     }
-    
+
     public List<Article> queryNextArticleList(CurrentArticleInfoDTO currentArticleInfoDTO){
     	Map<String,Object> map = new HashMap<String,Object>();
     	StringBuilder hql = new StringBuilder();
@@ -165,7 +165,7 @@ public class ArticleDaoImpl extends CustomBaseSqlDaoImpl implements ArticleDaoCu
     	}
     	return this.queryByMapParams(hql.toString(), map);
     }
-    
+
     public List<Article> queryPreArticleList(CurrentArticleInfoDTO currentArticleInfoDTO){
     	Map<String,Object> map = new HashMap<String,Object>();
     	StringBuilder hql = new StringBuilder();