Subversion Repositories SmartDukaan

Rev

Rev 36346 | 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 " +
36934 ranu 12
                        "JOIN catalog.item ci ON ci.id = cis.item_id " +
36346 ranu 13
                        "WHERE cis.total > 0 " +
36934 ranu 14
                        "  AND ci.category = 10006 " +
36346 ranu 15
                        "GROUP BY cis.warehouse_id",
36335 ranu 16
                resultSetMapping = "WarehouseAgingStock")
17
})
18
 
19
@SqlResultSetMappings({
20
        @SqlResultSetMapping(name = "WarehouseAgingStock",
21
                classes = {@ConstructorResult(targetClass = WarehouseAgingStockModel.class,
22
                        columns = {
23
                                @ColumnResult(name = "warehouse_id", type = Integer.class),
24
                                @ColumnResult(name = "total_aging", type = Long.class),
25
                        }
26
                )}
27
        )
28
})
29
 
30
public class WarehouseAgingStockModel {
31
 
32
    @Id
33
    @GeneratedValue(strategy = GenerationType.IDENTITY)
34
    private Long id;
35
 
36
    private int warehouseId;
37
    private long totalAging;
38
 
39
    public WarehouseAgingStockModel(int warehouseId, long totalAging) {
40
        this.warehouseId = warehouseId;
41
        this.totalAging = totalAging;
42
    }
43
 
44
    public int getWarehouseId() {
45
        return warehouseId;
46
    }
47
 
48
    public void setWarehouseId(int warehouseId) {
49
        this.warehouseId = warehouseId;
50
    }
51
 
52
    public long getTotalAging() {
53
        return totalAging;
54
    }
55
 
56
    public void setTotalAging(long totalAging) {
57
        this.totalAging = totalAging;
58
    }
59
}