master
ck 5 years ago
parent bd3bb75a8d
commit a709715328

@ -16,8 +16,7 @@ public interface ArticleMapper extends CommonMapper<Article> {
List<ArticleVo> 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<Category> getFirstCategory();
List<Category> getSecondCategory(@Param("firstCategory") Long firstCategory);

@ -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<ArticleVo> CategoryList = articleMapper.getArticleListByCondition(title,firstCategory,secondCategory,fileType,state);
List<ArticleVo> CategoryList = articleMapper.getArticleListByCondition(title,firstCategory,secondCategory,fileType);
JSONObject pageJson = PageUtils.page(CategoryList,pageNum,pageSize);
return pageJson;
}

@ -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)
<if test="title != null and title != ''">
and ar.title like #{title}
</if>
@ -33,9 +33,6 @@
<if test="fileType != null ">
and ar.file_type = #{fileType}
</if>
<if test="state != null ">
and ar.state = #{state}
</if>
ORDER BY is_recommend Desc
</select>

Loading…
Cancel
Save