| Line 199... |
Line 199... |
| 199 |
|
199 |
|
| 200 |
@NamedNativeQueries({
|
200 |
@NamedNativeQueries({
|
| 201 |
|
201 |
|
| 202 |
@NamedNativeQuery(name = "Order.selectAllOrderWeight", query = "select i.catalog_item_id from transaction.`order` o join transaction.lineitem li on o.id = li.order_id "
|
202 |
@NamedNativeQuery(name = "Order.selectAllOrderWeight", query = "select i.catalog_item_id from transaction.`order` o join transaction.lineitem li on o.id = li.order_id "
|
| 203 |
+ "join catalog.item i on i.id = li.item_id "
|
203 |
+ "join catalog.item i on i.id = li.item_id "
|
| 204 |
+ "where date(o.created_timestamp) between :startDate and :endDate and o.status = 12 and i.hsnCode = '85171300' "
|
204 |
+ "where date(o.created_timestamp) between :startDate and :endDate and o.status = 12 and i.hsnCode = '85171300' and i.brand != 'Live Demo'"
|
| 205 |
+ " group by i.catalog_item_id order by sum((datediff(now(),o.created_timestamp)/30)*li.quantity) desc"),
|
205 |
+ " group by i.catalog_item_id order by sum((datediff(now(),o.created_timestamp)/30)*li.quantity) desc"),
|
| 206 |
|
206 |
|
| 207 |
@NamedNativeQuery(name = "selectPartnerSecondaryGroupByBrand", query = "select ifnull(a.customer_id,fs.id) as id,ifnull(a.sb,brand) as brand,a.secondary_plan,sum(a.total_price) as total_price,a.auth_id, a.commited_timestamp from "
|
207 |
@NamedNativeQuery(name = "selectPartnerSecondaryGroupByBrand", query = "select ifnull(a.customer_id,fs.id) as id,ifnull(a.sb,brand) as brand,a.secondary_plan,sum(a.total_price) as total_price,a.auth_id, a.commited_timestamp from "
|
| 208 |
+ "fofo.fofo_store fs left join (select o.customer_id , li.brand as sb, li.total_price, psp.fofo_id , psp.brand, psp.secondary_plan,psp.auth_id,psp.commited_timestamp from transaction.`order` o join transaction.lineitem li on "
|
208 |
+ "fofo.fofo_store fs left join (select o.customer_id , li.brand as sb, li.total_price, psp.fofo_id , psp.brand, psp.secondary_plan,psp.auth_id,psp.commited_timestamp from transaction.`order` o join transaction.lineitem li on "
|
| 209 |
+ "(o.id = li.order_id) left join auth.partner_secondary_plan psp on (psp.fofo_id = o.customer_id and date(psp.commited_timestamp) >= :startDate and "
|
209 |
+ "(o.id = li.order_id) left join auth.partner_secondary_plan psp on (psp.fofo_id = o.customer_id and date(psp.commited_timestamp) >= :startDate and "
|