| Line 1... |
Line 1... |
| 1 |
package com.spice.profitmandi.dao.entity.fofo;
|
1 |
package com.spice.profitmandi.dao.entity.fofo;
|
| 2 |
|
2 |
|
| - |
|
3 |
import javax.persistence.*;
|
| 3 |
import java.time.LocalDateTime;
|
4 |
import java.time.LocalDateTime;
|
| 4 |
|
5 |
|
| 5 |
import javax.persistence.Column;
|
- |
|
| 6 |
import javax.persistence.Entity;
|
- |
|
| 7 |
import javax.persistence.Id;
|
- |
|
| 8 |
import javax.persistence.NamedQueries;
|
- |
|
| 9 |
import javax.persistence.NamedQuery;
|
- |
|
| 10 |
import javax.persistence.Table;
|
- |
|
| 11 |
|
- |
|
| 12 |
@Entity
|
6 |
@Entity
|
| 13 |
@Table(name = "fofo.activated_imei", schema = "fofo")
|
7 |
@Table(name = "fofo.activated_imei", schema = "fofo")
|
| 14 |
|
8 |
|
| 15 |
@NamedQueries({
|
9 |
@NamedQueries({
|
| 16 |
|
10 |
|
| Line 50... |
Line 44... |
| 50 |
@NamedQuery(name = "ActivatedImei.selectActivatedUpdationDate", query = "select new com.spice.profitmandi.dao.model.ActivationImeiUpdationModel(fs.warehouseId,li.brand, "
|
44 |
@NamedQuery(name = "ActivatedImei.selectActivatedUpdationDate", query = "select new com.spice.profitmandi.dao.model.ActivationImeiUpdationModel(fs.warehouseId,li.brand, "
|
| 51 |
+ " Max(ai.createTimestamp))"
|
45 |
+ " Max(ai.createTimestamp))"
|
| 52 |
+ " from ActivatedImei ai join LineItemImeiView lim on ai.serialNumber = lim.serialNumber join LineItem li on li.id = lim.lineItemId join Order o on o.id = li.orderId "
|
46 |
+ " from ActivatedImei ai join LineItemImeiView lim on ai.serialNumber = lim.serialNumber join LineItem li on li.id = lim.lineItemId join Order o on o.id = li.orderId "
|
| 53 |
+ " join FofoStore fs on fs.id = o.retailerId group by li.brand,fs.warehouseId"),
|
47 |
+ " join FofoStore fs on fs.id = o.retailerId group by li.brand,fs.warehouseId"),
|
| 54 |
|
48 |
|
| 55 |
@NamedQuery(name = "ActivatedImei.selectVivoImeiAndActivationTimeStamp", query = "select new com.spice.profitmandi.dao.model.VivoImeiAndActivationTimeStampModel(ii.serialNumber, ai.activationTimestamp) "
|
49 |
@NamedQuery(name = "ActivatedImei.selectImeiActivationByBrand", query = "select new com.spice.profitmandi.dao.model.ImeiActivationTimestampModel(ii.serialNumber, ai.activationTimestamp) "
|
| 56 |
+ " from InventoryItem ii left join ActivatedImei ai on ii.serialNumber = ai.serialNumber join Item i on i.id = ii.itemId "
|
50 |
+ " from InventoryItem ii left join ActivatedImei ai on ii.serialNumber = ai.serialNumber join Item i on i.id = ii.itemId "
|
| 57 |
+ " where ii.lastScanType in('PURCHASE','SALE','SALE_RET','PURCHASE_RET') and i.brand = 'Vivo' and ai.activationTimestamp is null"),
|
51 |
+ " where ii.lastScanType in('PURCHASE','SALE','SALE_RET','PURCHASE_RET') and i.brand = :brand and ai.activationTimestamp is null and ii.serialNumber is not null"),
|
| 58 |
|
52 |
|
| 59 |
})
|
53 |
})
|
| 60 |
public class ActivatedImei {
|
54 |
public class ActivatedImei {
|
| 61 |
@Id
|
55 |
@Id
|
| 62 |
@Column(name = "serial_number", unique = true)
|
56 |
@Column(name = "serial_number", unique = true)
|