| Line 1... |
Line 1... |
| 1 |
package com.spice.profitmandi.dao.entity.fofo;
|
1 |
package com.spice.profitmandi.dao.entity.fofo;
|
| 2 |
|
2 |
|
| 3 |
import com.spice.profitmandi.dao.enumuration.transaction.UpSaleCallStatus;
|
3 |
import com.spice.profitmandi.dao.enumuration.transaction.UpSaleCallStatus;
|
| - |
|
4 |
import com.spice.profitmandi.dao.model.UpsellingReportModel;
|
| 4 |
|
5 |
|
| 5 |
import javax.persistence.*;
|
6 |
import javax.persistence.*;
|
| 6 |
import java.io.Serializable;
|
7 |
import java.io.Serializable;
|
| 7 |
import java.time.LocalDateTime;
|
8 |
import java.time.LocalDateTime;
|
| 8 |
import java.util.Objects;
|
9 |
import java.util.Objects;
|
| Line 14... |
Line 15... |
| 14 |
@Table(name = "fofo.upSaleCall")
|
15 |
@Table(name = "fofo.upSaleCall")
|
| 15 |
@NamedQueries({
|
16 |
@NamedQueries({
|
| 16 |
@NamedQuery(name = "upSaleCall.checkNumberIsExist", query = "SELECT COUNT(u) FROM UpSaleCall u WHERE u.mobile = :mobile AND u.originalOrderId = :orderId"),
|
17 |
@NamedQuery(name = "upSaleCall.checkNumberIsExist", query = "SELECT COUNT(u) FROM UpSaleCall u WHERE u.mobile = :mobile AND u.originalOrderId = :orderId"),
|
| 17 |
@NamedQuery(name = "upSaleCall.checkOrderIsExist", query = "SELECT COUNT(u) FROM UpSaleCall u WHERE u.originalOrderId = :orderId"),
|
18 |
@NamedQuery(name = "upSaleCall.checkOrderIsExist", query = "SELECT COUNT(u) FROM UpSaleCall u WHERE u.originalOrderId = :orderId"),
|
| 18 |
})
|
19 |
})
|
| - |
|
20 |
|
| - |
|
21 |
|
| - |
|
22 |
@NamedNativeQueries({
|
| - |
|
23 |
@NamedNativeQuery(name = "Upsell.UpsellingReport",
|
| - |
|
24 |
query = "SELECT uc.agentId, ucd.agent_id as agentEmail, uc.originalOrderId as orderId, uc.mobile as customerNumber, ucd.created_timestamp as callingDate," +
|
| - |
|
25 |
" coalesce(rp.payment_status, 'Not Found') as paymentStatus, (CASE WHEN ac.create_timestamp IS NOT NULL THEN 'Created' ELSE 'Not Created' END) AS insuranceStatus, coalesce(ip.sale_amount,0) as soldAmount, coalesce(ip.invoice_number,'Not Found') as invoiceNumber, coalesce(ip.serial_number,'Not Found') as serialNumber" +
|
| - |
|
26 |
" FROM fofo.upSaleCall uc" +
|
| - |
|
27 |
" JOIN fofo.upsell_call_details ucd on uc.id = ucd.upsale_call_id" +
|
| - |
|
28 |
" LEFT JOIN fofo.upsellRazorpayPaymentStatus rp on rp.order_id = uc.originalOrderId" +
|
| - |
|
29 |
" LEFT JOIN fofo.upsaleAgentCollection ac on ac.order_id = uc.originalOrderId" +
|
| - |
|
30 |
" LEFT JOIN dtr.insurance_policy ip on ip.id = ac.product_id" +
|
| - |
|
31 |
" WHERE uc.create_timestamp >= :startDate and uc.create_timestamp < :endDate",
|
| - |
|
32 |
resultSetMapping = "UpsellingReport"),
|
| - |
|
33 |
|
| - |
|
34 |
})
|
| - |
|
35 |
|
| - |
|
36 |
@SqlResultSetMappings({
|
| - |
|
37 |
|
| - |
|
38 |
@SqlResultSetMapping(name = "UpsellingReport",
|
| - |
|
39 |
classes = {@ConstructorResult(targetClass = UpsellingReportModel.class,
|
| - |
|
40 |
columns = {
|
| - |
|
41 |
@ColumnResult(name = "agentId", type = Integer.class),
|
| - |
|
42 |
@ColumnResult(name = "agentEmail", type = String.class),
|
| - |
|
43 |
@ColumnResult(name = "orderId", type = Integer.class),
|
| - |
|
44 |
@ColumnResult(name = "customerNumber ", type = String.class),
|
| - |
|
45 |
@ColumnResult(name = "callingDate ", type = String.class),
|
| - |
|
46 |
@ColumnResult(name = "paymentStatus ", type = String.class),
|
| - |
|
47 |
@ColumnResult(name = "insuranceStatus ", type = String.class),
|
| - |
|
48 |
@ColumnResult(name = "soldAmount ", type = Float.class),
|
| - |
|
49 |
@ColumnResult(name = "invoiceNumber ", type = String.class),
|
| - |
|
50 |
@ColumnResult(name = "serialNumber ", type = String.class),
|
| - |
|
51 |
}
|
| - |
|
52 |
)}
|
| - |
|
53 |
)
|
| - |
|
54 |
|
| - |
|
55 |
})
|
| 19 |
public class UpSaleCall implements Serializable {
|
56 |
public class UpSaleCall implements Serializable {
|
| 20 |
|
57 |
|
| 21 |
|
58 |
|
| 22 |
private static final long serialVersionUID = 1L;
|
59 |
private static final long serialVersionUID = 1L;
|
| 23 |
@Id
|
60 |
@Id
|