Subversion Repositories SmartDukaan

Rev

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

Rev 29845 Rev 30121
Line 1... Line 1...
1
package com.spice.profitmandi.dao.entity.catalog;
1
package com.spice.profitmandi.dao.entity.catalog;
2
 
2
 
-
 
3
import javax.persistence.*;
3
import java.time.LocalDateTime;
4
import java.time.LocalDateTime;
4
 
5
 
5
import javax.persistence.Column;
-
 
6
import javax.persistence.Entity;
-
 
7
import javax.persistence.GeneratedValue;
-
 
8
import javax.persistence.GenerationType;
-
 
9
import javax.persistence.Id;
-
 
10
import javax.persistence.NamedQueries;
-
 
11
import javax.persistence.NamedQuery;
-
 
12
import javax.persistence.Table;
-
 
13
 
-
 
14
@Entity
6
@Entity
15
@Table(name = "catalog.customer_offers", schema = "catalog")
7
@Table(name = "catalog.customer_offers", schema = "catalog")
16
 
8
 
17
@NamedQueries({
9
@NamedQueries({
18
		@NamedQuery(name = "CustomerOffer.getOfferItemsByBrand", query = "select new com.spice.profitmandi.service.pricecircular.PriceCircularItemModel("
10
		@NamedQuery(name = "CustomerOffer.getOfferItemsByBrand", query = "select new com.spice.profitmandi.service.pricecircular.PriceCircularItemModel("
19
				+ " i.id, cast(sum(coi.schemePayout - coi.dealerPayout) as long))"
11
				+ " i.id, i.catalogItemId, cast(sum(coi.schemePayout - coi.dealerPayout) as long))"
20
				+ " from CustomerOfferItem coi join Item i on coi.catalogId = i.catalogItemId"
12
				+ " from CustomerOfferItem coi join Item i on coi.catalogId = i.catalogItemId"
21
				+ " join CustomerOffer co on co.id=coi.customerOfferId where "
13
				+ " join CustomerOffer co on co.id=coi.customerOfferId where "
22
				+ " :date between co.startDate and co.endDate"
14
				+ " :date between co.startDate and co.endDate"
23
				+ " and i.brand in :brands  group by i.id"), })
15
				+ " and i.brand in :brands  group by i.id"), })
24
public class CustomerOffer {
16
public class CustomerOffer {