| Line 48... |
Line 48... |
| 48 |
|
48 |
|
| 49 |
@NamedQuery(name = "ActivatedImei.selectImeiActivationByBrand", query = "select new com.spice.profitmandi.dao.model.ImeiActivationTimestampModel(limei.serialNumber, ai.activationTimestamp) "
|
49 |
@NamedQuery(name = "ActivatedImei.selectImeiActivationByBrand", query = "select new com.spice.profitmandi.dao.model.ImeiActivationTimestampModel(limei.serialNumber, ai.activationTimestamp) "
|
| 50 |
+ " from Order o join LineItem li on o.id=li.orderId join LineItemImei limei on li.id=limei.lineItemId join FofoStore fs on fs.id=o.retailerId left join ActivatedImei ai on limei.serialNumber = ai.serialNumber "
|
50 |
+ " from Order o join LineItem li on o.id=li.orderId join LineItemImei limei on li.id=limei.lineItemId join FofoStore fs on fs.id=o.retailerId left join ActivatedImei ai on limei.serialNumber = ai.serialNumber "
|
| 51 |
+ " where (ai.createTimestamp is null or ai.createTimestamp < :daysBeforeToday) and li.brand = :brand and ai.activationTimestamp is null and fs.active=true and fs.internal = false and fs.fofoType='FRANCHISE'"),
|
51 |
+ " where (ai.createTimestamp is null or ai.createTimestamp < :daysBeforeToday) and li.brand = :brand and ai.activationTimestamp is null and fs.active=true and fs.internal = false and fs.fofoType='FRANCHISE'"),
|
| 52 |
|
52 |
|
| - |
|
53 |
@NamedQuery(name = "ActivatedImei.selectActivatedImeisByOrders", query = "select new com.spice.profitmandi.dao.model.ImeiActivationTimestampModel(o.id, o.lineItem.unitPrice, limei.serialNumber, ai.activationTimestamp) "
|
| - |
|
54 |
+ " from Order o join LineItem li on o.id=li.orderId join LineItemImei limei on li.id=limei.lineItemId join FofoStore fs on fs.id=o.retailerId left join ActivatedImei ai on limei.serialNumber = ai.serialNumber "
|
| - |
|
55 |
+ " where o.id in :orderIds and ai.activationTimestamp is not null"),
|
| - |
|
56 |
|
| 53 |
})
|
57 |
})
|
| 54 |
public class ActivatedImei {
|
58 |
public class ActivatedImei {
|
| 55 |
@Id
|
59 |
@Id
|
| 56 |
@Column(name = "serial_number", unique = true)
|
60 |
@Column(name = "serial_number", unique = true)
|
| 57 |
private String serialNumber;
|
61 |
private String serialNumber;
|