Browse Source

按内容池level排序

wangyunpeng 4 months ago
parent
commit
55a177444c

+ 1 - 1
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/mapper/longArticle/ArticleAuditMapper.java

@@ -15,7 +15,7 @@ public interface ArticleAuditMapper {
 
     List<ArticleVideoAuditListVO> articleVideoAuditList(List<String> contentId, List<Integer> status,
                                                         List<String> title, List<String> auditAccount,
-                                                        int offset, Integer pageSize);
+                                                        int offset, Integer pageSize, String poolLevelDesc);
 
     void updateCrawlerVideoIsIllegal(List<Integer> illegalVideoIds, Integer isIllegal);
 

+ 4 - 1
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/ArticleVideoAuditService.java

@@ -51,12 +51,15 @@ public class ArticleVideoAuditService {
     @Value("${cdnUrl:https://rescdn.piaoquantv.com/}")
     private String cdnUrl;
 
+    @Value("${videoAudit.poolLevel.sort:}")
+    private String poolLevelDesc;
+
     public Page<ArticleVideoAuditListVO> list(ArticleVideoAuditListParam param) {
         int offset = (param.getPageNum() - 1) * param.getPageSize();
         int count = articleAuditMapper.articleVideoAuditListCount(param.getContentId(), param.getStatus(),
                 param.getTitle(), param.getAuditAccount());
         List<ArticleVideoAuditListVO> list = articleAuditMapper.articleVideoAuditList(param.getContentId(),
-                param.getStatus(), param.getTitle(), param.getAuditAccount(), offset, param.getPageSize());
+                param.getStatus(), param.getTitle(), param.getAuditAccount(), offset, param.getPageSize(), poolLevelDesc);
         buildArticleVideoAuditListVO(list);
         Page<ArticleVideoAuditListVO> page = new Page<>(param.getPageNum(), param.getPageSize());
         page.setTotalSize(count);

+ 24 - 19
long-article-recommend-service/src/main/resources/mapper/longArticle/ArticleAuditMapper.xml

@@ -3,30 +3,30 @@
 <mapper namespace="com.tzld.longarticle.recommend.server.mapper.longArticle.ArticleAuditMapper">
 
     <select id="articleVideoAuditListCount" resultType="java.lang.Integer">
-        select count(long_articles_title_audit.content_id)
-        from long_articles_title_audit
-        left join long_articles_text on long_articles_title_audit.content_id = long_articles_text.content_id
+        select count(lata.content_id)
+        from long_articles_title_audit lata
+        left join long_articles_text lat on lata.content_id = lat.content_id
         <where>
             <if test="status!= null and status.size() > 0">
-                and long_articles_title_audit.status in
+                and lata.status in
                 <foreach collection="status" item="item" separator="," open="(" close=")">
                     #{item}
                 </foreach>
             </if>
             <if test="contentId!= null and contentId.size() > 0">
-                and long_articles_title_audit.content_id in
+                and lata.content_id in
                 <foreach collection="contentId" item="item" separator="," open="(" close=")">
                     #{item}
                 </foreach>
             </if>
             <if test="title!= null and title.size() > 0">
-                and long_articles_text.article_title in
+                and lat.article_title in
                 <foreach collection="title" item="item" separator="," open="(" close=")">
                     #{item}
                 </foreach>
             </if>
             <if test="auditAccount!= null and auditAccount.size() > 0">
-                and long_articles_title_audit.audit_account in
+                and lata.audit_account in
                 <foreach collection="auditAccount" item="item" separator="," open="(" close=")">
                     #{item}
                 </foreach>
@@ -36,39 +36,44 @@
 
     <select id="articleVideoAuditList"
             resultType="com.tzld.longarticle.recommend.server.model.vo.ArticleVideoAuditListVO">
-        select long_articles_title_audit.content_id, long_articles_title_audit.status,
-        long_articles_text.article_title as title, long_articles_text.kimi_title,
-        long_articles_title_audit.audit_account, long_articles_title_audit.audit_timestamp,
-        long_articles_title_audit.flow_pool_level
-        from long_articles_title_audit
-        left join long_articles_text on long_articles_title_audit.content_id = long_articles_text.content_id
+        select lata.content_id, lata.status, lat.article_title as title, lat.kimi_title,
+        lata.audit_account, lata.audit_timestamp, lata.flow_pool_level
+        from long_articles_title_audit lata
+        left join long_articles_text lat on lata.content_id = lat.content_id
         <where>
             <if test="status!= null and status.size() > 0">
-                and long_articles_title_audit.status in
+                and lata.status in
                 <foreach collection="status" item="item" separator="," open="(" close=")">
                     #{item}
                 </foreach>
             </if>
             <if test="contentId!= null and contentId.size() > 0">
-                and long_articles_title_audit.content_id in
+                and lata.content_id in
                 <foreach collection="contentId" item="item" separator="," open="(" close=")">
                     #{item}
                 </foreach>
             </if>
             <if test="title!= null and title.size() > 0">
-                and long_articles_text.article_title in
+                and lat.article_title in
                 <foreach collection="title" item="item" separator="," open="(" close=")">
                     #{item}
                 </foreach>
             </if>
             <if test="auditAccount!= null and auditAccount.size() > 0">
-                and long_articles_title_audit.audit_account in
+                and lata.audit_account in
                 <foreach collection="auditAccount" item="item" separator="," open="(" close=")">
                     #{item}
                 </foreach>
             </if>
         </where>
-        order by long_articles_title_audit.content_id desc
+        <choose>
+            <when test="poolLevelDesc != null and poolLevelDesc != ''">
+                order by lata.flow_pool_level ${poolLevelDesc}, lata.content_id desc
+            </when>
+            <otherwise>
+                order by lata.content_id desc
+            </otherwise>
+        </choose>
         limit #{offset}, #{pageSize}
     </select>
 
@@ -142,7 +147,7 @@
         update long_articles_title_audit lat
         join ( SELECT DISTINCT lamv.content_id, lamv.flow_pool_level
                FROM long_articles_match_videos lamv
-                        JOIN long_articles_title_audit lata ON lamv.content_id = lata.content_id
+                JOIN long_articles_title_audit lata ON lamv.content_id = lata.content_id
                where lamv.flow_pool_level is not null) lamv ON lat.content_id = lamv.content_id
         set lat.flow_pool_level = lamv.flow_pool_level
         where lat.flow_pool_level is null