|
@@ -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("'");
|