| Line 75... |
Line 75... |
| 75 |
" else 0 end),\n" +
|
75 |
" else 0 end),\n" +
|
| 76 |
" sum(case\n" +
|
76 |
" sum(case\n" +
|
| 77 |
" when o.billingTimestamp is not null and (o.createTimestamp between :startDate and :endDate)\n" +
|
77 |
" when o.billingTimestamp is not null and (o.createTimestamp between :startDate and :endDate)\n" +
|
| 78 |
" then cast(o.totalAmount AS integer )\n" +
|
78 |
" then cast(o.totalAmount AS integer )\n" +
|
| 79 |
" else 0 end),\n" +
|
79 |
" else 0 end),\n" +
|
| 80 |
" sum(case when o.billingTimestamp is not null then cast(o.totalAmount AS integer ) else 0 end))\n" +
|
80 |
" sum(case when o.billingTimestamp is not null then cast(o.totalAmount AS integer ) else 0 end)," +
|
| - |
|
81 |
" cast (count(distinct o.retailerId) as int))\n" +
|
| 81 |
"from Order o\n" +
|
82 |
"from Order o\n" +
|
| 82 |
" join LineItem li\n" +
|
83 |
" join LineItem li\n" +
|
| 83 |
" on o.id = li.orderId\n" +
|
84 |
" on o.id = li.orderId\n" +
|
| 84 |
" join FofoStore fs on fs.id = o.retailerId\n" +
|
85 |
" join FofoStore fs on fs.id = o.retailerId\n" +
|
| 85 |
" join PartnerPosition pp on pp.fofoId = o.retailerId\n" +
|
86 |
" join PartnerPosition pp on pp.fofoId = o.retailerId\n" +
|