Subversion Repositories SmartDukaan

Rev

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

Rev 28568 Rev 28641
Line 1... Line 1...
1
package com.spice.profitmandi.dao.entity.transaction;
1
package com.spice.profitmandi.dao.entity.transaction;
2
 
2
 
3
import java.io.Serializable;
3
import java.io.Serializable;
4
import java.time.LocalDateTime;
4
import java.time.LocalDateTime;
5
import java.time.format.DateTimeFormatter;
5
import java.time.format.DateTimeFormatter;
-
 
6
import java.util.ArrayList;
-
 
7
import java.util.List;
6
 
8
 
7
import javax.persistence.Column;
9
import javax.persistence.Column;
8
import javax.persistence.Convert;
10
import javax.persistence.Convert;
9
import javax.persistence.Entity;
11
import javax.persistence.Entity;
10
import javax.persistence.GeneratedValue;
12
import javax.persistence.GeneratedValue;
Line 35... Line 37...
35
				+ "   DATE_FORMAT(pd.affectedOn, '%m-%Y'),sum(cast(pd.amount As int)) ) from PriceDrop pd join  PriceDropIMEI pdi  on"
37
				+ "   DATE_FORMAT(pd.affectedOn, '%m-%Y'),sum(cast(pd.amount As int)) ) from PriceDrop pd join  PriceDropIMEI pdi  on"
36
				+ " (pd.id = pdi.priceDropId) join InventoryItem it  on (pdi.imei = it.serialNumber and pdi.partnerId=it.fofoId)"
38
				+ " (pd.id = pdi.priceDropId) join InventoryItem it  on (pdi.imei = it.serialNumber and pdi.partnerId=it.fofoId)"
37
				+ " join Item i on i.id = it.itemId where pdi.status ='PENDING' and pdi.partnerId = :fofoId and "
39
				+ " join Item i on i.id = it.itemId where pdi.status ='PENDING' and pdi.partnerId = :fofoId and "
38
				+ " pd.amount > 0 and pd.affectedOn >= :startDate group by i.brand, DATE_FORMAT(pd.affectedOn, '%m-%Y')"),
40
				+ " pd.amount > 0 and pd.affectedOn >= :startDate group by i.brand, DATE_FORMAT(pd.affectedOn, '%m-%Y')"),
39
 
41
 
-
 
42
		@NamedQuery(name = "PriceDrop.selectSixMonthBrandPriceDropByYearMonth", query = "select new com.spice.profitmandi.dao.model.PriceDropBrandModel(i.brand, "
-
 
43
				+ " sum(cast(pd.amount As int)) ) from PriceDrop pd join  PriceDropIMEI pdi  on"
-
 
44
				+ " (pd.id = pdi.priceDropId) join InventoryItem it on (pdi.imei = it.serialNumber and pdi.partnerId=it.fofoId)"
-
 
45
				+ " join Item i on i.id = it.itemId where pdi.status ='PENDING' and pdi.partnerId = :fofoId and "
-
 
46
				+ " pd.amount > 0 and pd.affectedOn >= :startDate and pd.affectedOn <= :endDate group by i.brand"),
-
 
47
 
-
 
48
		
40
		@NamedQuery(name = "PriceDrop.selectBrandPendingPriceDropWithDetailsByYearMonth", query = "select new com.spice.profitmandi.dao.model.PriceDropWithDetailsByYearMonthModel(i.brand, "
49
		@NamedQuery(name = "PriceDrop.selectBrandPendingPriceDropWithDetailsByYearMonth", query = "select new com.spice.profitmandi.dao.model.PriceDropWithDetailsByYearMonthModel(i.brand, "
41
				+ "  i.modelName,i.modelNumber,cast(pd.amount As int),pdi.imei ) from PriceDrop pd join  PriceDropIMEI pdi  on"
50
				+ "  i.modelName,i.modelNumber,cast(pd.amount As int),pdi.imei ) from PriceDrop pd join  PriceDropIMEI pdi  on"
42
				+ " (pd.id = pdi.priceDropId) join InventoryItem it  on (pdi.imei = it.serialNumber and pdi.partnerId=it.fofoId)"
51
				+ " (pd.id = pdi.priceDropId) join InventoryItem it  on (pdi.imei = it.serialNumber and pdi.partnerId=it.fofoId)"
43
				+ " join Item i on i.id = it.itemId where pdi.status ='PENDING' and pdi.partnerId = :fofoId and "
52
				+ " join Item i on i.id = it.itemId where pdi.status ='PENDING' and pdi.partnerId = :fofoId and "
44
				+ " pd.amount > 0  and i.brand = :brand and DATE_FORMAT(pd.affectedOn, '%m-%Y') = :yearMonthValue"),
53
				+ " pd.amount > 0  and i.brand = :brand and DATE_FORMAT(pd.affectedOn, '%m-%Y') = :yearMonthValue"),
-
 
54
		
-
 
55
		@NamedQuery(name = "PriceDrop.selectBrandPendingPriceDropWithDetailsAndSixMonth", query = "select new com.spice.profitmandi.dao.model.PriceDropWithDetailsByYearMonthModel(i.brand, "
-
 
56
				+ "  i.modelName,i.modelNumber,cast(pd.amount As int),pdi.imei ) from PriceDrop pd join  PriceDropIMEI pdi  on"
-
 
57
				+ " (pd.id = pdi.priceDropId) join InventoryItem it  on (pdi.imei = it.serialNumber and pdi.partnerId=it.fofoId)"
-
 
58
				+ " join Item i on i.id = it.itemId where pdi.status ='PENDING' and pdi.partnerId = :fofoId and "
-
 
59
				+ " pd.amount > 0  and i.brand = :brand and pd.affectedOn >= :startDate and pd.affectedOn <= :endDate"),
-
 
60
 
45
 
61
 
46
})
62
})
47
public class PriceDrop implements Serializable {
63
public class PriceDrop implements Serializable {
48
 
64
 
49
	private static final long serialVersionUID = 1L;
65
	private static final long serialVersionUID = 1L;
Line 126... Line 142...
126
 
142
 
127
	public void setNlc(float nlc) {
143
	public void setNlc(float nlc) {
128
		this.nlc = nlc;
144
		this.nlc = nlc;
129
	}
145
	}
130
 
146
 
-
 
147
	
131
	@Column(name = "credit_note_number")
148
	@Column(name = "credit_note_number")
132
	private String creditNoteNumber;
149
	private String creditNoteNumber;
133
 
150
 
134
	@Convert(converter = LocalDateTimeAttributeConverter.class)
151
	@Convert(converter = LocalDateTimeAttributeConverter.class)
135
	@Column(name = "process_timestamp")
152
	@Column(name = "process_timestamp")