inleft
2022-08-22 1e152bbcfb357073d8bcf0b51fe701e3fb81540d
snowy-main/src/main/java/vip/xiaonuo/modular/blogarticle/mapper/mapping/BlogArticleMapper.xml
@@ -23,6 +23,9 @@
       a.publish_date,
       a.is_top,
       a.editor_status,
       a.is_allowed_comment,
       a.jump_url as jumpURL,
       a.update_date,
       a.create_date
    </sql>
@@ -30,13 +33,27 @@
        <trim prefix="WHERE" prefixOverrides="AND | OR">
            a.is_enable=1
            and a.editor_status=1
            and a.publish_date &lt; 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
                    order by a.is_top desc,a.top_value asc , a.update_date desc
                </otherwise>
            </choose>
        </trim>
@@ -46,7 +63,7 @@
    <select id="searchList" resultType="vip.xiaonuo.modular.blogarticle.entity.BlogArticleVo">
        select
        <include refid="Base_Column_List"/>
        ,IFNULL("",CONCAT("/",f2.file_bucket,"/",f2.file_object_name)) as coverFileURL
        ,IF(a.cover_file_id is not null,CONCAT("/",f2.file_bucket,"/",f2.file_object_name),"") as coverFileURL
        ,t.type_name as articleTypeName
        from
        blog_article a
@@ -61,8 +78,6 @@
        on f2.id=a.cover_file_id
        <include refid="queryListCondition"/>
        order by a.is_top desc,a.top_value asc , a.create_date desc
        limit #{param.pageNo},#{param.pageSize}
    </select>
@@ -79,7 +94,7 @@
    <select id="searchMonthCount" resultType="vip.xiaonuo.modular.blogStatistics.vo.BlogArchiveDetailVo">
       SELECT
       separate_month AS `month`,
       count(1) AS count
       count(1) AS `count`
        FROM
           blog_article
        WHERE
@@ -87,6 +102,7 @@
              is_enable = 1
              AND editor_status = 1
              AND separate_year = #{separateYear}
              AND publish_date &lt; now()
           )
        GROUP BY
           separate_month
@@ -94,4 +110,13 @@
    </select>
    <select id="getAdjoiningRecord"  resultType="vip.xiaonuo.modular.blogarticle.entity.BlogArticleVo">
        select
        a.id,
        a.title
        from
        blog_article a
        <include refid="queryListCondition"/>
        limit #{param.pageNo},#{param.pageSize}
    </select>
</mapper>