perryhsu
2020-10-17 a543f4de1c91ef6f43aace92975c6cf28de23618
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
package com.fgkj.controller;
 
import com.fgkj.util.*;
 
import com.fgkj.dto.BattInf;
import com.fgkj.dto.Batt_electricity;
import com.fgkj.dto.ServiceModel;
import com.fgkj.services.Batt_electricityService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
import java.util.List;
 
@RequestMapping("battElectricity")
@RestController
@Api
public class Batt_electricityController{
 
    @Autowired
    private Batt_electricityService service;
 
    @PostMapping("/")
    public ServiceModel add(@RequestBody Batt_electricity be){
        // Batt_electricity be = getGson().fromJson(json, Batt_electricity.class);
        ServiceModel model = service.add(be);
 
        return model;
    }
    @PutMapping("/")
    public ServiceModel update(@RequestBody Batt_electricity be){
        // Batt_electricity be = getGson().fromJson(json, Batt_electricity.class);
        ServiceModel model  = service.update(be);
 
        return model;
    }
    @DeleteMapping("/")
    public ServiceModel del(@RequestBody Batt_electricity be){
        // Batt_electricity be = getGson().fromJson(json, Batt_electricity.class);
        ServiceModel model = service.del(be);
 
        return model;
    }
    @GetMapping("all")
    public ServiceModel searchAll(){
        ServiceModel model = service.searchAll();
 
        return model;
    }
    
    
    //10.1根据设备id连battinf和batt_devdischarge表      查询电度
    /*
     * 记录时间放在battinf的battproducer
     * 统计方式放在battinf  的signalname  中       1 - 月       2-季度    3-年份
     * */
    @GetMapping("byCondition")
    public List serchByCondition(@RequestBody BattInf binf){
        // BattInf binf = getGson("yyyy-MM-dd HH:mm:ss").fromJson(json, BattInf.class);
        List list = service.serchByCondition(binf);
        //System.out.println(result);
        return list;
    }
    
    //9.1机房主控中用电量的统计的折线图
    @GetMapping("byInfo")
    public ServiceModel  serchByInfo(@RequestBody BattInf binf){
        // BattInf binf = getGson("yyyy-MM-dd HH:mm:ss").fromJson(json, BattInf.class);
        //System.out.println(binf);
        ServiceModel model = service.serchByInfo(binf);
 
        return model;
    }
    
 
    
    
}