| Line 26... |
Line 26... |
| 26 |
" join PartnerRegion pr on pr.regionId=sr.regionId" +
|
26 |
" join PartnerRegion pr on pr.regionId=sr.regionId" +
|
| 27 |
" where pr.fofoId in :fofoIds and s.partnerType in :partnerTypes" +
|
27 |
" where pr.fofoId in :fofoIds and s.partnerType in :partnerTypes" +
|
| 28 |
" and si.catalogId in :catalogIds" +
|
28 |
" and si.catalogId in :catalogIds" +
|
| 29 |
" and :onDate between s.startDateTime and s.endDateTime" +
|
29 |
" and :onDate between s.startDateTime and s.endDateTime" +
|
| 30 |
//" and s.endDateTime >= :onDate" +
|
30 |
//" and s.endDateTime >= :onDate" +
|
| 31 |
" and s.activeTimestamp is not null"),
|
31 |
" and s.activeTimestamp is not null")
|
| - |
|
32 |
|
| - |
|
33 |
/*,
|
| - |
|
34 |
@NamedQuery(name="scheme.getImeiMarginsPaidOnBillingMonth", query= "select new com.spice.profitmandi.dao.repository.catalog.ImeiMarginModel(" +
|
| - |
|
35 |
") from LineItemImei li1" +
|
| - |
|
36 |
" left join LineItemImei li2 on (li1.serialNumber = li2.serialNumber and li1.id < li2.id)" +
|
| - |
|
37 |
" join LineItem li on li.id = li1.lineItemId" +
|
| - |
|
38 |
" join Order o on o.id = li.orderId" +
|
| - |
|
39 |
" join Item ci on li.itemId = ci.id" +
|
| - |
|
40 |
" join SchemeItem si on si.catalogId = ci.catalogItemId" +
|
| - |
|
41 |
" join Scheme s1 on s1.id = si.schemeId" +
|
| - |
|
42 |
" join SchemeRegion sr on sr.schemeId = s1.id" +
|
| - |
|
43 |
" join PartnerRegion pr on (pr.regionId = sr.regionId and pr.fofoId in (0, o.id))" +
|
| - |
|
44 |
" left join PartnerTypeChange ptc on ptc.fofoId = o.retailerId" +
|
| - |
|
45 |
" left join PartnerTypeChange ptc2 on (ptc2.fofoId = ptc.fofoId and ptc.createTimestamp < ptc2.createTimestamp)" +
|
| - |
|
46 |
"where li2.id is null" +
|
| - |
|
47 |
" and ptc2.createTimestamp is null" +
|
| - |
|
48 |
" and o.billing_timestamp between :startDate and :endDate" +
|
| - |
|
49 |
" and '2022-12-01' between s1.start_date_time and s1.end_date_time" +
|
| - |
|
50 |
" and ((ptc.partnerType is null and s1.partner_type in ('ALL', 'NEW'))" +
|
| - |
|
51 |
" or s1.partnerType in (ptc.partnerType, 'ALL'))" +
|
| - |
|
52 |
" and s1.activeTimestamp is not null" +
|
| - |
|
53 |
" and s1.amountType = 'PERCENTAGE'" +
|
| - |
|
54 |
"group by li.serial_number) as set1\n" +
|
| - |
|
55 |
"")*/
|
| - |
|
56 |
|
| - |
|
57 |
|
| 32 |
})
|
58 |
})
|
| 33 |
|
59 |
|
| 34 |
@NamedNativeQueries({
|
60 |
@NamedNativeQueries({
|
| 35 |
@NamedNativeQuery(name = "scheme.selectMissedActivationSale",
|
61 |
@NamedNativeQuery(name = "scheme.selectMissedActivationSale",
|
| 36 |
query = "select cs.id as scheme_id, ai.serial_number, sr.order_id, ii.id as inventory_item_id, ai.activation_timestamp" +
|
62 |
query = "select cs.id as scheme_id, ai.serial_number, sr.order_id, ii.id as inventory_item_id, ai.activation_timestamp" +
|