Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
36335 ranu 1
package com.spice.profitmandi.dao.model;
2
 
3
import javax.persistence.*;
4
 
5
@Entity
6
@NamedNativeQueries({
7
        @NamedNativeQuery(name = "Aging.15DaysWarehouseWiseStock",
8
                query = "SELECT " +
36346 ranu 9
                        "    cis.warehouse_id AS warehouse_id, " +
10
                        "    SUM((cis.total - cis.Dlt15) * cis.dealer_price) AS total_aging " +
11
                        "FROM inventory.tbl_cis cis " +
12
                        "WHERE cis.total > 0 " +
13
                        "GROUP BY cis.warehouse_id",
36335 ranu 14
                resultSetMapping = "WarehouseAgingStock")
15
})
16
 
17
@SqlResultSetMappings({
18
        @SqlResultSetMapping(name = "WarehouseAgingStock",
19
                classes = {@ConstructorResult(targetClass = WarehouseAgingStockModel.class,
20
                        columns = {
21
                                @ColumnResult(name = "warehouse_id", type = Integer.class),
22
                                @ColumnResult(name = "total_aging", type = Long.class),
23
                        }
24
                )}
25
        )
26
})
27
 
28
public class WarehouseAgingStockModel {
29
 
30
    @Id
31
    @GeneratedValue(strategy = GenerationType.IDENTITY)
32
    private Long id;
33
 
34
    private int warehouseId;
35
    private long totalAging;
36
 
37
    public WarehouseAgingStockModel(int warehouseId, long totalAging) {
38
        this.warehouseId = warehouseId;
39
        this.totalAging = totalAging;
40
    }
41
 
42
    public int getWarehouseId() {
43
        return warehouseId;
44
    }
45
 
46
    public void setWarehouseId(int warehouseId) {
47
        this.warehouseId = warehouseId;
48
    }
49
 
50
    public long getTotalAging() {
51
        return totalAging;
52
    }
53
 
54
    public void setTotalAging(long totalAging) {
55
        this.totalAging = totalAging;
56
    }
57
}