Subversion Repositories SmartDukaan

Rev

Rev 35487 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 35487 Rev 35501
Line 27... Line 27...
27
        @NamedQuery(name = "Catalog.selectAllStatusAndBrandWise", query = "select c.id" +
27
        @NamedQuery(name = "Catalog.selectAllStatusAndBrandWise", query = "select c.id" +
28
                " from Catalog c " +
28
                " from Catalog c " +
29
                " join CategorisedCatalog cc on c.id = cc.catalogId and cc.endDate is null" +
29
                " join CategorisedCatalog cc on c.id = cc.catalogId and cc.endDate is null" +
30
                " where cc.status in  (:statuses) and c.brand in :brands"),
30
                " where cc.status in  (:statuses) and c.brand in :brands"),
31
 
31
 
-
 
32
        @NamedQuery(name = "Catalog.selectAllGoodStockBrandWise", query = "SELECT DISTINCT c " +
-
 
33
                "FROM Catalog c " +
-
 
34
                "         JOIN Item i ON i.catalogItemId = c.id " +
-
 
35
                "         JOIN CategorisedCatalog cc ON c.id = cc.catalogId and cc.endDate is null " +
-
 
36
                "         JOIN WarehouseInventoryItem wi ON wi.itemId = i.id " +
-
 
37
                " WHERE " +
-
 
38
                "        i.categoryId IN (10006) " +
-
 
39
                "  AND (wi.lastScanType NOT IN (:scanTypes) OR wi.lastScanType IS NULL) " +
-
 
40
                " " +
-
 
41
                "  AND ( " +
-
 
42
                "        (cc.status NOT IN (:movingStatus) AND cc.status IS NOT NULL) " +
-
 
43
                "        OR " +
-
 
44
                "        wi.currentQuantity > 0 " +
-
 
45
                "    ) " +
-
 
46
                " and c.brand = :brand " +
-
 
47
                " GROUP BY c.id"),
-
 
48
 
32
 
49
 
33
        @NamedQuery(
50
        @NamedQuery(
34
                name = "Catalog.findAllWithNoGoodStock",
51
                name = "Catalog.findAllWithNoGoodStock",
35
                query = "select i.catalogItemId "
52
                query = "select i.catalogItemId "
36
                        + " from Item i "
53
                        + " from Item i "