Przeglądaj źródła

xuanpin库 bug 修改

zhaoxian 3 lat temu
rodzic
commit
fd3110e9b9

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

@@ -50,7 +50,7 @@
                 and start_month >= #{startMonth}
             </if>
             <if test="endMonth!=null">
-                AND (end_month &lt;= #{endMonth} OR (end_month IS NULL  AND start_month &lt;= #{endMonth}))
+                AND (end_month &lt;= #{endMonth} OR (end_month IS NULL AND start_month &lt;= #{endMonth}))
             </if>
             <if test="itemRun!=null">
                 and item_run = #{itemRun}
@@ -94,21 +94,21 @@
         WHERE video_url is not null
         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}
-        </if>
-        <if test="tradeName!=null">
-            and t1.trade_name like CONCAT(CONCAT('%', #{tradeName}), '%')
-        </if>
-        <if test="startMonth!=null">
-            and t1.start_month >= #{startMonth}
-        </if>
-        <if test="endMonth!=null">
-            AND (t1.end_month &lt;= #{endMonth} OR (t1.end_month IS NULL  AND t1.start_month &lt;= #{endMonth}))
-        </if>
-        <if test="itemRun!=null">
-            and t1.item_run = #{itemRun}
-        </if>
+            <if test="productId!=null">
+                and t1.product_id = #{productId}
+            </if>
+            <if test="tradeName!=null">
+                and t1.trade_name like CONCAT(CONCAT('%', #{tradeName}), '%')
+            </if>
+            <if test="startMonth!=null">
+                and t1.start_month >= #{startMonth}
+            </if>
+            <if test="endMonth!=null">
+                AND (t1.end_month &lt;= #{endMonth} OR (t1.end_month IS NULL AND t1.start_month &lt;= #{endMonth}))
+            </if>
+            <if test="itemRun!=null">
+                and t1.item_run = #{itemRun}
+            </if>
         </where>
         group by t1.product_id,t1.trade_name
         ORDER BY t1.create_time desc
@@ -117,40 +117,42 @@
     <select id="videoListTotal" resultType="java.lang.Long">
         SELECT IFNULL(sum(1), 0)
         from (
-                 select trade_name
-                 FROM ctop_product_material
-                 WHERE video_url is not null
-                   and product_id = #{productId}
-                   and trade_name = #{tradeName}
-                   and start_month >= #{startMonth}
-                   and end_month &lt;= #{endMonth}
-                 group by signature
-             ) t
+        select trade_name
+        FROM ctop_product_material
+        WHERE video_url is not null
+        and product_id = #{productId}
+        and trade_name = #{tradeName}
+        and start_month >= #{startMonth}
+        <if test="endMonth!=null">
+            and end_month &lt;= #{endMonth}
+        </if>
+        group by signature
+        ) t
     </select>
 
     <select id="videoList" resultType="com.alibaba.fastjson.JSONObject">
         SELECT t1.id,
-               t1.product_name as 'productName',
-               t1.trade_name as 'tradeName',
-               t1.video_url as 'videoUrl',
-               IFNULL(t2.charge, 0.00) as 'charge',
-               IFNULL(t3.realname, '-') as 'user'
+        t1.product_name as 'productName',
+        t1.trade_name as 'tradeName',
+        t1.video_url as 'videoUrl',
+        IFNULL(t2.charge, 0.00) as 'charge',
+        IFNULL(t3.realname, '-') as 'user'
         FROM ctop_product_material t1
-                 LEFT JOIN (
-            SELECT signature, sum(charge) as 'charge'
-            FROM application.kuaishou_material_video_report_daily_dw
-            where product_id = #{productId}
-              AND stat_date >= DATE_FORMAT(#{startDate}, '%Y%m%d')
-              AND stat_date &lt;= DATE_FORMAT(#{endDate}, '%Y%m%d')
-            GROUP BY signature
+        LEFT JOIN (
+        SELECT signature, sum(charge) as 'charge'
+        FROM application.kuaishou_material_video_report_daily_dw
+        where product_id = #{productId}
+        AND stat_date >= DATE_FORMAT(#{startDate}, '%Y%m%d')
+        AND stat_date &lt;= DATE_FORMAT(#{endDate}, '%Y%m%d')
+        GROUP BY signature
         ) t2 ON t1.signature = t2.signature
-                 LEFT JOIN (select id, realname from sys_user) t3 on t1.uploader_id = t3.id
+        LEFT JOIN (select id, realname from sys_user) t3 on t1.uploader_id = t3.id
         WHERE video_url is not null
         and product_id = #{productId}
-          and trade_name = #{tradeName}
-          and start_month >= #{startMonth}
+        and trade_name = #{tradeName}
+        and start_month >= #{startMonth}
         <if test="endMonth!=null">
-          and end_month &lt;= #{endMonth}
+            and end_month &lt;= #{endMonth}
         </if>
         ORDER BY t1.create_time desc
     </select>
@@ -170,7 +172,7 @@
         IFNULL(t3.realname, '-') as 'user'
         FROM ctop_product_material t1
         LEFT JOIN
-        ( SELECT  product_id,signature , sum(charge) as 'charge' FROM application.kuaishou_material_video_report_daily_dw
+        ( SELECT product_id,signature , sum(charge) as 'charge' FROM application.kuaishou_material_video_report_daily_dw
         <where>
             <if test="productId!=null">
                 and product_id = #{productId}