Commit 98a91803 authored by hanfeng's avatar hanfeng

修改新闻系列接口

parent 7bc73f87
......@@ -10,6 +10,7 @@ import tk.mybatis.mapper.annotation.KeySql;
import tk.mybatis.mapper.code.IdentityDialect;
import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;
......@@ -26,6 +27,7 @@ public class Article {
@Id
@KeySql(dialect = IdentityDialect.MYSQL)
// @GeneratedValue(generator = "JDBC")
private Integer id;
/**
* 标题
......
......@@ -135,7 +135,7 @@ public class ArticleBiz extends BaseBiz<ArticleMapper, Article> {
Example exa = Example.builder(Article.class).where(
WeekendSqls.<Article>custom()
.andEqualTo(Article::getIsDel,0)
).build();
).orderByAsc("weight").orderByDesc("addTime").build();
List<Article> articles = mapper.selectByExample(exa);
return PageInfo.of(articles);
......
......@@ -5,7 +5,7 @@
<select id="getArticleList" resultType="com.xxfc.platform.uccn.entity.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>
</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