linwei
2024-01-22 f931e57bb56817895789afe9dfbb0dc4f856814f
文章评论查询优化
2 files modified
10 ■■■■ changed files
src/main/java/org/springblade/modules/article/mapper/ArticleCommentMapper.java 5 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/article/mapper/ArticleCommentMapper.xml 5 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/article/mapper/ArticleCommentMapper.java
@@ -1,8 +1,11 @@
package org.springblade.modules.article.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Param;
import org.springblade.modules.article.entity.ArticleCommentEntity;
import org.springblade.modules.article.vo.ArticleCommentVO;
import java.util.List;
/**
@@ -20,7 +23,7 @@
     * @param noticeComment
     * @return
     */
    List<ArticleCommentVO> selectArticleCommentPage(IPage page, ArticleCommentVO noticeComment);
    List<ArticleCommentVO> selectArticleCommentPage(IPage page, @Param("noticeComment") ArticleCommentVO noticeComment);
}
src/main/java/org/springblade/modules/article/mapper/ArticleCommentMapper.xml
@@ -85,9 +85,10 @@
            <if test="noticeComment.name != null ">and bu.name like concat('%',#{noticeComment.name},'%')</if>
            <if test="noticeComment.title != null ">and ja.title like concat('%',#{noticeComment.title},'%')</if>
            <if test="noticeComment.cityCode != null and noticeComment.cityCode != ''">
            <if test="noticeComment.cityCodeList != null and noticeComment.cityCodeList.size() > 0">
                and ( ja.article_range like
                <foreach collection="noticeComment.cityCode" separator=" or ja.article_range like" item="id">'%${id}%'
                <foreach collection="noticeComment.cityCodeList" separator=" or ja.article_range like" item="id">
                    '%${id}%'
                </foreach>
                )
            </if>