Commit 98a91803 authored by hanfeng's avatar hanfeng

修改新闻系列接口

parent 7bc73f87
...@@ -10,6 +10,7 @@ import tk.mybatis.mapper.annotation.KeySql; ...@@ -10,6 +10,7 @@ import tk.mybatis.mapper.annotation.KeySql;
import tk.mybatis.mapper.code.IdentityDialect; import tk.mybatis.mapper.code.IdentityDialect;
import javax.persistence.Column; import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.Id; import javax.persistence.Id;
import javax.persistence.Table; import javax.persistence.Table;
import java.util.Date; import java.util.Date;
...@@ -26,6 +27,7 @@ public class Article { ...@@ -26,6 +27,7 @@ public class Article {
@Id @Id
@KeySql(dialect = IdentityDialect.MYSQL) @KeySql(dialect = IdentityDialect.MYSQL)
// @GeneratedValue(generator = "JDBC")
private Integer id; private Integer id;
/** /**
* 标题 * 标题
......
...@@ -135,7 +135,7 @@ public class ArticleBiz extends BaseBiz<ArticleMapper, Article> { ...@@ -135,7 +135,7 @@ public class ArticleBiz extends BaseBiz<ArticleMapper, Article> {
Example exa = Example.builder(Article.class).where( Example exa = Example.builder(Article.class).where(
WeekendSqls.<Article>custom() WeekendSqls.<Article>custom()
.andEqualTo(Article::getIsDel,0) .andEqualTo(Article::getIsDel,0)
).build(); ).orderByAsc("weight").orderByDesc("addTime").build();
List<Article> articles = mapper.selectByExample(exa); List<Article> articles = mapper.selectByExample(exa);
return PageInfo.of(articles); return PageInfo.of(articles);
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<select id="getArticleList" resultType="com.xxfc.platform.uccn.entity.Article"> <select id="getArticleList" resultType="com.xxfc.platform.uccn.entity.Article">
select title,epitome,add_time,cover_image from article select title,epitome,add_time,cover_image from article
where is_del=0 and status=1 and (type=#{type} or type=0) order by weight DESC,add_time DESC where is_del=0 and status=1 and (type=#{type} or type=0) order by weight ASC ,add_time DESC
</select> </select>
</mapper> </mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment