Subversion Repositories SmartDukaan

Rev

Rev 29707 | Rev 30121 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
29707 tejbeer 1
package com.spice.profitmandi.dao.entity.catalog;
2
 
3
import java.time.LocalDateTime;
4
 
5
import javax.persistence.Column;
6
import javax.persistence.Entity;
7
import javax.persistence.GeneratedValue;
8
import javax.persistence.GenerationType;
9
import javax.persistence.Id;
29845 amit.gupta 10
import javax.persistence.NamedQueries;
11
import javax.persistence.NamedQuery;
29707 tejbeer 12
import javax.persistence.Table;
13
 
14
@Entity
15
@Table(name = "catalog.customer_offers", schema = "catalog")
29845 amit.gupta 16
 
17
@NamedQueries({
18
		@NamedQuery(name = "CustomerOffer.getOfferItemsByBrand", query = "select new com.spice.profitmandi.service.pricecircular.PriceCircularItemModel("
19
				+ " i.id, cast(sum(coi.schemePayout - coi.dealerPayout) as long))"
20
				+ " from CustomerOfferItem coi join Item i on coi.catalogId = i.catalogItemId"
21
				+ " join CustomerOffer co on co.id=coi.customerOfferId where "
22
				+ " :date between co.startDate and co.endDate"
23
				+ " and i.brand in :brands  group by i.id"), })
29707 tejbeer 24
public class CustomerOffer {
25
 
26
	@Id
27
	@GeneratedValue(strategy = GenerationType.IDENTITY)
28
	private int id;
29
 
30
	@Column(name = "offer_name")
31
	private String offerName;
32
 
33
	@Column(name = "start_date")
34
	private LocalDateTime startDate;
35
 
36
	@Column(name = "end_date")
37
	private LocalDateTime endDate;
38
 
39
	@Column(name = "created_timestamp")
40
	private LocalDateTime createdTimestamp;
41
 
42
	@Column(name = "updated_timestamp")
43
	private LocalDateTime updatedTimestamp;
44
 
45
	public int getId() {
46
		return id;
47
	}
48
 
49
	public void setId(int id) {
50
		this.id = id;
51
	}
52
 
53
	public String getOfferName() {
54
		return offerName;
55
	}
56
 
57
	public void setOfferName(String offerName) {
58
		this.offerName = offerName;
59
	}
60
 
61
	public LocalDateTime getStartDate() {
62
		return startDate;
63
	}
64
 
65
	public void setStartDate(LocalDateTime startDate) {
66
		this.startDate = startDate;
67
	}
68
 
69
	public LocalDateTime getEndDate() {
70
		return endDate;
71
	}
72
 
73
	public void setEndDate(LocalDateTime endDate) {
74
		this.endDate = endDate;
75
	}
76
 
77
	public LocalDateTime getCreatedTimestamp() {
78
		return createdTimestamp;
79
	}
80
 
81
	public void setCreatedTimestamp(LocalDateTime createdTimestamp) {
82
		this.createdTimestamp = createdTimestamp;
83
	}
84
 
85
	public LocalDateTime getUpdatedTimestamp() {
86
		return updatedTimestamp;
87
	}
88
 
89
	public void setUpdatedTimestamp(LocalDateTime updatedTimestamp) {
90
		this.updatedTimestamp = updatedTimestamp;
91
	}
92
 
93
	@Override
94
	public String toString() {
95
		return "CustomerOffer [id=" + id + ", offerName=" + offerName + ", startDate=" + startDate + ", endDate="
96
				+ endDate + ", createdTimestamp=" + createdTimestamp + ", updatedTimestamp=" + updatedTimestamp + "]";
97
	}
98
 
99
}