瀏覽代碼

V1.1.2 自动投放 修改查询数据逻辑

yumeng 4 年之前
父節點
當前提交
deef9de61a

+ 10 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/controller/KuaiShouMaterialControer.java

@@ -255,7 +255,17 @@ public class KuaiShouMaterialControer {
             if (Check.isNull(videoCnt)) {
                 throw new Exception("请输入查询条数");
             }
+            String startTime = requestJson.getString("startTime");
+            if (Check.isNull(startTime)) {
+                throw new Exception("请输入查询开始时间");
+            }
+            String endTime = requestJson.getString("endTime");
+            if (Check.isNull(endTime)) {
+                throw new Exception("请输入查询结束时间");
+            }
             Map<String, Object> requestMap = new HashMap<>();
+            requestMap.put("startTime", startTime);
+            requestMap.put("endTime", endTime);
             requestMap.put("accountId", accountId);
             requestMap.put("creativeCount", 0);
             requestMap.put("videoCnt", videoCnt);

+ 6 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/xml/KuaishouVideoRelateCreativesMapper.xml

@@ -63,6 +63,12 @@
         <if test="creativeCount != null and creativeCount != '' ">
             AND creative_count = #{creativeCount}
         </if>
+        <if test="startTime != null and startTime != '' ">
+            AND stat_date &lt;= #{startTime}
+        </if>
+        <if test="endTime != null and endTime != '' ">
+            AND stat_date &gt;= #{endTime}
+        </if>
         ORDER BY stat_date ASC
         LIMIT #{videoCnt}
     </select>