Subversion Repositories SmartDukaan

Rev

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