| Line 20... |
Line 20... |
| 20 |
|
20 |
|
| 21 |
@NamedQuery(name = "Catalog.findAllWithEOLWithOutStock", query = "select i.catalogItemId "
|
21 |
@NamedQuery(name = "Catalog.findAllWithEOLWithOutStock", query = "select i.catalogItemId "
|
| 22 |
+ " from Item i "
|
22 |
+ " from Item i "
|
| 23 |
+ " left join WarehouseInventoryItem wi on i.id = wi.itemId"
|
23 |
+ " left join WarehouseInventoryItem wi on i.id = wi.itemId"
|
| 24 |
+ " left join CategorisedCatalog cc on cc.catalogId = i.catalogItemId and cc.endDate is null "
|
24 |
+ " left join CategorisedCatalog cc on cc.catalogId = i.catalogItemId and cc.endDate is null "
|
| 25 |
+ " where ((cc.status is null OR cc.status = 'OTHER' OR cc.status = 'SLOWMOVING')) and i.categoryId in (10006,10009,10010) and wi.lastScanType not in (:scanTypes) group by i.catalogItemId having (sum(wi.currentQuantity) = 0 OR sum(wi.currentQuantity) IS NULL)"),
|
25 |
+ " where ((cc.status is null OR cc.status = 'OTHER' OR cc.status = 'SLOWMOVING')) and i.categoryId in (10006,10009,10010) group by i.catalogItemId having (sum(wi.currentQuantity) = 0 OR sum(wi.currentQuantity) IS NULL)"),
|
| - |
|
26 |
|
| - |
|
27 |
|
| - |
|
28 |
@NamedQuery(
|
| - |
|
29 |
name = "Catalog.findAllWithNoGoodStock",
|
| - |
|
30 |
query = "select i.catalogItemId "
|
| - |
|
31 |
+ " from Item i "
|
| - |
|
32 |
+ " left join WarehouseInventoryItem wi on i.id = wi.itemId "
|
| - |
|
33 |
+ " left join CategorisedCatalog cc on cc.catalogId = i.catalogItemId and cc.endDate is null "
|
| - |
|
34 |
+ " where (cc.status is null OR cc.status = 'OTHER' OR cc.status = 'SLOWMOVING') "
|
| - |
|
35 |
+ " and i.categoryId in (10006, 10009, 10010) "
|
| - |
|
36 |
+ " group by i.catalogItemId "
|
| - |
|
37 |
+ " having "
|
| - |
|
38 |
+ " sum(case when (wi.lastScanType is null OR wi.lastScanType NOT IN (:scanTypes)) "
|
| - |
|
39 |
+ " then wi.currentQuantity else 0 end) = 0 "
|
| - |
|
40 |
+ " OR sum(wi.currentQuantity) IS NULL"
|
| - |
|
41 |
)
|
| 26 |
|
42 |
|
| 27 |
})
|
43 |
})
|
| 28 |
|
44 |
|
| 29 |
@Entity
|
45 |
@Entity
|
| 30 |
@Table(name = "catalog.catalog")
|
46 |
@Table(name = "catalog.catalog")
|