| Line 88... |
Line 88... |
| 88 |
"from Order o join FofoStore fs on fs.id = o.retailerId" +
|
88 |
"from Order o join FofoStore fs on fs.id = o.retailerId" +
|
| 89 |
" join LineItem l on l.orderId = o.id" +
|
89 |
" join LineItem l on l.orderId = o.id" +
|
| 90 |
" join LineItemImei lii on lii.lineItemId = l.id" +
|
90 |
" join LineItemImei lii on lii.lineItemId = l.id" +
|
| 91 |
" join Warehouse w on w.id = o.fulfilmentWarehouseId" +
|
91 |
" join Warehouse w on w.id = o.fulfilmentWarehouseId" +
|
| 92 |
" join Vendor v on v.id = w.vendor" +
|
92 |
" join Vendor v on v.id = w.vendor" +
|
| 93 |
" left join ActivatedImei ai on ai.serialNumber = lii.serialNumber" +
|
- |
|
| 94 |
" join WarehouseInventoryItem wi on wi.serialNumber = lii.serialNumber" +
|
93 |
" join WarehouseInventoryItem wi on wi.serialNumber = lii.serialNumber" +
|
| 95 |
" join WarehouseScan ws on (ws.orderId = o.id and ws.type = 'SALE' and wi.id = ws.inventoryItemId)" +
|
94 |
" join WarehouseScan ws on (ws.orderId = o.id and ws.type = 'SALE' and wi.id = ws.inventoryItemId)" +
|
| 96 |
" join Item i on i.id=l.itemId " +
|
95 |
" join Item i on i.id=l.itemId " +
|
| - |
|
96 |
" left join ActivatedImei ai on ai.serialNumber = lii.serialNumber " +
|
| - |
|
97 |
"where fs.internal=false and i.catalogItemId=:catalogId and o.billingTimestamp >= :startDate " +
|
| 97 |
"where i.catalogItemId=:catalogId and o.billingTimestamp >= :startDate and :endDate is null or o.billingTimestamp < :endDate and (o.refundTimestamp is null or o.refundTimestamp <= :endDate)"),
|
98 |
"and (:endDate is null or o.billingTimestamp < :endDate) and (o.refundTimestamp is null or o.refundTimestamp <= :endDate)"),
|
| 98 |
|
99 |
|
| 99 |
|
100 |
|
| 100 |
})
|
101 |
})
|
| 101 |
//@NamedNativeQuery(name = "Order.findByEmailAddress", query = "select * from transaction.`order` o where o.id = '1694173'", resultClass = Order.class)
|
102 |
//@NamedNativeQuery(name = "Order.findByEmailAddress", query = "select * from transaction.`order` o where o.id = '1694173'", resultClass = Order.class)
|
| 102 |
|
103 |
|