Subversion Repositories SmartDukaan

Rev

Rev 37563 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 37563 Rev 37782
Line 17... Line 17...
17
 
17
 
18
@NamedQueries({@NamedQuery(name = "Item.selectItemByLikes", query = "select new com.spice.profitmandi.common.model.CustomItemModel(" + "	i.id, i.brand, i.modelName, i.modelNumber, i.color" + "	) from Item  i join CurrentInventorySnapshot cis on i.id = cis.itemId " + " where cis.fofoId = :fofoId and cis.availability > 0 and REPLACE(CONCAT(i.brand,' ', ifnull(i.modelName, ' '), ' ', ifnull(i.modelNumber, ' ')), '  ', ' ')  like CONCAT('%',:query,'%')"),
18
@NamedQueries({@NamedQuery(name = "Item.selectItemByLikes", query = "select new com.spice.profitmandi.common.model.CustomItemModel(" + "	i.id, i.brand, i.modelName, i.modelNumber, i.color" + "	) from Item  i join CurrentInventorySnapshot cis on i.id = cis.itemId " + " where cis.fofoId = :fofoId and cis.availability > 0 and REPLACE(CONCAT(i.brand,' ', ifnull(i.modelName, ' '), ' ', ifnull(i.modelNumber, ' ')), '  ', ' ')  like CONCAT('%',:query,'%')"),
19
 
19
 
20
        @NamedQuery(name = "Item.selectCatalogIdByMopRange", query = "select i.catalogItemId" + " from Item i join TagListing tl on tl.itemId = i.id " + " where tl.mop between :startPrice and :endPrice and  i.categoryId=10006 group by i.catalogItemId"),
20
        @NamedQuery(name = "Item.selectCatalogIdByMopRange", query = "select i.catalogItemId" + " from Item i join TagListing tl on tl.itemId = i.id " + " where tl.mop between :startPrice and :endPrice and  i.categoryId=10006 group by i.catalogItemId"),
21
 
21
 
22
        @NamedQuery(name = "Item.selectAllBrands", query = "select distinct" + "  i.brand from Item i join TagListing tl on tl.itemId = i.id " + " where i.categoryId=:categoryId"), @NamedQuery(name = "Item.selectAllCategories", query = "select distinct" + "  i.categoryId from Item i join TagListing tl on tl.itemId = i.id "), // Model dropdown for scheme / offer creation (/getCatalogDescriptionByBrands).
22
        @NamedQuery(name = "Item.selectAllBrands", query = "select distinct" + "  i.brand from Item i join TagListing tl on tl.itemId = i.id " + " where i.categoryId=:categoryId and (:serializedOnly = false or i.type = :type)"), @NamedQuery(name = "Item.selectAllCategories", query = "select distinct" + "  i.categoryId from Item i join TagListing tl on tl.itemId = i.id "), // Model dropdown for scheme / offer creation (/getCatalogDescriptionByBrands).
23
        // tl.active = true keeps delisted models out. Callers dedupe to catalogItemId,
23
        // tl.active = true keeps delisted models out. Callers dedupe to catalogItemId,
24
        // so this doubles as the model-level rollup: a model whose colours are all
24
        // so this doubles as the model-level rollup: a model whose colours are all
25
        // inactive contributes no rows and drops off the dropdown, while one keeping
25
        // inactive contributes no rows and drops off the dropdown, while one keeping
26
        // any listed colour stays.
26
        // any listed colour stays. serializedOnly = true restricts to IMEI items (scheme payouts are IMEI-driven).
27
        @NamedQuery(name = "Item.selectAllModels", query = "select " + "  i from Item i join TagListing tl on tl.itemId = i.id where i.brand in :brands and i.categoryId = :categoryId and tl.active = true")})
27
        @NamedQuery(name = "Item.selectAllModels", query = "select " + "  i from Item i join TagListing tl on tl.itemId = i.id where i.brand in :brands and i.categoryId = :categoryId and tl.active = true and (:serializedOnly = false or i.type = :type)")})
28
@Entity
28
@Entity
29
@Table(name = "catalog.item")
29
@Table(name = "catalog.item")
30
public class Item implements Serializable {
30
public class Item implements Serializable {
31
 
31
 
32
    public static final List<String> SMART_PG = Arrays.asList("85171300", "85171290");
32
    public static final List<String> SMART_PG = Arrays.asList("85171300", "85171290");