Browse Source

首页 头条查询 优化排序

zhaoxian 1 year ago
parent
commit
12ae3c415e

+ 3 - 1
jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/mapper/xml/BytedanceAccountReportDailyDwMapper.xml

@@ -180,11 +180,11 @@
         </if>
         GROUP BY t1.project_id
         HAVING sum(cost) > 0
-        ORDER BY ${sortCode} ${order}
         ) t
         <if test="category == 1">
             WHERE rio &lt;= -0.1 AND rio !='-'
         </if>
+        ORDER BY ${sortCode} ${order}
     </select>
 
 
@@ -204,6 +204,7 @@
     </select>
 
     <select id="getProjectMoreDaysReport" resultType="com.alibaba.fastjson.JSONObject">
+        SELECT * FROM (
         SELECT
         t1.project_id as 'projectId',
         t3.project_name AS 'projectName',
@@ -281,6 +282,7 @@
         </if>
         GROUP BY t1.project_id
         HAVING sum(cost) > 0
+        ) t
         ORDER BY ${sortCode} ${order}
     </select>
 

+ 1 - 1
jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/service/impl/BytedanceAccountReportDailyDwServiceImpl.java

@@ -100,7 +100,7 @@ public class BytedanceAccountReportDailyDwServiceImpl implements IBytedanceAccou
             order = "DESC";
         }
         if (Check.isNull(sortCode)) {
-            sortCode = "SUM(cost)";
+            sortCode = "cost";
         }
         Integer startTimeInt = DateUtils.getDateInteger(startTime);
         Integer endTimeInt = DateUtils.getDateInteger(endTime);