加上藕山的数据查询

dev
徐杰盟 2023-11-09 09:35:04 +08:00
parent 6d2ff8a9f9
commit 026ca0f9d5
1 changed files with 28 additions and 0 deletions

View File

@ -2282,6 +2282,7 @@ public class OrderStatService {
" ifnull(sum(case when g.supermarket_id = 5 or g.supermarket_id = 9 then g.weight end), 0) xsl_5,\n" +
" ifnull(sum(case when g.supermarket_id = 6 or g.supermarket_id = 8 or g.supermarket_id = 10 then g.weight end), 0) xsl_6,\n" +
" ifnull(sum(case when g.supermarket_id = 11 then g.weight end), 0) xsl_11,\n" +
" ifnull(sum(case when g.supermarket_id = 12 then g.weight end), 0) xsl_12,\n" +
" ifnull(sum(case when g.supermarket_id = 99 then g.weight end), 0) xsl_99,\n" +
" ifnull(sum(case when g.supermarket_id = 1 or g.supermarket_id = 7 then g.total_price end), 0) xse_1,\n" +
" ifnull(sum(case when g.supermarket_id = 2 then g.total_price end), 0) xse_2,\n" +
@ -2290,6 +2291,7 @@ public class OrderStatService {
" ifnull(sum(case when g.supermarket_id = 5 or g.supermarket_id = 9 then g.total_price end), 0) xse_5,\n" +
" ifnull(sum(case when g.supermarket_id = 6 or g.supermarket_id = 8 or g.supermarket_id = 10 then g.total_price end), 0) xse_6,\n" +
" ifnull(sum(case when g.supermarket_id = 11 then g.total_price end), 0) xse_11,\n" +
" ifnull(sum(case when g.supermarket_id = 12 then g.total_price end), 0) xse_12,\n" +
" ifnull(sum(case when g.supermarket_id = 99 then g.total_price end), 0) xse_99\n" +
" from (\n" +
" select\n" +
@ -2475,6 +2477,7 @@ public class OrderStatService {
double all_xsl_5 = 0.0;
double all_xsl_6 = 0.0;
double all_xsl_11 = 0.0;
double all_xsl_12 = 0.0;
double all_xsl_99 = 0.0;
double all_xse_1 = 0.0;
double all_xse_2 = 0.0;
@ -2483,6 +2486,7 @@ public class OrderStatService {
double all_xse_5 = 0.0;
double all_xse_6 = 0.0;
double all_xse_11 = 0.0;
double all_xse_12 = 0.0;
double all_xse_99 = 0.0;
for (Record record : typelist) {
@ -2504,6 +2508,7 @@ public class OrderStatService {
double xsl_5 = 0.0;
double xsl_6 = 0.0;
double xsl_11 = 0.0;
double xsl_12 = 0.0;
double xsl_99 = 0.0;
double xse_1 = 0.0;
double xse_2 = 0.0;
@ -2512,6 +2517,7 @@ public class OrderStatService {
double xse_5 = 0.0;
double xse_6 = 0.0;
double xse_11 = 0.0;
double xse_12 = 0.0;
double xse_99 = 0.0;
for (Record r : list) {
@ -2527,6 +2533,7 @@ public class OrderStatService {
xsl_5 += DataUtil.getDefaultByRecord(r, "xsl_5");
xsl_6 += DataUtil.getDefaultByRecord(r, "xsl_6");
xsl_11 += DataUtil.getDefaultByRecord(r, "xsl_11");
xsl_12 += DataUtil.getDefaultByRecord(r, "xsl_12");
xsl_99 += DataUtil.getDefaultByRecord(r, "xsl_99");
xse_1 += DataUtil.getDefaultByRecord(r, "xse_1");
xse_2 += DataUtil.getDefaultByRecord(r, "xse_2");
@ -2535,6 +2542,7 @@ public class OrderStatService {
xse_5 += DataUtil.getDefaultByRecord(r, "xse_5");
xse_6 += DataUtil.getDefaultByRecord(r, "xse_6");
xse_11 += DataUtil.getDefaultByRecord(r, "xse_11");
xse_12 += DataUtil.getDefaultByRecord(r, "xse_12");
xse_99 += DataUtil.getDefaultByRecord(r, "xse_99");
all_prepay_total_amount += DataUtil.getDefaultByRecord(r, "prepay_total_amount");
@ -2549,6 +2557,7 @@ public class OrderStatService {
all_xsl_5 += DataUtil.getDefaultByRecord(r, "xsl_5");
all_xsl_6 += DataUtil.getDefaultByRecord(r, "xsl_6");
all_xsl_11 += DataUtil.getDefaultByRecord(r, "xsl_11");
all_xsl_12 += DataUtil.getDefaultByRecord(r, "xsl_12");
all_xsl_99 += DataUtil.getDefaultByRecord(r, "xsl_99");
all_xse_1 += DataUtil.getDefaultByRecord(r, "xse_1");
all_xse_2 += DataUtil.getDefaultByRecord(r, "xse_2");
@ -2557,6 +2566,7 @@ public class OrderStatService {
all_xse_5 += DataUtil.getDefaultByRecord(r, "xse_5");
all_xse_6 += DataUtil.getDefaultByRecord(r, "xse_6");
all_xse_11 += DataUtil.getDefaultByRecord(r, "xse_11");
all_xse_12 += DataUtil.getDefaultByRecord(r, "xse_12");
all_xse_99 += DataUtil.getDefaultByRecord(r, "xse_99");
}
@ -2572,6 +2582,7 @@ public class OrderStatService {
record.set("xsl_5", xsl_5);
record.set("xsl_6", xsl_6);
record.set("xsl_11", xsl_11);
record.set("xsl_12", xsl_12);
record.set("xsl_99", xsl_99);
record.set("xse_1", xse_1);
record.set("xse_2", xse_2);
@ -2580,6 +2591,7 @@ public class OrderStatService {
record.set("xse_5", xse_5);
record.set("xse_6", xse_6);
record.set("xse_11", xse_11);
record.set("xse_12", xse_12);
record.set("xse_99", xse_99);
}
}
@ -2611,6 +2623,7 @@ public class OrderStatService {
record.set("xsl_5", all_xsl_5);
record.set("xsl_6", all_xsl_6);
record.set("xsl_11", all_xsl_11);
record.set("xsl_12", all_xsl_12);
record.set("xsl_99", all_xsl_99);
record.set("xse_1", all_xse_1);
record.set("xse_2", all_xse_2);
@ -2619,6 +2632,7 @@ public class OrderStatService {
record.set("xse_5", all_xse_5);
record.set("xse_6", all_xse_6);
record.set("xse_11", all_xse_11);
record.set("xse_12", all_xse_12);
record.set("xse_99", all_xse_99);
typelist.add(record);
@ -2891,6 +2905,7 @@ public class OrderStatService {
" ifnull(sum(case when g.supermarket_id = 5 or g.supermarket_id = 9 then g.presell_amount end), 0) xsl_5,\n" +
" ifnull(sum(case when g.supermarket_id = 6 or g.supermarket_id = 8 or g.supermarket_id = 10 then g.presell_amount end), 0) xsl_6,\n" +
" ifnull(sum(case when g.supermarket_id = 11 then g.presell_amount end), 0) xsl_11,\n" +
" ifnull(sum(case when g.supermarket_id = 12 then g.presell_amount end), 0) xsl_12,\n" +
" ifnull(sum(case when g.supermarket_id = 1 or g.supermarket_id = 7 then g.pug_amount end), 0) xse_1,\n" +
" ifnull(sum(case when g.supermarket_id = 2 then g.pug_amount end), 0) xse_2,\n" +
" ifnull(sum(case when g.supermarket_id = 3 then g.pug_amount end), 0) xse_3,\n" +
@ -2898,6 +2913,7 @@ public class OrderStatService {
" ifnull(sum(case when g.supermarket_id = 5 or g.supermarket_id = 9 then g.pug_amount end), 0) xse_5,\n" +
" ifnull(sum(case when g.supermarket_id = 6 or g.supermarket_id = 8 or g.supermarket_id = 10 then g.pug_amount end), 0) xse_6,\n" +
" ifnull(sum(case when g.supermarket_id = 11 then g.pug_amount end), 0) xse_11, \n" +
" ifnull(sum(case when g.supermarket_id = 12 then g.pug_amount end), 0) xse_12, \n" +
" ifnull(sum(case when g.supermarket_id = 1 or g.supermarket_id = 7 then g.weight end), 0) xsw_1,\n" +
" ifnull(sum(case when g.supermarket_id = 2 then g.weight end), 0) xsw_2,\n" +
" ifnull(sum(case when g.supermarket_id = 3 then g.weight end), 0) xsw_3,\n" +
@ -2905,6 +2921,7 @@ public class OrderStatService {
" ifnull(sum(case when g.supermarket_id = 5 or g.supermarket_id = 9 then g.weight end), 0) xsw_5,\n" +
" ifnull(sum(case when g.supermarket_id = 6 or g.supermarket_id = 8 or g.supermarket_id = 10 then g.weight end), 0) xsw_6,\n" +
" ifnull(sum(case when g.supermarket_id = 11 then g.weight end), 0) xsw_11\n" +
" ifnull(sum(case when g.supermarket_id = 12 then g.weight end), 0) xsw_12\n" +
" from (\n" +
" select a.customer_id, a.supermarket_id, sum(a.presell_amount) presell_amount, sum(a.pug_amount) pug_amount, sum(a.weight) weight from (\n" +
" select t.customer_id, t.supermarket_id, sum(t.presell_amount) presell_amount, 0 pug_amount, 0 weight from presell_order t\n" +
@ -2938,6 +2955,7 @@ public class OrderStatService {
double all_xsl_5 = 0.0;
double all_xsl_6 = 0.0;
double all_xsl_11 = 0.0;
double all_xsl_12 = 0.0;
double all_xse_1 = 0.0;
double all_xse_2 = 0.0;
double all_xse_3 = 0.0;
@ -2945,6 +2963,7 @@ public class OrderStatService {
double all_xse_5 = 0.0;
double all_xse_6 = 0.0;
double all_xse_11 = 0.0;
double all_xse_12 = 0.0;
double all_xsw_1 = 0.0;
double all_xsw_2 = 0.0;
double all_xsw_3 = 0.0;
@ -2952,6 +2971,7 @@ public class OrderStatService {
double all_xsw_5 = 0.0;
double all_xsw_6 = 0.0;
double all_xsw_11 = 0.0;
double all_xsw_12 = 0.0;
for (int i = 0; i < list.size(); i++) {
Record r = list.get(i);
@ -2966,6 +2986,7 @@ public class OrderStatService {
double xsl_5 = DataUtil.getDefaultByRecord(r, "xsl_5");
double xsl_6 = DataUtil.getDefaultByRecord(r, "xsl_6");
double xsl_11 = DataUtil.getDefaultByRecord(r, "xsl_11");
double xsl_12 = DataUtil.getDefaultByRecord(r, "xsl_12");
double xse_1 = DataUtil.getDefaultByRecord(r, "xse_1");
double xse_2 = DataUtil.getDefaultByRecord(r, "xse_2");
double xse_3 = DataUtil.getDefaultByRecord(r, "xse_3");
@ -2973,6 +2994,7 @@ public class OrderStatService {
double xse_5 = DataUtil.getDefaultByRecord(r, "xse_5");
double xse_6 = DataUtil.getDefaultByRecord(r, "xse_6");
double xse_11 = DataUtil.getDefaultByRecord(r, "xse_11");
double xse_12 = DataUtil.getDefaultByRecord(r, "xse_12");
double xsw_1 = DataUtil.getDefaultByRecord(r, "xsw_1");
double xsw_2 = DataUtil.getDefaultByRecord(r, "xsw_2");
double xsw_3 = DataUtil.getDefaultByRecord(r, "xsw_3");
@ -2980,6 +3002,7 @@ public class OrderStatService {
double xsw_5 = DataUtil.getDefaultByRecord(r, "xsw_5");
double xsw_6 = DataUtil.getDefaultByRecord(r, "xsw_6");
double xsw_11 = DataUtil.getDefaultByRecord(r, "xsw_11");
double xsw_12 = DataUtil.getDefaultByRecord(r, "xsw_12");
Record rec = new Record();
rec.set("inx", i + 1);
@ -3021,6 +3044,7 @@ public class OrderStatService {
all_xsl_5 += xsl_5;
all_xsl_6 += xsl_6;
all_xsl_11 += xsl_11;
all_xsl_12 += xsl_12;
all_xse_1 += xse_1;
all_xse_2 += xse_2;
all_xse_3 += xse_3;
@ -3028,6 +3052,7 @@ public class OrderStatService {
all_xse_5 += xse_5;
all_xse_6 += xse_6;
all_xse_11 += xse_11;
all_xse_12 += xse_12;
all_xsw_1 += xsw_1;
all_xsw_2 += xsw_2;
all_xsw_3 += xsw_3;
@ -3035,6 +3060,7 @@ public class OrderStatService {
all_xsw_5 += xsw_5;
all_xsw_6 += xsw_6;
all_xsw_11 += xsw_11;
all_xsw_12 += xsw_12;
}
Record r = new Record();
@ -3057,6 +3083,7 @@ public class OrderStatService {
r.set("xse_5", all_xse_5);
r.set("xse_6", all_xse_6);
r.set("xse_11", all_xse_11);
r.set("xse_12", all_xse_12);
r.set("xsw_1", all_xsw_1);
r.set("xsw_2", all_xsw_2);
r.set("xsw_3", all_xsw_3);
@ -3064,6 +3091,7 @@ public class OrderStatService {
r.set("xsw_5", all_xsw_5);
r.set("xsw_6", all_xsw_6);
r.set("xsw_11", all_xsw_11);
r.set("xsw_12", all_xsw_12);
ret.add(r);