| Line 167... |
Line 167... |
| 167 |
+ " case when psp.secondaryPlan is not null then cast(psp.secondaryPlan As long) else 0 end , sum(cast(o.totalAmount AS integer)),"
|
167 |
+ " case when psp.secondaryPlan is not null then cast(psp.secondaryPlan As long) else 0 end , sum(cast(o.totalAmount AS integer)),"
|
| 168 |
+ " psp.authId )"
|
168 |
+ " psp.authId )"
|
| 169 |
+ " from FofoStore fs left join Order o on (fs.id = o.retailerId and o.status in (7,9,10,12)"
|
169 |
+ " from FofoStore fs left join Order o on (fs.id = o.retailerId and o.status in (7,9,10,12)"
|
| 170 |
+ " and o.billingTimestamp >= :startDate and o.billingTimestamp <= :endDate ) left join LineItem li on o.id = li.orderId left join "
|
170 |
+ " and o.billingTimestamp >= :startDate and o.billingTimestamp <= :endDate ) left join LineItem li on o.id = li.orderId left join "
|
| 171 |
+ " PartnerSecondaryPlan psp on (psp.fofoId = fs.id and psp.createTimestamp >= :startDate "
|
171 |
+ " PartnerSecondaryPlan psp on (psp.fofoId = fs.id and psp.createTimestamp >= :startDate "
|
| 172 |
+ " and psp.createTimestamp <= :endDate and psp.active = 1 and li.brand = psp.brand)"
|
172 |
+ " and psp.createTimestamp <= :endDate and psp.active = 1 )"
|
| 173 |
+ " where fs.id in :fofoIds and fs.internal = 0 group by li.brand,psp.brand,fs.id"),
|
173 |
+ " where fs.id in :fofoIds and fs.internal = 0 group by li.brand,psp.brand,fs.id"),
|
| 174 |
|
174 |
|
| 175 |
})
|
175 |
})
|
| 176 |
public class Order implements Serializable {
|
176 |
public class Order implements Serializable {
|
| 177 |
|
177 |
|