Subversion Repositories SmartDukaan

Rev

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

Rev 30195 Rev 30641
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;
-
 
4
 
-
 
5
import javax.persistence.*;
3
import java.io.Serializable;
6
import java.io.Serializable;
4
import java.time.LocalDate;
7
import java.time.LocalDate;
5
import java.time.LocalDateTime;
8
import java.time.LocalDateTime;
6
import java.time.format.DateTimeFormatter;
9
import java.time.format.DateTimeFormatter;
7
 
10
 
8
import javax.persistence.Column;
-
 
9
import javax.persistence.Convert;
-
 
10
import javax.persistence.Entity;
-
 
11
import javax.persistence.GeneratedValue;
-
 
12
import javax.persistence.GenerationType;
-
 
13
import javax.persistence.Id;
-
 
14
import javax.persistence.NamedQueries;
-
 
15
import javax.persistence.NamedQuery;
-
 
16
import javax.persistence.Table;
-
 
17
import javax.persistence.Transient;
-
 
18
 
-
 
19
import com.spice.profitmandi.dao.convertor.LocalDateTimeAttributeConverter;
-
 
20
 
-
 
21
@Entity
11
@Entity
22
@Table(name = "fofo.fofo_order", schema = "fofo")
12
@Table(name = "fofo.fofo_order", schema = "fofo")
23
 
13
 
24
@NamedQueries({
14
@NamedQueries({
25
 
15
 
26
		@NamedQuery(name = "FofoOrder.SelectItemWiseTertiary", query = "select new com.spice.profitmandi.dao.model.ItemWiseTertiaryModel(foi.brand,"
16
		@NamedQuery(name = "FofoOrder.SelectItemWiseTertiary", query = "select new com.spice.profitmandi.dao.model.ItemWiseTertiaryModel(foi.brand,"
27
				+ "foi.modelName, foi.modelNumber, foi.color, foi.quantity, foi.mop)"
17
				+ "foi.modelName, foi.modelNumber, foi.color, foi.quantity, foi.mop)"
28
				+ " from FofoOrder fo join FofoOrderItem foi on fo.id = foi.orderId where fo.cancelledTimestamp is null and fo.fofoId = :fofoId"
18
				+ " from FofoOrder fo join FofoOrderItem foi on fo.id = foi.orderId where fo.cancelledTimestamp is null and fo.fofoId = :fofoId"
29
				+ " and fo.createTimestamp between :startDate and :endDate"),
19
				+ " and fo.createTimestamp between :startDate and :endDate"),
30
 
20
 
-
 
21
		@NamedQuery(name = "FofoOrder.selectOrderByModelsAndSaleBetween", query = "select fo from FofoOrder fo join FofoOrderItem foi on fo.id = foi.orderId"
-
 
22
				+ " join Item i on i.id=foi.itemId where fo.cancelledTimestamp is null and i.catalogItemId in :catalogItemIds"
-
 
23
				+ " and fo.createTimestamp between :startDate and :endDate"),
-
 
24
 
31
		@NamedQuery(name = "FofoOrder.selectGroupByBrandPartnerTertiary", query = "select new com.spice.profitmandi.dao.model.BrandWiseTertiaryModel(foi.brand, "
25
		@NamedQuery(name = "FofoOrder.selectGroupByBrandPartnerTertiary", query = "select new com.spice.profitmandi.dao.model.BrandWiseTertiaryModel(foi.brand, "
32
				+ "sum(case when foi.createTimestamp >= :today then CAST(foi.quantity*foi.mop  AS int) else 0 end),"
26
				+ "sum(case when foi.createTimestamp >= :today then CAST(foi.quantity*foi.mop  AS int) else 0 end),"
33
				+ "sum(case when foi.createTimestamp >= :threedays  and foi.createTimestamp < :endDate  then CAST(foi.quantity*foi.mop  AS int) else 0 end),"
27
				+ "sum(case when foi.createTimestamp >= :threedays  and foi.createTimestamp < :endDate  then CAST(foi.quantity*foi.mop  AS int) else 0 end),"
34
				+ "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :mtd  then CAST(foi.quantity*foi.mop  AS int) else 0 end),"
28
				+ "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :mtd  then CAST(foi.quantity*foi.mop  AS int) else 0 end),"
35
				+ "sum(case when foi.createTimestamp between  :lmtdStartDate and :lmtdEndDate  then CAST(foi.quantity*foi.mop  AS int) else 0 end),"
29
				+ "sum(case when foi.createTimestamp between  :lmtdStartDate and :lmtdEndDate  then CAST(foi.quantity*foi.mop  AS int) else 0 end),"