From eaf26c265f8882b2e100428d942ac377330cc114 Mon Sep 17 00:00:00 2001 From: inleft <inleft@qq.com> Date: Thu, 04 Aug 2022 18:47:07 +0800 Subject: [PATCH] 新增:消息盒子功能 --- snowy-main/src/main/java/vip/xiaonuo/modular/blogarticle/mapper/mapping/BlogArticleMapper.xml | 95 +++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 95 insertions(+), 0 deletions(-) diff --git a/snowy-main/src/main/java/vip/xiaonuo/modular/blogarticle/mapper/mapping/BlogArticleMapper.xml b/snowy-main/src/main/java/vip/xiaonuo/modular/blogarticle/mapper/mapping/BlogArticleMapper.xml index ad494aa..2f17529 100644 --- a/snowy-main/src/main/java/vip/xiaonuo/modular/blogarticle/mapper/mapping/BlogArticleMapper.xml +++ b/snowy-main/src/main/java/vip/xiaonuo/modular/blogarticle/mapper/mapping/BlogArticleMapper.xml @@ -2,4 +2,99 @@ <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="vip.xiaonuo.modular.blogarticle.mapper.BlogArticleMapper"> + + <!-- 通用查询结果列 --> + <sql id="Base_Column"> + id,title,article_file_id,article_file_type, + article_type_id,introduce,cover_file_id,last_editor_date,publish_date, + is_top,top_value,auth_status,auth_password,editor_status, + separate_year,separate_month,separate_day,is_enable,update_date,create_date + </sql> + + <sql id="Base_Column_List"> + a.id, + a.title, + a.article_file_type, + a.article_type_id, + a.introduce, + a.cover_file_id, + a.auth_status, + a.last_editor_date, + 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.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="searchList" resultType="vip.xiaonuo.modular.blogarticle.entity.BlogArticleVo"> + select + <include refid="Base_Column_List"/> + ,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 + on t.id =a.article_type_id + + left join sys_file_info f1 + on f1.id=a.article_file_id + + + left join sys_file_info f2 + on f2.id=a.cover_file_id + + <include refid="queryListCondition"/> + + limit #{param.pageNo},#{param.pageSize} + </select> + + <select id="searchListCount" resultType="java.lang.Long"> + select + count(0) + from + blog_article a + <include refid="queryListCondition"/> + + </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> -- Gitblit v1.9.1