| 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.common.enumuration.ActivationType;
|
| 3 |
import com.spice.profitmandi.common.enumuration.CounterSize;
|
4 |
import com.spice.profitmandi.common.enumuration.CounterSize;
|
| 4 |
import com.spice.profitmandi.common.enumuration.FofoType;
|
5 |
import com.spice.profitmandi.common.enumuration.FofoType;
|
| 5 |
import com.spice.profitmandi.dao.entity.user.Address;
|
6 |
import com.spice.profitmandi.dao.entity.user.Address;
|
| 6 |
|
7 |
|
| 7 |
import javax.persistence.*;
|
8 |
import javax.persistence.*;
|
| Line 18... |
Line 19... |
| 18 |
@Entity
|
19 |
@Entity
|
| 19 |
@Table(name = "fofo.fofo_store", schema = "fofo")
|
20 |
@Table(name = "fofo.fofo_store", schema = "fofo")
|
| 20 |
|
21 |
|
| 21 |
@NamedQueries({
|
22 |
@NamedQueries({
|
| 22 |
|
23 |
|
| 23 |
@NamedQuery(name = "FofoStore.selectAllDtrUserIds", query = "select ua.userId from FofoStore fs join UserAccount ua on fs.id=ua.accountKey " +
|
24 |
@NamedQuery(name = "FofoStore.selectAllDtrUserIds", query = "select ua.userId from FofoStore fs join UserAccount ua on fs.id=ua.accountKey "
|
| 24 |
"where ua.type='saholic' and fs.internal=false and fs.active=true"),
|
25 |
+ "where ua.type='saholic' and fs.internal=false and fs.active=true"),
|
| 25 |
|
26 |
|
| 26 |
@NamedQuery(name = "FofoStore.selectGroupByBrandWarehousePartnerSale", query = "select new com.spice.profitmandi.dao.model.BrandWisePartnerSaleModel(foi.brand, "
|
27 |
@NamedQuery(name = "FofoStore.selectGroupByBrandWarehousePartnerSale", query = "select new com.spice.profitmandi.dao.model.BrandWisePartnerSaleModel(foi.brand, "
|
| 27 |
+ "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :lms then CAST(foi.quantity*foi.mop AS integer ) else 0 end),"
|
28 |
+ "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :lms then CAST(foi.quantity*foi.mop AS integer ) else 0 end),"
|
| 28 |
+ "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :lms then foi.quantity else 0 end),"
|
29 |
+ "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :lms then foi.quantity else 0 end),"
|
| 29 |
+ "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :mtd then CAST(foi.quantity*foi.mop AS integer ) else 0 end),"
|
30 |
+ "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :mtd then CAST(foi.quantity*foi.mop AS integer ) else 0 end),"
|
| Line 160... |
Line 161... |
| 160 |
@Column
|
161 |
@Column
|
| 161 |
private String pan;
|
162 |
private String pan;
|
| 162 |
|
163 |
|
| 163 |
@Transient
|
164 |
@Transient
|
| 164 |
private Address userAddress;
|
165 |
private Address userAddress;
|
| 165 |
|
166 |
|
| 166 |
@Column(name = "internal")
|
167 |
@Column(name = "internal")
|
| 167 |
private boolean internal;
|
168 |
private boolean internal;
|
| 168 |
|
169 |
|
| 169 |
@Column(name = "bags_last_credited")
|
170 |
@Column(name = "bags_last_credited")
|
| 170 |
private LocalDateTime bagsLastCredited;
|
171 |
private LocalDateTime bagsLastCredited;
|
| 171 |
|
172 |
|
| 172 |
@Column(name = "fofo_type")
|
173 |
@Column(name = "fofo_type")
|
| 173 |
@Enumerated(EnumType.STRING)
|
174 |
@Enumerated(EnumType.STRING)
|
| 174 |
private FofoType fofoType;
|
175 |
private FofoType fofoType;
|
| 175 |
|
176 |
|
| - |
|
177 |
@Column(name = "activation_type")
|
| - |
|
178 |
@Enumerated(EnumType.STRING)
|
| - |
|
179 |
private ActivationType activationType;
|
| - |
|
180 |
|
| 176 |
@Column(name = "active_timestamp")
|
181 |
@Column(name = "active_timestamp")
|
| 177 |
private LocalDateTime activeTimeStamp;
|
182 |
private LocalDateTime activeTimeStamp;
|
| 178 |
|
183 |
|
| - |
|
184 |
public ActivationType getActivationType() {
|
| - |
|
185 |
return activationType;
|
| - |
|
186 |
}
|
| - |
|
187 |
|
| - |
|
188 |
public void setActivationType(ActivationType activationType) {
|
| - |
|
189 |
this.activationType = activationType;
|
| - |
|
190 |
}
|
| - |
|
191 |
|
| 179 |
public LocalDateTime getBagsLastCredited() {
|
192 |
public LocalDateTime getBagsLastCredited() {
|
| 180 |
return bagsLastCredited;
|
193 |
return bagsLastCredited;
|
| 181 |
}
|
194 |
}
|
| 182 |
|
195 |
|
| 183 |
public void setBagsLastCredited(LocalDateTime bagsLastCredited) {
|
196 |
public void setBagsLastCredited(LocalDateTime bagsLastCredited) {
|
| Line 209... |
Line 222... |
| 209 |
}
|
222 |
}
|
| 210 |
|
223 |
|
| 211 |
@Column(name = "grace_count")
|
224 |
@Column(name = "grace_count")
|
| 212 |
private int graceCount;
|
225 |
private int graceCount;
|
| 213 |
|
226 |
|
| 214 |
|
- |
|
| 215 |
public String getPan() {
|
227 |
public String getPan() {
|
| 216 |
return pan;
|
228 |
return pan;
|
| 217 |
}
|
229 |
}
|
| 218 |
|
230 |
|
| 219 |
public void setPan(String pan) {
|
231 |
public void setPan(String pan) {
|
| Line 322... |
Line 334... |
| 322 |
|
334 |
|
| 323 |
@Override
|
335 |
@Override
|
| 324 |
public int hashCode() {
|
336 |
public int hashCode() {
|
| 325 |
final int prime = 31;
|
337 |
final int prime = 31;
|
| 326 |
int result = 1;
|
338 |
int result = 1;
|
| - |
|
339 |
result = prime * result + ((activationType == null) ? 0 : activationType.hashCode());
|
| 327 |
result = prime * result + (active ? 1231 : 1237);
|
340 |
result = prime * result + (active ? 1231 : 1237);
|
| 328 |
result = prime * result + ((activeTimeStamp == null) ? 0 : activeTimeStamp.hashCode());
|
341 |
result = prime * result + ((activeTimeStamp == null) ? 0 : activeTimeStamp.hashCode());
|
| 329 |
result = prime * result + ((bagsLastCredited == null) ? 0 : bagsLastCredited.hashCode());
|
342 |
result = prime * result + ((bagsLastCredited == null) ? 0 : bagsLastCredited.hashCode());
|
| 330 |
result = prime * result + ((code == null) ? 0 : code.hashCode());
|
343 |
result = prime * result + ((code == null) ? 0 : code.hashCode());
|
| 331 |
result = prime * result + ((counterSize == null) ? 0 : counterSize.hashCode());
|
344 |
result = prime * result + ((counterSize == null) ? 0 : counterSize.hashCode());
|
| Line 336... |
Line 349... |
| 336 |
result = prime * result + (internal ? 1231 : 1237);
|
349 |
result = prime * result + (internal ? 1231 : 1237);
|
| 337 |
result = prime * result + (investmentOk ? 1231 : 1237);
|
350 |
result = prime * result + (investmentOk ? 1231 : 1237);
|
| 338 |
result = prime * result + ((latitude == null) ? 0 : latitude.hashCode());
|
351 |
result = prime * result + ((latitude == null) ? 0 : latitude.hashCode());
|
| 339 |
result = prime * result + ((longitude == null) ? 0 : longitude.hashCode());
|
352 |
result = prime * result + ((longitude == null) ? 0 : longitude.hashCode());
|
| 340 |
result = prime * result + Float.floatToIntBits(minimumInvestment);
|
353 |
result = prime * result + Float.floatToIntBits(minimumInvestment);
|
| - |
|
354 |
result = prime * result + ((pan == null) ? 0 : pan.hashCode());
|
| 341 |
result = prime * result + ((userAddress == null) ? 0 : userAddress.hashCode());
|
355 |
result = prime * result + ((userAddress == null) ? 0 : userAddress.hashCode());
|
| 342 |
result = prime * result + warehouseId;
|
356 |
result = prime * result + warehouseId;
|
| 343 |
return result;
|
357 |
return result;
|
| 344 |
}
|
358 |
}
|
| 345 |
|
359 |
|
| Line 350... |
Line 364... |
| 350 |
if (obj == null)
|
364 |
if (obj == null)
|
| 351 |
return false;
|
365 |
return false;
|
| 352 |
if (getClass() != obj.getClass())
|
366 |
if (getClass() != obj.getClass())
|
| 353 |
return false;
|
367 |
return false;
|
| 354 |
FofoStore other = (FofoStore) obj;
|
368 |
FofoStore other = (FofoStore) obj;
|
| - |
|
369 |
if (activationType != other.activationType)
|
| - |
|
370 |
return false;
|
| 355 |
if (active != other.active)
|
371 |
if (active != other.active)
|
| 356 |
return false;
|
372 |
return false;
|
| 357 |
if (activeTimeStamp == null) {
|
373 |
if (activeTimeStamp == null) {
|
| 358 |
if (other.activeTimeStamp != null)
|
374 |
if (other.activeTimeStamp != null)
|
| 359 |
return false;
|
375 |
return false;
|
| Line 396... |
Line 412... |
| 396 |
return false;
|
412 |
return false;
|
| 397 |
} else if (!longitude.equals(other.longitude))
|
413 |
} else if (!longitude.equals(other.longitude))
|
| 398 |
return false;
|
414 |
return false;
|
| 399 |
if (Float.floatToIntBits(minimumInvestment) != Float.floatToIntBits(other.minimumInvestment))
|
415 |
if (Float.floatToIntBits(minimumInvestment) != Float.floatToIntBits(other.minimumInvestment))
|
| 400 |
return false;
|
416 |
return false;
|
| - |
|
417 |
if (pan == null) {
|
| - |
|
418 |
if (other.pan != null)
|
| - |
|
419 |
return false;
|
| - |
|
420 |
} else if (!pan.equals(other.pan))
|
| - |
|
421 |
return false;
|
| 401 |
if (userAddress == null) {
|
422 |
if (userAddress == null) {
|
| 402 |
if (other.userAddress != null)
|
423 |
if (other.userAddress != null)
|
| 403 |
return false;
|
424 |
return false;
|
| 404 |
} else if (!userAddress.equals(other.userAddress))
|
425 |
} else if (!userAddress.equals(other.userAddress))
|
| 405 |
return false;
|
426 |
return false;
|
| Line 411... |
Line 432... |
| 411 |
@Override
|
432 |
@Override
|
| 412 |
public String toString() {
|
433 |
public String toString() {
|
| 413 |
return "FofoStore [id=" + id + ", code=" + code + ", latitude=" + latitude + ", longitude=" + longitude
|
434 |
return "FofoStore [id=" + id + ", code=" + code + ", latitude=" + latitude + ", longitude=" + longitude
|
| 414 |
+ ", counterSize=" + counterSize + ", warehouseId=" + warehouseId + ", minimumInvestment="
|
435 |
+ ", counterSize=" + counterSize + ", warehouseId=" + warehouseId + ", minimumInvestment="
|
| 415 |
+ minimumInvestment + ", graceDate=" + graceDate + ", investmentOk=" + investmentOk + ", active="
|
436 |
+ minimumInvestment + ", graceDate=" + graceDate + ", investmentOk=" + investmentOk + ", active="
|
| 416 |
+ active + ", userAddress=" + userAddress + ", internal=" + internal + ", bagsLastCredited="
|
437 |
+ active + ", pan=" + pan + ", userAddress=" + userAddress + ", internal=" + internal
|
| 417 |
+ bagsLastCredited + ", fofoType=" + fofoType + ", activeTimeStamp=" + activeTimeStamp + ", graceCount="
|
438 |
+ ", bagsLastCredited=" + bagsLastCredited + ", fofoType=" + fofoType + ", activationType="
|
| 418 |
+ graceCount + "]";
|
439 |
+ activationType + ", activeTimeStamp=" + activeTimeStamp + ", graceCount=" + graceCount + "]";
|
| 419 |
}
|
440 |
}
|
| 420 |
|
441 |
|
| 421 |
}
|
442 |
}
|
| 422 |
|
443 |
|