Subversion Repositories SmartDukaan

Rev

Rev 37077 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 37077 Rev 37089
Line 268... Line 268...
268
 
268
 
269
        @NamedNativeQuery(name = "Order.selectCreateToBillingAvg", query = "select o.customer_id, avg(DATEDIFF(o.billing_timestamp,o.created_timestamp)) as average from transaction.`order` o join fofo.fofo_store fs on o.customer_id = fs.id where date(o.created_timestamp) between :startDate and :endDate  and  o.billing_timestamp is not null and fs.internal = 0  group by o.customer_id", resultSetMapping = "BillingDaysAvg"),
269
        @NamedNativeQuery(name = "Order.selectCreateToBillingAvg", query = "select o.customer_id, avg(DATEDIFF(o.billing_timestamp,o.created_timestamp)) as average from transaction.`order` o join fofo.fofo_store fs on o.customer_id = fs.id where date(o.created_timestamp) between :startDate and :endDate  and  o.billing_timestamp is not null and fs.internal = 0  group by o.customer_id", resultSetMapping = "BillingDaysAvg"),
270
 
270
 
271
        @NamedNativeQuery(name = "Order.selectBillingToDeliverAvg", query = "select o.customer_id, avg(DATEDIFF(o.delivery_timestamp,o.billing_timestamp)) as average  from transaction.`order` o join fofo.fofo_store fs on o.customer_id = fs.id where date(o.created_timestamp) between :startDate and :endDate  and  o.billing_timestamp is not null and o.delivery_timestamp is not null and fs.internal = 0 group by o.customer_id", resultSetMapping = "BillingDaysAvg"),
271
        @NamedNativeQuery(name = "Order.selectBillingToDeliverAvg", query = "select o.customer_id, avg(DATEDIFF(o.delivery_timestamp,o.billing_timestamp)) as average  from transaction.`order` o join fofo.fofo_store fs on o.customer_id = fs.id where date(o.created_timestamp) between :startDate and :endDate  and  o.billing_timestamp is not null and o.delivery_timestamp is not null and fs.internal = 0 group by o.customer_id", resultSetMapping = "BillingDaysAvg"),
272
 
272
 
-
 
273
        @NamedNativeQuery(name = "Order.selectCreateToBillingAvgByFofoId", query = "select o.customer_id, avg(DATEDIFF(o.billing_timestamp,o.created_timestamp)) as average from transaction.`order` o join fofo.fofo_store fs on o.customer_id = fs.id where o.customer_id = :fofoId and date(o.created_timestamp) between :startDate and :endDate  and  o.billing_timestamp is not null and fs.internal = 0  group by o.customer_id", resultSetMapping = "BillingDaysAvg"),
-
 
274
 
-
 
275
        @NamedNativeQuery(name = "Order.selectBillingToDeliverAvgByFofoId", query = "select o.customer_id, avg(DATEDIFF(o.delivery_timestamp,o.billing_timestamp)) as average  from transaction.`order` o join fofo.fofo_store fs on o.customer_id = fs.id where o.customer_id = :fofoId and date(o.created_timestamp) between :startDate and :endDate  and  o.billing_timestamp is not null and o.delivery_timestamp is not null and fs.internal = 0 group by o.customer_id", resultSetMapping = "BillingDaysAvg"),
-
 
276
 
273
 
277
 
274
        @NamedNativeQuery(name = "Order.getLastOrders", query = "select o.customer_id, Max(o.created_timestamp) as maxdate  from transaction.`order` o join fofo.fofo_store fs on  fs.id = o.customer_id where o.status in (7,9,10,12) and o.delivery_timestamp is not null and fs.internal = 0 group by o.customer_id", resultSetMapping = "LastSaleDays"),
278
        @NamedNativeQuery(name = "Order.getLastOrders", query = "select o.customer_id, Max(o.created_timestamp) as maxdate  from transaction.`order` o join fofo.fofo_store fs on  fs.id = o.customer_id where o.status in (7,9,10,12) and o.delivery_timestamp is not null and fs.internal = 0 group by o.customer_id", resultSetMapping = "LastSaleDays"),
275
 
279
 
276
        @NamedNativeQuery(name = "Order.itemAvailability", query = "select grouped.item_id, " +
280
        @NamedNativeQuery(name = "Order.itemAvailability", query = "select grouped.item_id, " +
277
                "       grouped.vendor_warehouse_id, " +
281
                "       grouped.vendor_warehouse_id, " +