| Line 92... |
Line 92... |
| 92 |
"AND fo.fofoId = :fofoId " +
|
92 |
"AND fo.fofoId = :fofoId " +
|
| 93 |
"AND foi.brand = :brand " +
|
93 |
"AND foi.brand = :brand " +
|
| 94 |
"AND fo.cancelledTimestamp IS NULL " +
|
94 |
"AND fo.cancelledTimestamp IS NULL " +
|
| 95 |
"AND i.categoryId = 10006 " +
|
95 |
"AND i.categoryId = 10006 " +
|
| 96 |
"GROUP BY foi.modelNumber"
|
96 |
"GROUP BY foi.modelNumber"
|
| - |
|
97 |
),
|
| - |
|
98 |
|
| - |
|
99 |
@NamedQuery(name = "FofoOrder.selectPartnerTertiarySales",
|
| - |
|
100 |
query = "select new com.spice.profitmandi.dao.model.PartnerTertiarySalesModel(fo.fofoId, " +
|
| - |
|
101 |
"sum(case when fo.createTimestamp between :lmtdStartDate and :lmtdEndDate then CAST(foi.quantity*foi.mop AS long) else 0L end), " +
|
| - |
|
102 |
"sum(case when fo.createTimestamp between :mtdStartDate and :mtdEndDate then CAST(foi.quantity*foi.mop AS long) else 0L end), " +
|
| - |
|
103 |
"sum(case when fo.createTimestamp between :lmsStartDate and :lmsEndDate then CAST(foi.quantity*foi.mop AS long) else 0L end), " +
|
| - |
|
104 |
"sum(case when fo.createTimestamp between :todayStartDate and :todayEndDate then CAST(foi.quantity*foi.mop AS long) else 0L end), " +
|
| - |
|
105 |
"sum(case when fo.createTimestamp between :last3daysStartDate and :last3daysEndDate then 1L else 0L end)) " +
|
| - |
|
106 |
"FROM FofoOrder fo " +
|
| - |
|
107 |
"JOIN FofoOrderItem foi ON fo.id = foi.orderId " +
|
| - |
|
108 |
"WHERE fo.cancelledTimestamp IS NULL " +
|
| - |
|
109 |
"AND fo.createTimestamp >= :lmtdStartDate " +
|
| - |
|
110 |
"GROUP BY fo.fofoId"
|
| 97 |
)
|
111 |
)
|
| 98 |
|
112 |
|
| 99 |
|
113 |
|
| 100 |
})
|
114 |
})
|
| 101 |
|
115 |
|