浏览代码

达人公海排序

zhaoxian 2 年之前
父节点
当前提交
199e437c27

+ 3 - 3
ruixuan-live/src/main/java/com/ruixuan/isc/service/impl/KuaishouPromoterServiceImpl.java

@@ -96,13 +96,13 @@ public class KuaishouPromoterServiceImpl implements IKuaishouPromoterService {
         } else {
         } else {
             switch (parameter) {
             switch (parameter) {
                 case "avg_video_sales":
                 case "avg_video_sales":
-                    parameter = "SUBSTRING_INDEX(t1.avg_video_sales,'-',-1)+0";
+                    parameter = "avgVideoSalesOrder";
                     break;
                     break;
                 case "video_sales":
                 case "video_sales":
-                    parameter = "SUBSTRING_INDEX(t1.video_sales,'-',1)+0";
+                    parameter = "videoSalesOrder";
                     break;
                     break;
                 case "total_sale":
                 case "total_sale":
-                    parameter = "SUBSTRING_INDEX(t1.total_sale,'-',-1)+0";
+                    parameter = "totalSaleOrder";
                     break;
                     break;
             }
             }
         }
         }

+ 15 - 1
ruixuan-live/src/main/resources/mapper/isc/KuaishouPromoterMapper.xml

@@ -61,6 +61,7 @@
     </sql>
     </sql>
 
 
     <select id="selectKuaishouPromoterList" resultMap="KuaishouPromoterResult">
     <select id="selectKuaishouPromoterList" resultMap="KuaishouPromoterResult">
+        SELECT * from (
         SELECT
         SELECT
         t1.id,
         t1.id,
         t1.user_id,
         t1.user_id,
@@ -87,7 +88,19 @@
         t1.live_count_30,
         t1.live_count_30,
         t1.aweme_avg_digg_count_30,
         t1.aweme_avg_digg_count_30,
         t1.aweme_digg_follower_ration,
         t1.aweme_digg_follower_ration,
-        t1.live_average_user_30
+        t1.live_average_user_30,
+        case
+        WHEN t3.total_sale like '%万%'
+        then SUBSTRING_INDEX(t3.total_sale,'-',-1)+0
+        else SUBSTRING_INDEX(t3.total_sale,'-',-1)/10000 end as 'totalSaleOrder',
+        case
+        WHEN t3.video_sales like '%万%'
+        then SUBSTRING_INDEX(t3.video_sales,'-',-1)+0
+        else SUBSTRING_INDEX(t3.video_sales,'-',-1)/10000 end as 'videoSalesOrder',
+        case
+        WHEN t3.avg_video_sales like '%万%'
+        then SUBSTRING_INDEX(t3.avg_video_sales,'-',-1)+0
+        else SUBSTRING_INDEX(t3.avg_video_sales,'-',-1)/10000 end as 'avgVideoSalesOrder'
         FROM
         FROM
         kuaishou_promoter t1
         kuaishou_promoter t1
         LEFT JOIN promoter_oerder_amount t2 on t1.promoter_id = t2.promoter_id
         LEFT JOIN promoter_oerder_amount t2 on t1.promoter_id = t2.promoter_id
@@ -109,6 +122,7 @@
                 and t1.media_id = #{mediaId}
                 and t1.media_id = #{mediaId}
             </if>
             </if>
         </where>
         </where>
+        ) t
         order by ${parameter} ${orderBy}
         order by ${parameter} ${orderBy}
     </select>
     </select>