Subversion Repositories SmartDukaan

Rev

Rev 35154 | Rev 35172 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 35154 Rev 35155
Line 1... Line 1...
1
package com.spice.profitmandi.dao.entity.transaction;
1
package com.spice.profitmandi.dao.entity.transaction;
2
 
2
 
3
import com.spice.profitmandi.dao.convertor.LocalDateTimeAttributeConverter;
3
import com.spice.profitmandi.dao.convertor.LocalDateTimeAttributeConverter;
4
import com.spice.profitmandi.dao.model.BillingDaysAvg;
4
import com.spice.profitmandi.dao.model.*;
5
import com.spice.profitmandi.dao.model.LastSaleDateModel;
-
 
6
import com.spice.profitmandi.dao.model.PartnerSecondaryPlanModel;
-
 
7
import com.spice.profitmandi.dao.model.PriceDropReportModel;
-
 
8
import com.spice.profitmandi.model.WarehouseItemQtyModel;
5
import com.spice.profitmandi.model.WarehouseItemQtyModel;
9
import in.shop2020.model.v1.order.OrderStatus;
6
import in.shop2020.model.v1.order.OrderStatus;
10
import in.shop2020.model.v1.order.TaxType;
7
import in.shop2020.model.v1.order.TaxType;
11
 
8
 
12
import javax.persistence.*;
9
import javax.persistence.*;
Line 94... Line 91...
94
        @NamedQuery(name = "Order.selectGrnPendingOrderQtyByCatalogId", query = "select sum(case when li.quantity is null then 0 else  li.quantity end)" + "  from FofoStore fs join  Order o on fs.id = o.retailerId " + "  join LineItem li on o.id = li.orderId  join TagListing tl on tl.itemId = li.itemId " + "  join Item i on (i.id = tl.itemId ) where  fs.active = true and fs.internal = false and" + "  o.billingTimestamp is not null and o.refundTimestamp is null and o.partnerGrnTimestamp is null" + "  and i.catalogItemId = :catalogItemId and fs.id = :fofoId group by i.catalogItemId, fs.id"),
91
        @NamedQuery(name = "Order.selectGrnPendingOrderQtyByCatalogId", query = "select sum(case when li.quantity is null then 0 else  li.quantity end)" + "  from FofoStore fs join  Order o on fs.id = o.retailerId " + "  join LineItem li on o.id = li.orderId  join TagListing tl on tl.itemId = li.itemId " + "  join Item i on (i.id = tl.itemId ) where  fs.active = true and fs.internal = false and" + "  o.billingTimestamp is not null and o.refundTimestamp is null and o.partnerGrnTimestamp is null" + "  and i.catalogItemId = :catalogItemId and fs.id = :fofoId group by i.catalogItemId, fs.id"),
95
 
92
 
96
        @NamedQuery(name = "Order.selectPendingIndentOrderQtyByCatalogId", query = "select sum(case when li.quantity is null then 0 else  li.quantity end)" + "	 from FofoStore fs  join  Order o on fs.id = o.retailerId" + "  join LineItem li on o.id = li.orderId " + "  join TagListing tl on tl.itemId = li.itemId " + "  join Item i on i.id = tl.itemId  where " + "	 fs.active = true and fs.internal = false and o.status in (3,4)and i.catalogItemId = :catalogItemId and fs.id = :fofoId group by i.catalogItemId, fs.id"),
93
        @NamedQuery(name = "Order.selectPendingIndentOrderQtyByCatalogId", query = "select sum(case when li.quantity is null then 0 else  li.quantity end)" + "	 from FofoStore fs  join  Order o on fs.id = o.retailerId" + "  join LineItem li on o.id = li.orderId " + "  join TagListing tl on tl.itemId = li.itemId " + "  join Item i on i.id = tl.itemId  where " + "	 fs.active = true and fs.internal = false and o.status in (3,4)and i.catalogItemId = :catalogItemId and fs.id = :fofoId group by i.catalogItemId, fs.id"),
97
 
94
 
98
        @NamedQuery(name = "Order.selectTodayOrders", query = "select new com.spice.profitmandi.dao.model.BrandRegionPOModel(" + " case when (pr.regionId is not null) then pr.regionId else fs.warehouseId end  , li.brand, " + " sum(case when (o.createTimestamp between :startDate and :endDate and o.refundTimestamp is null) then cast(o.totalAmount AS integer ) else 0 end)," + " sum(case when (o.billingTimestamp is not null and (o.createTimestamp between :startDate and :endDate)) then cast(o.totalAmount AS integer) else 0 end)," + " sum(case when o.billingTimestamp is not null then cast(o.totalAmount AS integer ) else 0 end))" + "	from Order o join LineItem li on o.id = li.orderId join FofoStore fs on fs.id = o.retailerId" + " left join PartnerRegion pr on pr.fofoId=o.retailerId and pr.regionId=18" + " where o.refundTimestamp is null and ((o.createTimestamp between :startDate and :endDate) or (o.billingTimestamp between :startDate and :endDate)) and fs.internal = false and li.brand not in ('Smartdukaan','Dummy')" + " group by case when (pr.regionId is not null) then pr.regionId else fs.warehouseId end, li.brand"),
95
        @NamedQuery(name = "Order.selectTodayOrders", query = "select new com.spice.profitmandi.dao.model.BrandRegionPOModel(" + " case when (pr.regionId is not null) then pr.regionId else fs.warehouseId end  , li.brand, " + " sum(case when (o.createTimestamp between :startDate and :endDate and o.refundTimestamp is null) then cast(o.totalAmount AS integer ) else 0 end)," + " sum(case when (o.billingTimestamp is not null and (o.createTimestamp between :startDate and :endDate)) then cast(o.totalAmount AS integer) else 0 end)," + " sum(case when o.billingTimestamp is not null then cast(o.totalAmount AS integer ) else 0 end))" + "	from Order o join LineItem li on o.id = li.orderId join FofoStore fs on fs.id = o.retailerId" + " left join PartnerRegion pr on pr.fofoId=o.retailerId and pr.regionId=18" + " where o.refundTimestamp is null and ((o.createTimestamp between :startDate and :endDate) or (o.billingTimestamp between :startDate and :endDate)) and fs.internal = false and li.brand not in ('Smartdukaan','Dummy')" + " group by case when (pr.regionId is not null) then pr.regionId else fs.warehouseId end, li.brand"),
99
        @NamedQuery(name = "Order.selectTodayOrdersRBM", query = "select new  com.spice.profitmandi.dao.model.BrandAuthUserPOModel( p.authUserId,\n" +
96
       /* @NamedQuery(name = "Order.selectTodayOrdersRBM", query = "select new  com.spice.profitmandi.dao.model.BrandAuthUserPOModel( p.authUserId," +
100
                "       li.brand,\n" +
97
                "       li.brand," +
101
                "       sum(case\n" +
98
                "       sum(case" +
102
                "               when (o.createTimestamp between :startDate and :endDate and o.refundTimestamp is null) then cast(o.totalAmount AS integer )\n" +
99
                "               when (o.createTimestamp between :startDate and :endDate and o.refundTimestamp is null) then cast(o.totalAmount AS integer )" +
103
                "               else 0 end),\n" +
100
                "               else 0 end)," +
104
                "       sum(case\n" +
101
                "       sum(case" +
105
                "               when o.billingTimestamp is not null and (o.createTimestamp between :startDate and :endDate)\n" +
102
                "               when o.billingTimestamp is not null and (o.createTimestamp between :startDate and :endDate)" +
106
                "                   then cast(o.totalAmount AS integer )\n" +
103
                "                   then cast(o.totalAmount AS integer )" +
107
                "               else 0 end),\n" +
104
                "               else 0 end)," +
108
                "       sum(case when o.billingTimestamp is not null then cast(o.totalAmount AS integer ) else 0 end)," +
105
                "       sum(case when o.billingTimestamp is not null then cast(o.totalAmount AS integer ) else 0 end)," +
109
                " cast (count(distinct o.retailerId) as int))\n" +
106
                " cast (count(distinct o.retailerId) as int))" +
110
                "from Order o\n" +
107
                "from Order o" +
111
                "         join LineItem li\n" +
108
                "         join LineItem li" +
112
                "              on o.id = li.orderId\n" +
109
                "              on o.id = li.orderId" +
113
                "         join FofoStore fs on fs.id = o.retailerId\n" +
110
                "         join FofoStore fs on fs.id = o.retailerId" +
114
                "         join PartnerPosition pp on pp.fofoId = o.retailerId\n" +
111
                "         join PartnerPosition pp on pp.fofoId = o.retailerId" +
115
                "         join Position p on p.id = pp.positionId\n" +
112
                "         join Position p on p.id = pp.positionId" +
116
                "where o.refundTimestamp is null\n" +
113
                "where o.refundTimestamp is null" +
117
                "  and ((o.createTimestamp between :startDate and :endDate) or (o.billingTimestamp between :startDate and :endDate))\n" +
114
                "  and ((o.createTimestamp between :startDate and :endDate) or (o.billingTimestamp between :startDate and :endDate))" +
118
                "  and fs.internal = false\n" +
115
                "  and fs.internal = false" +
119
                "  and p.categoryId = :categoryId\n" +
116
                "  and p.categoryId = :categoryId" +
120
                "  and p.escalationType = :escalationType\n" +
117
                "  and p.escalationType = :escalationType" +
121
                "  and li.brand not in ('Smartdukaan', 'Dummy', 'FOC', 'Live Demo')\n" +
118
                "  and li.brand not in ('Smartdukaan', 'Dummy', 'FOC', 'Live Demo')" +
122
                "group by p.authUserId, li.brand"),
119
                "group by p.authUserId, li.brand"),
123
 
120
*/
124
        @NamedQuery(name = "Order.selectTodayPartnersBilledRBM", query = "select new  com.spice.profitmandi.dao.model.AuthIdPartnerCountModel( p.authUserId,\n" +
121
        @NamedQuery(name = "Order.selectTodayPartnersBilledRBM", query = "select new  com.spice.profitmandi.dao.model.AuthIdPartnerCountModel( p.authUserId," +
125
                "       cast (count(distinct o.retailerId) as int))\n" +
122
                "       cast (count(distinct o.retailerId) as int))" +
126
                "from Order o\n" +
123
                "from Order o" +
127
                "         join LineItem li\n" +
124
                "         join LineItem li" +
128
                "              on o.id = li.orderId\n" +
125
                "              on o.id = li.orderId" +
129
                "         join FofoStore fs on fs.id = o.retailerId\n" +
126
                "         join FofoStore fs on fs.id = o.retailerId" +
130
                "         join PartnerPosition pp on pp.fofoId = o.retailerId\n" +
127
                "         join PartnerPosition pp on pp.fofoId = o.retailerId" +
131
                "         join Position p on p.id = pp.positionId\n" +
128
                "         join Position p on p.id = pp.positionId" +
132
                "where o.refundTimestamp is null\n" +
129
                " where o.refundTimestamp is null" +
133
                "  and (o.createTimestamp between :startDate and :endDate)\n" +
130
                "  and (o.createTimestamp between :startDate and :endDate)" +
134
                "  and fs.internal = false\n" +
131
                "  and fs.internal = false" +
135
                "  and p.categoryId = 18\n" +
132
                "  and p.categoryId = 18" +
136
                "  and p.escalationType = 'L1'\n" +
133
                "  and p.escalationType = 'L1'" +
137
                "  and li.brand not in ('Smartdukaan', 'Dummy', 'FOC', 'Live Demo')\n" +
134
                "  and li.brand not in ('Smartdukaan', 'Dummy', 'FOC', 'Live Demo')" +
138
                "group by p.authUserId"),
135
                "group by p.authUserId"),
139
 
136
 
140
        @NamedQuery(name = "Order.selectAllPendingIndentAccessoriesTvGroupByFofoId", query = "select new com.spice.profitmandi.dao.model.InStockAccessoriesTvFofoIdModel(" + "  o.retailerId, SUM(case when c.parentCategoryId  = 10011 then CAST(o.totalAmount  AS integer) else 0 end), SUM(case when c.parentCategoryId  = 14200 then  CAST(o.totalAmount  AS integer) else 0 end))" + "	 from  Order o join LineItem li on o.id = li.orderId join Item i on i.id = li.itemId  join Category c on c.id = i.categoryId " + "  where o.retailerId in :fofoIds and o.status in (3,4) and i.categoryId != 10006 group by o.retailerId"),
137
        @NamedQuery(name = "Order.selectAllPendingIndentAccessoriesTvGroupByFofoId", query = "select new com.spice.profitmandi.dao.model.InStockAccessoriesTvFofoIdModel(" + "  o.retailerId, SUM(case when c.parentCategoryId  = 10011 then CAST(o.totalAmount  AS integer) else 0 end), SUM(case when c.parentCategoryId  = 14200 then  CAST(o.totalAmount  AS integer) else 0 end))" + "	 from  Order o join LineItem li on o.id = li.orderId join Item i on i.id = li.itemId  join Category c on c.id = i.categoryId " + "  where o.retailerId in :fofoIds and o.status in (3,4) and i.categoryId != 10006 group by o.retailerId"),
141
 
138
 
142
        @NamedQuery(name = "Order.selectAllGrnPendingAccessoriesTvGroupByFofoId", query = "select new com.spice.profitmandi.dao.model.InStockAccessoriesTvFofoIdModel(" + "  o.retailerId, SUM(case when c.parentCategoryId  = 10011 then CAST(o.totalAmount  AS integer) else 0 end), SUM(case when c.parentCategoryId  = 14200 then  CAST(o.totalAmount  AS integer) else 0 end))" + "	 from  Order o join LineItem li on o.id = li.orderId join Item i on i.id = li.itemId  join Category c on c.id = i.categoryId " + "  where o.retailerId in :fofoIds and o.billingTimestamp is not null and o.refundTimestamp is null and o.partnerGrnTimestamp is null and i.categoryId != 10006 group by o.retailerId"),
139
        @NamedQuery(name = "Order.selectAllGrnPendingAccessoriesTvGroupByFofoId", query = "select new com.spice.profitmandi.dao.model.InStockAccessoriesTvFofoIdModel(" + "  o.retailerId, SUM(case when c.parentCategoryId  = 10011 then CAST(o.totalAmount  AS integer) else 0 end), SUM(case when c.parentCategoryId  = 14200 then  CAST(o.totalAmount  AS integer) else 0 end))" + "	 from  Order o join LineItem li on o.id = li.orderId join Item i on i.id = li.itemId  join Category c on c.id = i.categoryId " + "  where o.retailerId in :fofoIds and o.billingTimestamp is not null and o.refundTimestamp is null and o.partnerGrnTimestamp is null and i.categoryId != 10006 group by o.retailerId"),
Line 269... Line 266...
269
                "        and ii.itemId in :itemIds " +
266
                "        and ii.itemId in :itemIds " +
270
                "        and ii.physicalWarehouseId = :warehouseId " +
267
                "        and ii.physicalWarehouseId = :warehouseId " +
271
                "      group by ii.itemId, ii.currentWarehouseId) as grouped " +
268
                "      group by ii.itemId, ii.currentWarehouseId) as grouped " +
272
                "group by item_id, vendor_warehouse_id", resultSetMapping = "itemAvailabilityReservationMapping"),
269
                "group by item_id, vendor_warehouse_id", resultSetMapping = "itemAvailabilityReservationMapping"),
273
 
270
 
274
        /*@NamedNativeQuery(
271
        @NamedNativeQuery(
275
                name = "Order.selectTodayOrdersRBM",
272
                name = "Order.selectTodayOrdersRBM",
276
                query = "SELECT region_partner_map.auth_user_id as auth_id,\n" +
273
                query = "SELECT COALESCE(region_partner_map.auth_user_id, -1) AS auth_user_id," +
277
                        "       li.brand,\n" +
274
                        "       li.brand," +
278
                        "       SUM(\n" +
275
                        "       SUM(" +
279
                        "               CASE\n" +
276
                        "               CASE" +
280
                        "                   WHEN (o.created_timestamp BETWEEN :startDate AND :endDate and o.refund_timestamp is null)\n" +
277
                        "                   WHEN (o.created_timestamp BETWEEN :startDate AND :endDate and o.refund_timestamp is null)" +
281
                        "                       AND o.refund_timestamp IS NULL\n" +
278
                        "                       AND o.refund_timestamp IS NULL" +
282
                        "                       THEN o.total_amount\n" +
279
                        "                       THEN o.total_amount" +
283
                        "                   ELSE 0\n" +
280
                        "                   ELSE 0" +
284
                        "                   END\n" +
281
                        "                   END" +
285
                        "           )                         AS today_po_value,\n" +
282
                        "           )                         AS today_po_value," +
286
                        "       SUM(\n" +
283
                        "       SUM(" +
287
                        "               CASE\n" +
284
                        "               CASE" +
288
                        "                   WHEN o.billing_timestamp IS NOT NULL\n" +
285
                        "                   WHEN o.billing_timestamp IS NOT NULL" +
289
                        "                       AND (o.created_timestamp BETWEEN :startDate AND :endDate)\n" +
286
                        "                       AND (o.created_timestamp BETWEEN :startDate AND :endDate)" +
290
                        "                       THEN o.total_amount\n" +
287
                        "                       THEN o.total_amount" +
291
                        "                   ELSE 0\n" +
288
                        "                   ELSE 0" +
292
                        "                   END\n" +
289
                        "                   END" +
293
                        "           )                         AS today_billed_value,\n" +
290
                        "           )                         AS today_billed_value," +
294
                        "       SUM(\n" +
291
                        "       SUM(" +
295
                        "               CASE\n" +
292
                        "               CASE" +
296
                        "                   WHEN o.billing_timestamp IS NOT NULL\n" +
293
                        "                   WHEN o.billing_timestamp IS NOT NULL" +
297
                        "                       THEN o.total_amount\n" +
294
                        "                       THEN o.total_amount" +
298
                        "                   ELSE 0\n" +
295
                        "                   ELSE 0" +
299
                        "                   END\n" +
296
                        "                   END" +
300
                        "           )                         AS total_billed_value,\n" +
297
                        "           )                         AS total_billed_value," +
301
                        "       COUNT(DISTINCT o.customer_id) AS partner_count\n" +
298
                        "       COUNT(DISTINCT o.customer_id) AS partner_count" +
302
                        "FROM transaction.`order` o\n" +
299
                        " FROM transaction.`order` o" +
303
                        "         JOIN transaction.lineitem li\n" +
300
                        "         JOIN transaction.lineitem li" +
304
                        "              ON o.id = li.order_id\n" +
301
                        "              ON o.id = li.order_id" +
305
                        "         JOIN fofo.fofo_store fs\n" +
302
                        "         JOIN fofo.fofo_store fs" +
306
                        "              ON fs.id = o.customer_id\n" +
303
                        "              ON fs.id = o.customer_id" +
307
                        "         LEFT JOIN (SELECT ps.position_id,\n" +
304
                        "         LEFT JOIN (SELECT ps.position_id," +
308
                        "                           p.auth_user_id,\n" +
305
                        "                           p.auth_user_id," +
309
                        "                           p.category_id,\n" +
306
                        "                           p.category_id," +
310
                        "                           p.escalation_type,\n" +
307
                        "                           p.escalation_type," +
311
                        "                           COALESCE(pr.fofo_id, ps.partner_id) AS final_retailer_id,\n" +
308
                        "                           COALESCE(pr.fofo_id, ps.partner_id) AS final_retailer_id," +
312
                        "                           ps.region_id\n" +
309
                        "                           ps.region_id" +
313
                        "                    FROM cs.partner_position ps\n" +
310
                        "                    FROM cs.partner_position ps" +
314
                        "                             LEFT JOIN cs.partner_region pr\n" +
311
                        "                             LEFT JOIN cs.partner_region pr" +
315
                        "                                       ON ps.partner_id = 0 AND ps.region_id = pr.region_id\n" +
312
                        "                                       ON ps.partner_id = 0 AND ps.region_id = pr.region_id" +
316
                        "                             left join cs.position p on p.id = ps.position_id\n" +
313
                        "                             left join cs.position p on p.id = ps.position_id" +
317
                        "                    where p.category_id = :categoryId \n" +
314
                        "                    where p.category_id = :categoryId" +
318
                        "                      and p.escalation_type = :escalationType) AS region_partner_map\n" +
315
                        "                      and p.escalation_type = :escalationType) AS region_partner_map" +
319
                        "                   ON region_partner_map.final_retailer_id = fs.id\n" +
316
                        "                   ON region_partner_map.final_retailer_id = fs.id" +
320
                        "\n" +
-
 
321
                        "WHERE o.refund_timestamp IS NULL\n" +
317
                        " WHERE o.refund_timestamp IS NULL" +
322
                        "  AND (\n" +
318
                        "  AND (" +
323
                        "        (o.created_timestamp BETWEEN :startDate AND :endDate)\n" +
319
                        "        (o.created_timestamp BETWEEN :startDate AND :endDate)" +
324
                        "        OR (o.billing_timestamp BETWEEN :startDate AND :endDate)\n" +
320
                        "        OR (o.billing_timestamp BETWEEN :startDate AND :endDate)" +
325
                        "    )\n" +
321
                        "    )" +
326
                        "  AND fs.internal = FALSE\n" +
322
                        "  AND fs.internal = FALSE" +
327
                        "  AND li.brand NOT IN ('Smartdukaan', 'Dummy', 'FOC', 'Live Demo')\n" +
323
                        "  AND li.brand NOT IN ('Smartdukaan', 'Dummy', 'FOC', 'Live Demo')" +
328
                        "GROUP BY region_partner_map.auth_user_id, li.brand\n" +
324
                        "GROUP BY region_partner_map.auth_user_id, li.brand" +
329
                        "ORDER BY region_partner_map.auth_user_id, li.brand;\n" +
325
                        " ORDER BY region_partner_map.auth_user_id, li.brand",
330
                        "\n" +
-
 
331
                        "\n",
-
 
332
                resultSetMapping = "TodayPoByAuthUsers"
326
                resultSetMapping = "TodayPoByAuthUsers"
333
        )*/
327
        )
334
 
328
 
335
 
329
 
336
 
330
 
337
})
331
})
338
 
332
 
Line 347... Line 341...
347
        @SqlResultSetMapping(name = "PriceDropReportModel", classes = {@ConstructorResult(targetClass = PriceDropReportModel.class, columns = {@ColumnResult(name = "code", type = String.class), @ColumnResult(name = "id", type = Integer.class), @ColumnResult(name = "brand", type = String.class), @ColumnResult(name = "model_name", type = String.class), @ColumnResult(name = "model_number", type = String.class), @ColumnResult(name = "affected_on", type = LocalDateTime.class), @ColumnResult(name = "amount", type = Float.class), @ColumnResult(name = "partner_payout", type = Float.class), @ColumnResult(name = "imei", type = String.class), @ColumnResult(name = "status", type = String.class), @ColumnResult(name = "update_timestamp", type = LocalDateTime.class), @ColumnResult(name = "rejection_reason", type = String.class), @ColumnResult(name = "credit_timestamp", type = LocalDateTime.class), @ColumnResult(name = "reject_timestamp", type = LocalDateTime.class)})}),
341
        @SqlResultSetMapping(name = "PriceDropReportModel", classes = {@ConstructorResult(targetClass = PriceDropReportModel.class, columns = {@ColumnResult(name = "code", type = String.class), @ColumnResult(name = "id", type = Integer.class), @ColumnResult(name = "brand", type = String.class), @ColumnResult(name = "model_name", type = String.class), @ColumnResult(name = "model_number", type = String.class), @ColumnResult(name = "affected_on", type = LocalDateTime.class), @ColumnResult(name = "amount", type = Float.class), @ColumnResult(name = "partner_payout", type = Float.class), @ColumnResult(name = "imei", type = String.class), @ColumnResult(name = "status", type = String.class), @ColumnResult(name = "update_timestamp", type = LocalDateTime.class), @ColumnResult(name = "rejection_reason", type = String.class), @ColumnResult(name = "credit_timestamp", type = LocalDateTime.class), @ColumnResult(name = "reject_timestamp", type = LocalDateTime.class)})}),
348
 
342
 
349
        @SqlResultSetMapping(name = "BillingDaysAvg", classes = {@ConstructorResult(targetClass = BillingDaysAvg.class, columns = {@ColumnResult(name = "customer_id", type = Integer.class), @ColumnResult(name = "average", type = Long.class)})}),
343
        @SqlResultSetMapping(name = "BillingDaysAvg", classes = {@ConstructorResult(targetClass = BillingDaysAvg.class, columns = {@ColumnResult(name = "customer_id", type = Integer.class), @ColumnResult(name = "average", type = Long.class)})}),
350
 
344
 
351
        @SqlResultSetMapping(name = "LastSaleDays", classes = {@ConstructorResult(targetClass = LastSaleDateModel.class, columns = {@ColumnResult(name = "customer_id", type = Integer.class), @ColumnResult(name = "maxdate", type = LocalDateTime.class)})}),
345
        @SqlResultSetMapping(name = "LastSaleDays", classes = {@ConstructorResult(targetClass = LastSaleDateModel.class, columns = {@ColumnResult(name = "customer_id", type = Integer.class), @ColumnResult(name = "maxdate", type = LocalDateTime.class)})}),
352
/*
-
 
353
        @SqlResultSetMapping(name = "TodayPoByAuthUsers",
346
        @SqlResultSetMapping(name = "TodayPoByAuthUsers",
-
 
347
                classes = @ConstructorResult(
354
                classes = {@ConstructorResult(targetClass = BrandAuthUserPOModel.class,
348
                        targetClass = BrandAuthUserPOModel.class,
355
                        columns = {
349
                        columns = {
356
                                @ColumnResult(name = "auth_id", type = int.class),
350
                                @ColumnResult(name = "auth_user_id", type = Integer.class),
357
                                @ColumnResult(name = "brand", type = String.class),
351
                                @ColumnResult(name = "brand", type = String.class),
358
                                @ColumnResult(name = "today_po_value", type = long.class),
352
                                @ColumnResult(name = "today_po_value", type = Long.class),
359
                                @ColumnResult(name = "today_billed_value", type = long.class),
353
                                @ColumnResult(name = "today_billed_value", type = Long.class),
360
                                @ColumnResult(name = "total_billed_value", type = long.class),
354
                                @ColumnResult(name = "total_billed_value", type = Long.class),
361
                                @ColumnResult(name = "partner_count", type = int.class)
355
                                @ColumnResult(name = "partner_count", type = Integer.class)
362
 
-
 
363
                        }
356
                        }
364
                )}
357
                )
365
        )*/
358
        )
-
 
359
 
-
 
360
 
366
})
361
})
367
 
362
 
-
 
363
 
368
public class Order implements Serializable {
364
public class Order implements Serializable {
369
 
365
 
370
    private static final long serialVersionUID = 1L;
366
    private static final long serialVersionUID = 1L;
371
    @Id
367
    @Id
372
    @Column(name = "id", unique = true, updatable = false)
368
    @Column(name = "id", unique = true, updatable = false)