whycrzg
2021-02-23 351b9a53cb9ecebdf8f79db0117f540d9c42c2a4
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
79
80
81
82
package com.fgkj.services.rt;
 
import com.fgkj.dto.ServiceModel;
import com.fgkj.dto.rt.Batt_State_rt;
import com.fgkj.mapper.impl.rt.Rtstate_rtMapper;
import org.springframework.stereotype.Service;
 
import javax.annotation.Resource;
import java.util.List;
@Service
public class Rtstate_rtService {
 
    @Resource
    private Rtstate_rtMapper mapper;;
 
    ServiceModel model = new ServiceModel();
    
    //测试数据——实时查询中左下角的充放电统计
    public ServiceModel serchDisOrChargr(){
        List list=mapper.serchDisOrChargr();
        if(list!=null&&list.size()>0){
            model.setCode(1);
            model.setData(list);
            model.setMsg("查询成功!");
        }
        else{
            model.setCode(0);
            model.setMsg("查询失败!");
        }
        return model;
    }
    //电池组实时情况+实时电池续航能力查询
    public ServiceModel serchBattLife(Object obj){
        List<Batt_State_rt>  list=mapper.serchBattLife(obj);
        if(list!=null&&list.size()>0){
            model.setCode(1);
            model.setData(list);
            model.setMsg("查询成功!");
            /*for (Batt_State_rt b : list) {
                System.out.println(b);
            }*/
        }else{
            model.setCode(0);
            model.setMsg("查询失败!");
        }
        return model;
    }
    //首页上饼状图电池状态比例
    public ServiceModel serchBattStateRate(){
        List list=mapper.serchBattStateRate();
        if(list!=null&&list.size()>0){
            model.setCode(1);
            model.setData(list);
            model.setMsg("查询成功!");
        }
        else{
            model.setCode(0);
            model.setMsg("查询失败!");
        }
        return model;
    }
 
    /*public static void main(String[] args) {
        Rtstate_rtService rs=new Rtstate_rtService();
        Batt_Maint_Dealarm bmd = new Batt_Maint_Dealarm();
        Rtstate_rt rts=new Rtstate_rt();
        BattInf binf=new BattInf();
        binf.setBattGroupId(0);
        binf.setStationName("");
        binf.setStationName1("");
        binf.setNum(100);
        
        Page page = new Page();
        page.setPageCurr(1);
        page.setPageSize(10);
        
        bmd.setBinf(binf);
        bmd.setPage(page);
        rs.serchBattLife(bmd);
    }*/
 
}