| Line 33... |
Line 33... |
| 33 |
" and ((sr.type='PURCHASE' and o.schemeType='SELLIN') or (sr.type='SALE' and o.schemeType!='SELLIN'))" +
|
33 |
" and ((sr.type='PURCHASE' and o.schemeType='SELLIN') or (sr.type='SALE' and o.schemeType!='SELLIN'))" +
|
| 34 |
" where op.rejectTimestamp is null and sr.createTimestamp between :startDate and :endDate" +
|
34 |
" where op.rejectTimestamp is null and sr.createTimestamp between :startDate and :endDate" +
|
| 35 |
" and (:brand is null or i.brand=:brand)" +
|
35 |
" and (:brand is null or i.brand=:brand)" +
|
| 36 |
" and (:catalogId is null or i.catalogItemId=:catalogId)" +
|
36 |
" and (:catalogId is null or i.catalogItemId=:catalogId)" +
|
| 37 |
" and op.fofoId=:fofoId" +
|
37 |
" and op.fofoId=:fofoId" +
|
| 38 |
" group by ii.id "),
|
38 |
" group by ii.id, sr.type "),
|
| 39 |
|
39 |
|
| 40 |
@NamedQuery(name = "OfferPayout.getTotalPayoutsByImei", query = "select new com.spice.profitmandi.common.model.OfferPayoutImeiIncomeModel(" +
|
40 |
@NamedQuery(name = "OfferPayout.getTotalPayoutsByImei", query = "select new com.spice.profitmandi.common.model.OfferPayoutImeiIncomeModel(" +
|
| 41 |
" ii.id, ii.serialNumber, " +
|
41 |
" ii.id, ii.serialNumber, " +
|
| 42 |
" max(case when (sr.type='PURCHASE' and o.schemeType='SELLIN') then sr.createTimestamp end)," +
|
42 |
" max(case when (sr.type='PURCHASE' and o.schemeType='SELLIN') then sr.createTimestamp end)," +
|
| 43 |
" max(case when (sr.type='SALE' and o.schemeType != 'SELLIN') then sr.createTimestamp end), " +
|
43 |
" max(case when (sr.type='SALE' and o.schemeType != 'SELLIN') then sr.createTimestamp end), " +
|