inleft
2022-08-04 eaf26c265f8882b2e100428d942ac377330cc114
snowy-main/src/main/java/vip/xiaonuo/modular/blogarticle/mapper/mapping/BlogArticleMapper.xml
@@ -23,26 +23,39 @@
       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>
    <sql id="queryListCondition">
        <trim prefix="WHERE" prefixOverrides="AND | OR">
            a.is_enable=1
            and a.auth_status=1
            and a.editor_status=1
            <choose>
                <when test="param.typeId != null">
                    AND a.article_type_id = #{param.typeId}
                    order by a.is_top desc,a.top_value asc , a.create_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>
    </sql>
    <select id="searchMediaList" resultType="vip.xiaonuo.modular.blogarticle.param.BlogArticleVo">
    <select id="searchList" resultType="vip.xiaonuo.modular.blogarticle.entity.BlogArticleVo">
        select
        <include refid="Base_Column_List"/>
        ,CONCAT("/",f1.file_bucket,"/",f1.file_object_name) as articleFileURL
        ,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
        inner join blog_article_type  t
        inner join blog_article_type t
        on t.id =a.article_type_id
        left join sys_file_info f1
@@ -54,12 +67,10 @@
        <include refid="queryListCondition"/>
        order by a.top_value asc , a.create_date desc
        limit #{param.pageNo},#{param.pageSize}
    </select>
    <select id="searchMediaListCount" resultType="java.lang.Long">
    <select id="searchListCount" resultType="java.lang.Long">
        select
        count(0)
        from
@@ -68,4 +79,22 @@
    </select>
    <select id="searchMonthCount" resultType="vip.xiaonuo.modular.blogStatistics.vo.BlogArchiveDetailVo">
       SELECT
       separate_month AS `month`,
       count(1) AS count
        FROM
           blog_article
        WHERE
           (
              is_enable = 1
              AND editor_status = 1
              AND separate_year = #{separateYear}
           )
        GROUP BY
           separate_month
        ORDER BY  separate_month desc
    </select>
</mapper>