Antiloveg 8 years ago
parent
commit
9aa9389ff1

+ 3 - 2
src/main/java/com/goafanti/common/mapper/NewsMapper.xml

@@ -204,7 +204,8 @@
   		author,
   		author,
   		type,
   		type,
   		hot,
   		hot,
-  		source
+  		source,
+  		summary,
   	from news
   	from news
   	where 1 =1
   	where 1 =1
   	<if test="type != null">
   	<if test="type != null">
@@ -228,7 +229,7 @@
   	<if test="hot != null">
   	<if test="hot != null">
   		and hot = #{hot,jdbcType=INTEGER}
   		and hot = #{hot,jdbcType=INTEGER}
   	</if>
   	</if>
-  	order by edit_time desc
+  	order by create_time desc
   	<if test="page_sql!=null">
   	<if test="page_sql!=null">
 			${page_sql}
 			${page_sql}
 	</if>
 	</if>

+ 1 - 1
src/main/java/com/goafanti/common/mapper/NewsMapperExt.xml

@@ -17,7 +17,7 @@
 		select
 		select
 		<include refid="Summary_Column_List" />
 		<include refid="Summary_Column_List" />
 		from news
 		from news
-		where 1=1 
+		where hot = 1 
 		<if test=" type != null">
 		<if test=" type != null">
 			and type = #{type,jdbcType=INTEGER}
 			and type = #{type,jdbcType=INTEGER}
 		</if>
 		</if>

+ 1 - 1
src/main/java/com/goafanti/news/service/NewsService.java

@@ -73,7 +73,7 @@ public class NewsService extends BaseMybatisDao<NewsMapper> {
 	public Pagination<News> listNews(Integer type, String title, String author, String startCreateTime,
 	public Pagination<News> listNews(Integer type, String title, String author, String startCreateTime,
 			String endCreateTime, String source, Integer hot, Integer pNo, Integer pSize) {
 			String endCreateTime, String source, Integer hot, Integer pNo, Integer pSize) {
 		Map<String, Object> params = new HashMap<>();
 		Map<String, Object> params = new HashMap<>();
-		if (null == type) {
+		if (null != type) {
 			params.put("type", type);
 			params.put("type", type);
 		}
 		}