From f496348f4db9a64f741cd0947b3d02267887d3e9 Mon Sep 17 00:00:00 2001 From: cuibaocheng Date: Tue, 23 Jun 2020 19:11:13 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B1=95=E8=A7=88=E7=B3=BB=E7=BB=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../articlecontent/IArticleContentDao.java | 10 +++ .../IArticleContentService.java | 10 +++ .../impl/ArticleContentServiceImpl.java | 5 ++ .../articlecontent/articlecontent-mapper.xml | 66 ++++++++++++++++++- 4 files changed, 90 insertions(+), 1 deletion(-) diff --git a/cloud-common-article/src/main/java/com/cm/common/article/dao/articlecontent/IArticleContentDao.java b/cloud-common-article/src/main/java/com/cm/common/article/dao/articlecontent/IArticleContentDao.java index dad894e..a86d561 100644 --- a/cloud-common-article/src/main/java/com/cm/common/article/dao/articlecontent/IArticleContentDao.java +++ b/cloud-common-article/src/main/java/com/cm/common/article/dao/articlecontent/IArticleContentDao.java @@ -70,4 +70,14 @@ public interface IArticleContentDao { * @throws SearchException */ Integer countArticleCount(Map params) throws SearchException; + + /** + * 文章内容列表 + * + * @param params + * @return + * @throws SearchException + */ + List listArticleContentAll(Map params) throws SearchException; + } diff --git a/cloud-common-article/src/main/java/com/cm/common/article/service/articlecontent/IArticleContentService.java b/cloud-common-article/src/main/java/com/cm/common/article/service/articlecontent/IArticleContentService.java index 0dac3e2..74c6018 100644 --- a/cloud-common-article/src/main/java/com/cm/common/article/service/articlecontent/IArticleContentService.java +++ b/cloud-common-article/src/main/java/com/cm/common/article/service/articlecontent/IArticleContentService.java @@ -126,4 +126,14 @@ public interface IArticleContentService { * @throws SearchException */ SuccessResultData countArticleCount(Map params) throws SearchException; + + /** + * 文章内容列表 + * + * @param params + * @return + * @throws SearchException + */ + List listArticleContentAll(Map params) throws SearchException; + } diff --git a/cloud-common-article/src/main/java/com/cm/common/article/service/articlecontent/impl/ArticleContentServiceImpl.java b/cloud-common-article/src/main/java/com/cm/common/article/service/articlecontent/impl/ArticleContentServiceImpl.java index e2170ee..efb39e2 100644 --- a/cloud-common-article/src/main/java/com/cm/common/article/service/articlecontent/impl/ArticleContentServiceImpl.java +++ b/cloud-common-article/src/main/java/com/cm/common/article/service/articlecontent/impl/ArticleContentServiceImpl.java @@ -160,4 +160,9 @@ public class ArticleContentServiceImpl extends AbstractService implements IArtic Integer countArticleCount = articleContentDao.countArticleCount(params); return new SuccessResultData<>(countArticleCount == null ? 0 : countArticleCount); } + + @Override + public List listArticleContentAll(Map params) throws SearchException { + return articleContentDao.listArticleContentAll(params); + } } diff --git a/cloud-common-article/src/main/resources/mybatis/mapper/articlecontent/articlecontent-mapper.xml b/cloud-common-article/src/main/resources/mybatis/mapper/articlecontent/articlecontent-mapper.xml index becab4c..56ba3ac 100644 --- a/cloud-common-article/src/main/resources/mybatis/mapper/articlecontent/articlecontent-mapper.xml +++ b/cloud-common-article/src/main/resources/mybatis/mapper/articlecontent/articlecontent-mapper.xml @@ -19,6 +19,69 @@ + + + INSERT INTO article_content( @@ -168,7 +231,7 @@ t1.is_delete = 0 AND - t1.title LIKE CONCAT('%s', #{keywords}, '%') + t1.title LIKE CONCAT('%', #{keywords}, '%') AND @@ -200,6 +263,7 @@ #{creators[${index}]} + ORDER BY t1.publish_date DESC