Subversion Repositories SmartDukaan

Rev

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

Rev 34390 Rev 34412
Line 107... Line 107...
107
 
107
 
108
 
108
 
109
        @NamedNativeQuery(name = "FofoOrder.getLastTertiaryOrders", query = "select fo.fofo_id, Max(fo.create_timestamp) as maxdate from fofo.fofo_order fo where fo.cancelled_timestamp is null group by fofo_id", resultSetMapping = "LastTertiaryDays"),
109
        @NamedNativeQuery(name = "FofoOrder.getLastTertiaryOrders", query = "select fo.fofo_id, Max(fo.create_timestamp) as maxdate from fofo.fofo_order fo where fo.cancelled_timestamp is null group by fofo_id", resultSetMapping = "LastTertiaryDays"),
110
 
110
 
111
        @NamedNativeQuery(name = "FofoOrder.getCatalogSoldQtyLastDaysByDate", query = "" +
111
        @NamedNativeQuery(name = "FofoOrder.getCatalogSoldQtyLastDaysByDate", query = "" +
112
                " SELECT i.catalog_item_id,fo.fofo_id, i.model_number, SUM(foi.quantity) AS total_quantity_sold FROM fofo.fofo_order fo" +
112
                " SELECT i.catalog_item_id,fo.fofo_id, i.model_number,i.brand, SUM(foi.quantity) AS total_quantity_sold FROM fofo.fofo_order fo" +
113
                " LEFT JOIN fofo.fofo_order_item foi ON foi.order_id = fo.id " +
113
                " LEFT JOIN fofo.fofo_order_item foi ON foi.order_id = fo.id " +
114
                " JOIN catalog.item i ON i.id = foi.item_id " +
114
                " JOIN catalog.item i ON i.id = foi.item_id " +
115
                " WHERE fo.fofo_id = :fofoId AND fo.create_timestamp >= :cutOffDate AND i.catalog_item_id IN (:catalogIds) " +
115
                " WHERE fo.fofo_id = :fofoId AND fo.create_timestamp >= :cutOffDate AND i.catalog_item_id IN (:catalogIds) " +
116
                " GROUP BY i.catalog_item_id", resultSetMapping = "lastDaysSoldQtyByDateAndCatalogId"),
116
                " GROUP BY i.catalog_item_id", resultSetMapping = "lastDaysSoldQtyByDateAndCatalogId"),
117
 
117
 
Line 125... Line 125...
125
        @SqlResultSetMapping(name = "lastDaysSoldQtyByDateAndCatalogId", classes = {
125
        @SqlResultSetMapping(name = "lastDaysSoldQtyByDateAndCatalogId", classes = {
126
                @ConstructorResult(targetClass = DateWiseSoldCatalogQtyModel.class, columns = {
126
                @ConstructorResult(targetClass = DateWiseSoldCatalogQtyModel.class, columns = {
127
                        @ColumnResult(name = "catalog_item_id", type = Integer.class),
127
                        @ColumnResult(name = "catalog_item_id", type = Integer.class),
128
                        @ColumnResult(name = "fofo_id", type = Integer.class),
128
                        @ColumnResult(name = "fofo_id", type = Integer.class),
129
                        @ColumnResult(name = "model_number", type = String.class),
129
                        @ColumnResult(name = "model_number", type = String.class),
-
 
130
                        @ColumnResult(name = "brand", type = String.class),
130
                        @ColumnResult(name = "total_quantity_sold", type = Integer.class),
131
                        @ColumnResult(name = "total_quantity_sold", type = Integer.class),
131
 
132
 
132
                })}),
133
                })}),
133
})
134
})
134
 
135