| Line 6... |
Line 6... |
| 6 |
@Entity
|
6 |
@Entity
|
| 7 |
@Table(name = "catalog.customer_offers")
|
7 |
@Table(name = "catalog.customer_offers")
|
| 8 |
|
8 |
|
| 9 |
@NamedQueries({
|
9 |
@NamedQueries({
|
| 10 |
@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("
|
| 11 |
+ " i.id, i.catalogItemId, cast(sum(coi.schemePayout - coi.dealerPayout) as long),coi.offerType)"
|
11 |
+ " i.id, i.catalogItemId, cast(sum(coi.schemePayout - coi.dealerPayout) as long),coi.offerType,coi.additionalInfo)"
|
| 12 |
+ " from CustomerOfferItem coi join Item i on coi.catalogId = i.catalogItemId"
|
12 |
+ " from CustomerOfferItem coi join Item i on coi.catalogId = i.catalogItemId"
|
| 13 |
+ " join CustomerOffer co on co.id=coi.customerOfferId where "
|
13 |
+ " join CustomerOffer co on co.id=coi.customerOfferId where "
|
| 14 |
+ " :date between coi.startDate and coi.endDate and "
|
14 |
+ " :date between coi.startDate and coi.endDate and "
|
| 15 |
+ " :dateTime between co.startDate and co.endDate" + " and i.brand in :brands group by i.id"),
|
15 |
+ " :dateTime between co.startDate and co.endDate" + " and i.brand in :brands group by i.id"),
|
| 16 |
|
16 |
|
| 17 |
@NamedQuery(name = "CustomerOffer.getUpgradeOfferItemsByBrand", query = "select new com.spice.profitmandi.service.pricecircular.PriceCircularItemModel("
|
17 |
@NamedQuery(name = "CustomerOffer.getUpgradeOfferItemsByBrand", query = "select new com.spice.profitmandi.service.pricecircular.PriceCircularItemModel("
|
| 18 |
+ " i.id, i.catalogItemId, cast(max(coi.schemePayout) as long),coi.offerType)"
|
18 |
+ " i.id, i.catalogItemId, cast(max(coi.schemePayout) as long),coi.offerType,coi.additionalInfo)"
|
| 19 |
+ " from CustomerOfferItem coi join Item i on coi.catalogId = i.catalogItemId"
|
19 |
+ " from CustomerOfferItem coi join Item i on coi.catalogId = i.catalogItemId"
|
| 20 |
+ " join CustomerOffer co on co.id=coi.customerOfferId where "
|
20 |
+ " join CustomerOffer co on co.id=coi.customerOfferId where "
|
| 21 |
+ " :date between coi.startDate and coi.endDate and "
|
21 |
+ " :date between coi.startDate and coi.endDate and "
|
| 22 |
+ " :dateTime between co.startDate and co.endDate" + " and i.brand in :brands group by i.catalogItemId,coi.offerType"),
|
22 |
+ " :dateTime between co.startDate and co.endDate" + " and i.brand in :brands group by i.catalogItemId,coi.offerType"),
|
| 23 |
|
23 |
|
| 24 |
@NamedQuery(name = "CustomerOffer.getMaxOfferItemsByBrand", query = "select new com.spice.profitmandi.service.pricecircular.PriceCircularItemModel("
|
24 |
@NamedQuery(name = "CustomerOffer.getMaxOfferItemsByBrand", query = "select new com.spice.profitmandi.service.pricecircular.PriceCircularItemModel("
|
| 25 |
+ " i.id, i.catalogItemId, cast(max(coi.schemePayout) as long),coi.offerType)"
|
25 |
+ " i.id, i.catalogItemId, cast(max(coi.schemePayout) as long),coi.offerType,coi.additionalInfo)"
|
| 26 |
+ " from CustomerOfferItem coi join Item i on coi.catalogId = i.catalogItemId"
|
26 |
+ " from CustomerOfferItem coi join Item i on coi.catalogId = i.catalogItemId"
|
| 27 |
+ " join CustomerOffer co on co.id=coi.customerOfferId where "
|
27 |
+ " join CustomerOffer co on co.id=coi.customerOfferId where "
|
| 28 |
+ " :date between coi.startDate and coi.endDate and "
|
28 |
+ " :date between coi.startDate and coi.endDate and "
|
| 29 |
+ " :dateTime between co.startDate and co.endDate" + " and i.brand in :brands group by i.id"),
|
29 |
+ " :dateTime between co.startDate and co.endDate" + " and i.brand in :brands group by i.id"),
|
| 30 |
})
|
30 |
})
|