Subversion Repositories SmartDukaan

Rev

Rev 36805 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
36644 ranu 1
package com.spice.profitmandi.dao.entity.user;
2
 
3
import javax.persistence.*;
4
import java.time.LocalDate;
5
import java.time.LocalDateTime;
6
 
7
@Entity
36834 ranu 8
@NamedQueries({
9
 
10
        @NamedQuery(
11
                name = "BeatSchedule.selectByUserIdAndDateRange",
12
                query =
13
                        "SELECT bs " +
14
                                "FROM BeatSchedule bs, Beat b " +
15
                                "WHERE bs.beatId = b.id " +
16
                                "AND b.authUserId = :userId " +
17
                                "AND b.active = true " +
18
                                "AND bs.startDate <= :endDate " +
19
                                "AND (bs.endDate IS NULL OR bs.endDate >= :startDate) " +
20
                                "ORDER BY bs.startDate ASC"
21
        )
22
 
23
})
36644 ranu 24
@Table(name = "user.beat_schedule")
25
public class BeatSchedule {
26
 
27
    @Id
28
    @Column(name = "id", unique = true, updatable = false)
29
    @GeneratedValue(strategy = GenerationType.IDENTITY)
30
    private int id;
31
 
32
    @Column(name = "beat_id")
33
    private int beatId;
34
 
35
    @Column(name = "start_date")
36
    private LocalDate startDate;
37
 
38
    @Column(name = "end_date")
39
    private LocalDate endDate;
40
 
41
    @Column(name = "day_number")
42
    private int dayNumber;
43
 
44
    @Column(name = "total_distance_km")
45
    private Double totalDistanceKm;
46
 
47
    @Column(name = "total_time_mins")
48
    private Integer totalTimeMins;
49
 
50
    @Column(name = "end_action")
51
    private String endAction;
52
 
53
    @Column(name = "stay_location_name")
54
    private String stayLocationName;
55
 
56
    @Column(name = "stay_latitude")
57
    private String stayLatitude;
58
 
59
    @Column(name = "stay_longitude")
60
    private String stayLongitude;
61
 
62
    @Column(name = "created_timestamp")
63
    private LocalDateTime createdTimestamp;
64
 
36805 ranu 65
    @Column(name = "agenda_filled_timestamp")
66
    private LocalDateTime agendaFilledTimestamp;
67
 
36644 ranu 68
    public int getId() {
69
        return id;
70
    }
71
 
72
    public void setId(int id) {
73
        this.id = id;
74
    }
75
 
76
    public int getBeatId() {
77
        return beatId;
78
    }
79
 
80
    public void setBeatId(int beatId) {
81
        this.beatId = beatId;
82
    }
83
 
84
    public LocalDate getStartDate() {
85
        return startDate;
86
    }
87
 
88
    public void setStartDate(LocalDate startDate) {
89
        this.startDate = startDate;
90
    }
91
 
92
    public LocalDate getEndDate() {
93
        return endDate;
94
    }
95
 
96
    public void setEndDate(LocalDate endDate) {
97
        this.endDate = endDate;
98
    }
99
 
100
    public int getDayNumber() {
101
        return dayNumber;
102
    }
103
 
104
    public void setDayNumber(int dayNumber) {
105
        this.dayNumber = dayNumber;
106
    }
107
 
108
    public Double getTotalDistanceKm() {
109
        return totalDistanceKm;
110
    }
111
 
112
    public void setTotalDistanceKm(Double totalDistanceKm) {
113
        this.totalDistanceKm = totalDistanceKm;
114
    }
115
 
116
    public Integer getTotalTimeMins() {
117
        return totalTimeMins;
118
    }
119
 
120
    public void setTotalTimeMins(Integer totalTimeMins) {
121
        this.totalTimeMins = totalTimeMins;
122
    }
123
 
124
    public String getEndAction() {
125
        return endAction;
126
    }
127
 
128
    public void setEndAction(String endAction) {
129
        this.endAction = endAction;
130
    }
131
 
132
    public String getStayLocationName() {
133
        return stayLocationName;
134
    }
135
 
136
    public void setStayLocationName(String stayLocationName) {
137
        this.stayLocationName = stayLocationName;
138
    }
139
 
140
    public String getStayLatitude() {
141
        return stayLatitude;
142
    }
143
 
144
    public void setStayLatitude(String stayLatitude) {
145
        this.stayLatitude = stayLatitude;
146
    }
147
 
148
    public String getStayLongitude() {
149
        return stayLongitude;
150
    }
151
 
152
    public void setStayLongitude(String stayLongitude) {
153
        this.stayLongitude = stayLongitude;
154
    }
155
 
156
    public LocalDateTime getCreatedTimestamp() {
157
        return createdTimestamp;
158
    }
159
 
160
    public void setCreatedTimestamp(LocalDateTime createdTimestamp) {
161
        this.createdTimestamp = createdTimestamp;
162
    }
36805 ranu 163
 
164
    public LocalDateTime getAgendaFilledTimestamp() {
165
        return agendaFilledTimestamp;
166
    }
167
 
168
    public void setAgendaFilledTimestamp(LocalDateTime agendaFilledTimestamp) {
169
        this.agendaFilledTimestamp = agendaFilledTimestamp;
170
    }
36644 ranu 171
}