inleft
2022-08-31 aae48957ba971ed0a1bfbfa182701cd22bbe8694
snowy-main/src/main/java/vip/xiaonuo/modular/blogarticle/mapper/mapping/BlogArticleMapper.xml
@@ -38,24 +38,19 @@
            and a.editor_status=1
            and a.publish_date < now()
            <choose>
                <!-- 月台查询用 -->
                <when test="param.fileType != null">
                    and a.article_file_type = #{param.fileType}
                </when>
                <!-- 指定排除 视频类在首页显示,但需要在分类栏目列表显示 -->
                <when test="param.fileType == null and param.typeId == null">
                    and a.article_file_type not in (3,4)
                </when>
            </choose>
            <choose>
                <when test="param.typeId != null">
                    AND a.article_type_id = #{param.typeId}
                    order by a.is_top desc,a.top_value asc , a.publish_date desc
                </when>
                <!-- 指定排除 笔记类在首页显示 -->
                <otherwise>
                    AND a.article_type_id != 4
                    <!-- 首页不出现视频等文件类型-->
                    <if test="param.faceExcludeFile != null">
                        and a.article_file_type not in
                        <foreach collection="param.faceExcludeFile" item="obj" separator="," open="(" close=")">
                            #{obj}
                        </foreach>
                    </if>
                    order by a.is_top desc,a.top_value asc , a.update_date desc
                </otherwise>
            </choose>
@@ -73,6 +68,11 @@
        blog_article a
        inner join blog_article_type t
        on t.id =a.article_type_id
        <!-- 排除首页不查询的分类-->
        <if test="param.typeId == null">
            and t.is_show_face = 1
        </if>
        left join sys_file_info f2
        on f2.id=a.cover_file_id
@@ -129,6 +129,10 @@
            and a.editor_status=1
            and a.publish_date &lt; now()
            <if test="param.id != null">
                and a.id = #{param.id}
            </if>
            <if test="param.fileType != null">
                and a.article_file_type = #{param.fileType}
            </if>