zhaoxian пре 3 година
родитељ
комит
716bd8dd06

+ 4 - 6
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/material/mapper/xml/ProductMaterialMapper.xml

@@ -90,9 +90,9 @@
         GROUP BY signature
         ) t2 ON t1.signature = t2.signature
         LEFT JOIN (select id, realname from sys_user) t3 on t1.user_id =t3.id
-        LEFT JOIN ( SELECT product_id, trade_name, COUNT( signature ) AS 'videoCount' FROM ctop_product_material
+        LEFT JOIN ( SELECT product_id, trade_name, sum(1)AS 'videoCount' FROM ctop_product_material
         WHERE video_url is not null
-        GROUP BY product_id,trade_name,signature) t4 ON t1.product_id = t4.product_id AND t1.trade_name= t4.trade_name
+        GROUP BY product_id,trade_name) t4 ON t1.product_id = t4.product_id AND t1.trade_name= t4.trade_name
         <where>
         <if test="productId!=null">
             and t1.product_id = #{productId}
@@ -132,7 +132,7 @@
                t1.product_name as 'productName',
                t1.trade_name as 'tradeName',
                t1.video_url as 'videoUrl',
-               IFNULL(sum(t2.charge), 0.00) as 'charge',
+               IFNULL(t2.charge, 0.00) as 'charge',
                IFNULL(t3.realname, '-') as 'user'
         FROM ctop_product_material t1
                  LEFT JOIN (
@@ -149,7 +149,6 @@
           and trade_name = #{tradeName}
           and start_month >= #{startMonth}
           and end_month &lt;= #{endMonth}
-        group by t1.signature
     </select>
 
     <select id="getVideoDetailsReportList" resultType="com.alibaba.fastjson.JSONObject">
@@ -159,7 +158,7 @@
         t1.start_month as 'startMonth',
         t1.end_month as 'endMonth',
         t1.video_url as 'videoUrl',
-        IFNULL(sum(t2.charge), 0.00) as 'charge',
+        IFNULL(t2.charge, 0.00) as 'charge',
         case t1.item_run
         WHEN 1 THEN '是'
         WHEN 0 THEN '否'
@@ -198,7 +197,6 @@
         <if test="itemRun!=null">
             and t1.item_run = #{itemRun}
         </if>
-        group by t1.product_id,	t1.product_name ,t1.signature
     </select>
 
 </mapper>