Explorar el Código

容量 新增 需要区别类型

wuweihao hace 2 años
padre
commit
766e22a197

+ 15 - 2
720yun_fd_manage/gis_service/src/main/java/com/gis/service/impl/ReportServiceImpl.java

@@ -119,7 +119,13 @@ public class ReportServiceImpl extends IBaseServiceImpl<ReportEntity, Long> impl
         StringBuilder builder = new StringBuilder();
 //        builder.append(" select groupKey, sum(total) as count,type from (");
 //        builder.append(" select groupKey, total as count,type from (");
-        builder.append(" select groupKey, ROUND(total/1024, 2) as count,type from (");
+        if ("add".equals(infoType)){
+            builder.append(" select groupKey, ROUND(sum(total)/1024, 2) as count,type from (");
+        } else {
+            builder.append(" select groupKey, ROUND(total/1024, 2) as count,type from (");
+        }
+
+
         builder.append(" select DATE_FORMAT(DATE_ADD(day,INTERVAL- (WEEKDAY(day)) day),  '%Y-%m-%d' )  as groupKey, total," +
                 " type from tb_report where is_delete=0 ");
         if (StrUtil.isNotBlank(startTime) && StrUtil.isNotBlank(endTime)) {
@@ -139,7 +145,14 @@ public class ReportServiceImpl extends IBaseServiceImpl<ReportEntity, Long> impl
         StringBuilder builder = new StringBuilder();
 //        builder.append(" select groupKey, sum(total) as count,type from (");
 //        builder.append(" select groupKey, total as count,type from (");
-        builder.append(" select groupKey, ROUND(total/1024, 2) as count,type from (");
+
+        if ("add".equals(infoType)){
+            builder.append(" select groupKey, ROUND(sum(total)/1024, 2) as count,type from (");
+        } else {
+            builder.append(" select groupKey, ROUND(total/1024, 2) as count,type from (");
+        }
+
+//        builder.append(" select groupKey, ROUND(total/1024, 2) as count,type from (");
         builder.append(" select DATE_FORMAT(day, '%Y-%m')  as groupKey, total,type from tb_report where is_delete=0");
         if (StrUtil.isNotBlank(startTime) && StrUtil.isNotBlank(endTime)) {
             builder.append(" and day between '").append(startTime).append("' and '").append(endTime).append("'");