Преглед на файлове

项目自动化调试,优化sql

zhaoxian преди 4 години
родител
ревизия
31f0d7e47b

+ 2 - 2
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/controller/KuaishouProjectStrategyController.java

@@ -67,12 +67,12 @@ public class KuaishouProjectStrategyController {
      * 项目配置列表
      */
     @PostMapping(value = "/queryProjectList")
-    public Result<Object> queryProjectList(@RequestBody JSONObject data, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
+    public Result<Object> queryProjectList(@RequestBody JSONObject data) {
         try {
             if (Check.isNull(data.getString("startTime")) || Check.isNull(data.getString("endTime"))) {
                 return Result.error("请选择查询时间");
             }
-            return kuaishouProjectStrategyService.queryProjectList(data, pageNo, pageSize);
+            return kuaishouProjectStrategyService.queryProjectList(data);
         } catch (Exception e) {
             log.error("查询异常,", e.getMessage());
             e.printStackTrace();

+ 7 - 4
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/mapper/xml/KuaishouProjectStrategyMapper.xml

@@ -30,7 +30,7 @@
                 FROM ctop_ai_kuaishou_project_strategy k1
                          LEFT JOIN ctop_user_allocation k2 ON k1.project_id = k2.project_id
                          LEFT JOIN ctop_project k3 ON k1.project_id = k3.id
-                where k3.media_id=2
+                where k3.media_id=2 and k2.auto_delivery != 3
                     <if test="projectId != null ">
                     and  k1.project_id = #{projectId}
                     </if>
@@ -71,7 +71,8 @@
         FROM ctop_user_allocation t1
                  LEFT JOIN ctop_etl_kuaishou_report_account_daily t2 ON t2.account_id = t1.account_id
                  LEFT JOIN ctop_project t3 ON t1.project_id = t3.id
-        where t2.stat_date &gt;=#{startTime}
+        where t1.auto_delivery != 3
+          and t2.stat_date &gt;=#{startTime}
           and t2.stat_date &lt;=#{endTime}
         <if test="projectId != null ">
             and t1.project_id = #{projectId}
@@ -104,7 +105,8 @@
         FROM ctop_user_allocation t1
                  LEFT JOIN ctop_etl_kuaishou_report_account_daily t2 ON t2.account_id = t1.account_id
                  LEFT JOIN ctop_project t3 ON t1.project_id = t3.id
-        where t2.stat_date &gt;=#{startTime}
+        where t1.auto_delivery != 3
+          and t2.stat_date &gt;=#{startTime}
           and t2.stat_date &lt;=#{endTime}
         <if test="projectId != null ">
             and t1.project_id = #{projectId}
@@ -143,7 +145,8 @@
         FROM ctop_user_allocation t1
                  LEFT JOIN ctop_etl_kuaishou_report_account_daily t2 ON t2.account_id = t1.account_id
                  LEFT JOIN ctop_project t3 ON t1.project_id = t3.id
-        where t2.stat_date &gt;=#{startTime}
+        where t1.auto_delivery != 3
+          and t2.stat_date &gt;=#{startTime}
           and t2.stat_date &lt;=#{endTime}
         <if test="projectId != null ">
             and t1.project_id = #{projectId}

+ 1 - 1
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/IKuaishouProjectStrategyService.java

@@ -16,7 +16,7 @@ import java.util.List;
  */
 public interface IKuaishouProjectStrategyService extends IService<KuaishouProjectStrategy> {
 
-    Result<Object> queryProjectList(JSONObject data, Integer pageNo, Integer pageSize);
+    Result<Object> queryProjectList(JSONObject data);
 
     Result<Object> queryAccountList(JSONObject data);
 

+ 3 - 1
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/impl/KuaishouProjectStrategyServiceImpl.java

@@ -35,9 +35,11 @@ public class KuaishouProjectStrategyServiceImpl extends ServiceImpl<KuaishouProj
     private AiKuaishouAccountLevelOperationRecordMapper kuaishouAccountLevelOperationRecordMapper;
 
     @Override
-    public Result<Object> queryProjectList(JSONObject data, Integer pageNo, Integer pageSize) {
+    public Result<Object> queryProjectList(JSONObject data) {
         JSONObject result = new JSONObject();
         JSONObject allInfo =  kuaishouProjectStrategyMapper.queryProjectAll(data);
+        Integer pageNo = !Check.isNull(data.getInteger("pageNo"))?1:data.getInteger("pageNo");
+        Integer pageSize = !Check.isNull(data.getInteger("pageSize"))?10:data.getInteger("pageSize");
         PageHelper.startPage(pageNo, pageSize);
         List<JSONObject> list = kuaishouProjectStrategyMapper.queryProjectList(data);
         result.put("total",allInfo);