From a709715328ac4f8f7a3b2c36dbcc6df8b4d0ac6d Mon Sep 17 00:00:00 2001 From: ck <851316342@qq.com> Date: Thu, 8 Apr 2021 14:28:40 +0800 Subject: [PATCH] up --- src/main/java/com/jingcheng/cms/mapper/ArticleMapper.java | 3 +-- .../com/jingcheng/cms/service/impl/ArticleSerivceImpl.java | 3 +-- src/main/resources/mapper/ArticleMapper.xml | 5 +---- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/jingcheng/cms/mapper/ArticleMapper.java b/src/main/java/com/jingcheng/cms/mapper/ArticleMapper.java index 40935f1..f7191e1 100644 --- a/src/main/java/com/jingcheng/cms/mapper/ArticleMapper.java +++ b/src/main/java/com/jingcheng/cms/mapper/ArticleMapper.java @@ -16,8 +16,7 @@ public interface ArticleMapper extends CommonMapper
{ List getArticleListByCondition(@Param("title") String title, @Param("firstCategory") Long firstCategory, @Param("secondCategory") Long secondCategory, - @Param("fileType") Integer fileType, - @Param("state") Integer state); + @Param("fileType") Integer fileType); List getFirstCategory(); List getSecondCategory(@Param("firstCategory") Long firstCategory); diff --git a/src/main/java/com/jingcheng/cms/service/impl/ArticleSerivceImpl.java b/src/main/java/com/jingcheng/cms/service/impl/ArticleSerivceImpl.java index 6cd28df..d438b16 100644 --- a/src/main/java/com/jingcheng/cms/service/impl/ArticleSerivceImpl.java +++ b/src/main/java/com/jingcheng/cms/service/impl/ArticleSerivceImpl.java @@ -127,8 +127,7 @@ public class ArticleSerivceImpl implements ArticleSerive { Long firstCategory = jsonObject.getLong("firstCategory"); Long secondCategory = jsonObject.getLong("secondCategory"); Integer fileType = jsonObject.getInteger("fileType"); - Integer state = jsonObject.getInteger("state") == null ? 1 : jsonObject.getInteger("state"); - List CategoryList = articleMapper.getArticleListByCondition(title,firstCategory,secondCategory,fileType,state); + List CategoryList = articleMapper.getArticleListByCondition(title,firstCategory,secondCategory,fileType); JSONObject pageJson = PageUtils.page(CategoryList,pageNum,pageSize); return pageJson; } diff --git a/src/main/resources/mapper/ArticleMapper.xml b/src/main/resources/mapper/ArticleMapper.xml index 98720df..a2d20c8 100644 --- a/src/main/resources/mapper/ArticleMapper.xml +++ b/src/main/resources/mapper/ArticleMapper.xml @@ -20,7 +20,7 @@ on ar.second_category = c2.id and c2.level = 2 where - 1 = 1 + 1 = 1 and (ar.state = 1 OR ar.state = 2) and ar.title like #{title} @@ -33,9 +33,6 @@ and ar.file_type = #{fileType} - - and ar.state = #{state} - ORDER BY is_recommend Desc