feat: support article demo videos and category counts

This commit is contained in:
王鹏
2026-08-17 15:50:17 +08:00
parent 2bf0a6db59
commit a1a806f266
8 changed files with 101 additions and 8 deletions

View File

@@ -43,6 +43,14 @@ public class AppBlogArticle extends BaseEntity
/** List-card thumbnail URL (not persisted). */
private String showImgThumb;
/** 视频号演示视频feedId */
@Excel(name = "视频号演示视频ID")
private String videoFeedId;
/** 第二个视频号演示视频feedId */
@Excel(name = "视频号演示视频ID 2")
private String videoFeedId2;
/** 关联已有资源关联app_resource id */
@Excel(name = "关联已有资源", readConverterExp = "关=联app_resource,i=d")
private Long appResourceId;
@@ -171,6 +179,24 @@ public class AppBlogArticle extends BaseEntity
{
return showImgThumb;
}
public void setVideoFeedId(String videoFeedId)
{
this.videoFeedId = videoFeedId;
}
public String getVideoFeedId()
{
return videoFeedId;
}
public void setVideoFeedId2(String videoFeedId2)
{
this.videoFeedId2 = videoFeedId2;
}
public String getVideoFeedId2()
{
return videoFeedId2;
}
public void setAppResourceId(Long appResourceId)
{
this.appResourceId = appResourceId;
@@ -260,6 +286,8 @@ public class AppBlogArticle extends BaseEntity
.append("contentInfo", getContentInfo())
.append("articleType", getArticleType())
.append("showImg", getShowImg())
.append("videoFeedId", getVideoFeedId())
.append("videoFeedId2", getVideoFeedId2())
.append("appResourceId", getAppResourceId())
.append("lookNumber", getLookNumber())
.append("loveNumber", getLoveNumber())

View File

@@ -3,6 +3,8 @@ package com.ruoyi.app.mapper;
import java.util.List;
import com.ruoyi.app.domain.AppBlogArticle;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
/**
@@ -37,6 +39,10 @@ public interface AppBlogArticleMapper
*/
public List<AppBlogArticle> selectAppBlogArticleList(AppBlogArticle appBlogArticle);
/** 查询指定类型的可见文章数量 */
@Select("select count(*) from app_blog_article where article_type = #{articleType} and is_show = #{isShow}")
public Long countByArticleType(@Param("articleType") Long articleType, @Param("isShow") Long isShow);
/**
* 新增文章
*

View File

@@ -4,6 +4,7 @@ import java.util.List;
import com.ruoyi.app.domain.AppResource;
import com.ruoyi.app.domain.AppResourceList;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
/**
@@ -44,6 +45,10 @@ public interface AppResourceMapper
*/
public List<AppResource> selectAppResourceList(AppResource appResource);
/** 查询可见资源数量 */
@Select("select count(*) from app_resource where is_show = #{isShow}")
public Long countByIsShow(@Param("isShow") Long isShow);
/**
* 新增资源
*

View File

@@ -11,6 +11,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="articleType" column="article_type" />
<result property="keyword" column="keyword" />
<result property="showImg" column="show_img" />
<result property="videoFeedId" column="video_feed_id" />
<result property="videoFeedId2" column="video_feed_id_2" />
<result property="appResourceId" column="app_resource_id" />
<result property="lookNumber" column="look_number" />
<result property="loveNumber" column="love_number" />
@@ -46,12 +48,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectAppBlogArticleVo">
select id, title, content_info, article_type, keyword, show_img, app_resource_id, look_number, weight, love_number, is_recommendation, is_show, is_ad, ad_number, del_flag, create_by, create_time, remark from app_blog_article
select id, title, content_info, article_type, keyword, show_img, video_feed_id, video_feed_id_2, app_resource_id, look_number, weight, love_number, is_recommendation, is_show, is_ad, ad_number, del_flag, create_by, create_time, remark from app_blog_article
</sql>
<select id="selectAppBlogArticleList" parameterType="AppBlogArticle" resultMap="AppBlogArticleWithResourceResult">
select
a.id, a.title, a.content_info, a.article_type, a.keyword, a.show_img, a.app_resource_id,
a.id, a.title, a.content_info, a.article_type, a.keyword, a.show_img, a.video_feed_id, a.video_feed_id_2, a.app_resource_id,
a.look_number, a.weight, a.love_number, a.is_recommendation, a.is_show, a.is_ad,
a.ad_number, a.del_flag, a.create_by, a.create_time, a.remark,
r.id as resource_id,
@@ -83,6 +85,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where>
<choose>
<when test="orderType == 'look_number'"> ORDER BY a.look_number desc, a.create_time desc</when >
<when test="orderType == 'create_time'"> ORDER BY a.create_time desc, a.id desc</when>
<otherwise> ORDER BY a.weight desc, a.create_time desc</otherwise >
</choose>
</select>
@@ -106,6 +109,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="articleType != null">article_type,</if>
<if test="keyword != null and keyword != ''">keyword,</if>
<if test="showImg != null">show_img,</if>
<if test="videoFeedId != null">video_feed_id,</if>
<if test="videoFeedId2 != null">video_feed_id_2,</if>
<if test="appResourceId != null">app_resource_id,</if>
<if test="lookNumber != null">look_number,</if>
<if test="loveNumber != null">love_number,</if>
@@ -125,6 +130,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="articleType != null">#{articleType},</if>
<if test="keyword != null and keyword != ''">#{keyword},</if>
<if test="showImg != null">#{showImg},</if>
<if test="videoFeedId != null">#{videoFeedId},</if>
<if test="videoFeedId2 != null">#{videoFeedId2},</if>
<if test="appResourceId != null">#{appResourceId},</if>
<if test="lookNumber != null">#{lookNumber},</if>
<if test="loveNumber != null">#{loveNumber},</if>
@@ -148,6 +155,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="articleType != null">article_type = #{articleType},</if>
<if test="keyword != null and keyword != ''">keyword = #{keyword},</if>
<if test="showImg != null">show_img = #{showImg},</if>
<if test="videoFeedId != null">video_feed_id = #{videoFeedId},</if>
<if test="videoFeedId2 != null">video_feed_id_2 = #{videoFeedId2},</if>
<if test="appResourceId != null">app_resource_id = #{appResourceId},</if>
<if test="lookNumber != null">look_number = #{lookNumber},</if>
<if test="loveNumber != null">love_number = #{loveNumber},</if>