Subversion Repositories SmartDukaan

Rev

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

Rev 34287 Rev 34384
Line 1... Line 1...
1
package com.spice.profitmandi.dao.entity.fofo;
1
package com.spice.profitmandi.dao.entity.fofo;
2
 
2
 
3
import com.spice.profitmandi.dao.convertor.LocalDateTimeAttributeConverter;
3
import com.spice.profitmandi.dao.convertor.LocalDateTimeAttributeConverter;
-
 
4
import com.spice.profitmandi.dao.model.DateWiseSoldCatalogQtyModel;
4
import com.spice.profitmandi.dao.model.LastSaleDateModel;
5
import com.spice.profitmandi.dao.model.LastSaleDateModel;
5
 
6
 
6
import javax.persistence.*;
7
import javax.persistence.*;
7
import java.io.Serializable;
8
import java.io.Serializable;
8
import java.time.LocalDate;
9
import java.time.LocalDate;
Line 87... Line 88...
87
        @NamedNativeQuery(name = "FofoOrder.getLastTertiaryByFofoId", query = "select Max(fo.create_timestamp) from  fofo.fofo_order fo where fo.fofo_id = :fofoId and fo.cancelled_timestamp is null"),
88
        @NamedNativeQuery(name = "FofoOrder.getLastTertiaryByFofoId", query = "select Max(fo.create_timestamp) from  fofo.fofo_order fo where fo.fofo_id = :fofoId and fo.cancelled_timestamp is null"),
88
 
89
 
89
 
90
 
90
        @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"),
91
        @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"),
91
 
92
 
-
 
93
        @NamedNativeQuery(name = "FofoOrder.getCatalogSoldQtyLastDaysByDate", query = "" +
-
 
94
                " SELECT i.catalog_item_id,fo.fofo_id, i.model_number, SUM(foi.quantity) AS total_quantity_sold FROM fofo.fofo_order fo" +
-
 
95
                " LEFT JOIN fofo.fofo_order_item foi ON foi.order_id = fo.id " +
-
 
96
                " JOIN catalog.item i ON i.id = foi.item_id " +
-
 
97
                " WHERE fo.fofo_id = :fofoId AND fo.create_timestamp >= :cutOffDate AND i.catalog_item_id IN (:catalogIds) " +
-
 
98
                " GROUP BY i.catalog_item_id", resultSetMapping = "lastDaysSoldQtyByDateAndCatalogId"),
-
 
99
 
92
 
100
 
93
})
101
})
94
 
102
 
95
@SqlResultSetMappings({
103
@SqlResultSetMappings({
96
 
104
 
97
        @SqlResultSetMapping(name = "LastTertiaryDays", classes = {@ConstructorResult(targetClass = LastSaleDateModel.class, columns = {@ColumnResult(name = "fofo_id", type = Integer.class), @ColumnResult(name = "maxdate ", type = LocalDateTime.class)})})
105
        @SqlResultSetMapping(name = "LastTertiaryDays", classes = {@ConstructorResult(targetClass = LastSaleDateModel.class, columns = {@ColumnResult(name = "fofo_id", type = Integer.class), @ColumnResult(name = "maxdate ", type = LocalDateTime.class)})}),
-
 
106
 
-
 
107
        @SqlResultSetMapping(name = "lastDaysSoldQtyByDateAndCatalogId", classes = {
-
 
108
                @ConstructorResult(targetClass = DateWiseSoldCatalogQtyModel.class, columns = {
-
 
109
                        @ColumnResult(name = "catalog_item_id", type = Integer.class),
-
 
110
                        @ColumnResult(name = "fofo_id", type = Integer.class),
-
 
111
                        @ColumnResult(name = "model_number", type = String.class),
-
 
112
                        @ColumnResult(name = "total_quantity_sold", type = Integer.class),
98
 
113
 
-
 
114
                })}),
99
})
115
})
100
 
116
 
101
public class FofoOrder implements Serializable {
117
public class FofoOrder implements Serializable {
102
 
118
 
103
    private static final long serialVersionUID = 1L;
119
    private static final long serialVersionUID = 1L;