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
package com.fgkj.services;
 
import com.fgkj.dto.Batt_rtdata;
import com.fgkj.dto.Batt_rtstate;
import com.fgkj.dto.ServiceModel;
import com.fgkj.mapper.impl.Batt_rtMapper;
import org.springframework.stereotype.Service;
 
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.Map;
@Service
public class Batt_rtService {
 
    @Resource
    private Batt_rtMapper battRtDao;
 
    public ServiceModel searchByGroupId(int battGroupId) {
        ServiceModel model = new ServiceModel();
        Map map = new HashMap();
        LinkedList<Batt_rtstate> listbt = battRtDao.searchByGroupId(battGroupId);
        if (listbt != null && !listbt.isEmpty()) {
            listbt.get(0);
            map.put("rtState", listbt);
//            System.out.println("listbt = " + listbt);
        }
        LinkedList<Batt_rtdata> listbd = battRtDao.searchByGroupId2(battGroupId);
        if (listbd != null && !listbd.isEmpty()) {
            map.put("rtDatas", listbd);
//            System.out.println("listbd = " + listbd);
        }
        //将两个数据结果放置到map中
        if (!map.isEmpty()) {
            model.setCode(1);
            model.setData(map);
        }
        return model;
    }
}