whyclxw
2025-05-08 ddf6daa3a1aa46b5797d3ad33b691bccb9129856
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
package com.whyc.service;
 
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.whyc.dto.Response;
import com.whyc.mapper.Ld9testdataInfMapper;
import com.whyc.mapper.Ld9testdataMapper;
import com.whyc.pojo.Ld9testdata;
import com.whyc.pojo.Ld9testdataInf;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
 
import javax.annotation.Resource;
import java.util.List;
 
@Service
public class Ld9testdataInfService {
    @Resource
    private Ld9testdataInfMapper mapper;
 
    @Resource
    private Ld9testdataMapper datamapper;
 
    @Autowired
    private SubTablePageInfoService subService;
    //查询LD9测试数据列表
    public Response searchInfList(int battGroupId) {
        QueryWrapper wrapper=new QueryWrapper();
        wrapper.eq("BattGroupId",battGroupId);
        wrapper.orderByDesc("test_starttime");
        List<Ld9testdataInf> list=mapper.selectList(wrapper);//查询所有的放电记录
        if(list!=null&&list.size()>0){
            for (int i = 0; i < list.size(); i++) {
                Ld9testdataInf ld9inf= (Ld9testdataInf) list.get(i);
                Ld9testdata ld9testdata = new Ld9testdata();
                ld9testdata.setTestRecordCount(ld9inf.getTestRecordCount());
                ld9testdata.setBattGroupId(ld9inf.getBattGroupId());
                //List<Ld9testdata> testList = datamapper.serchByInfo(ld9testdata);//查询某次测试下电池组节数放电情况
                List<Ld9testdata> testList = subService.serchByInfo(ld9testdata);//查询某次测试下电池组节数放电情况
                ld9inf.setLd9testdata(testList);
            }
        }
        PageInfo pageInfo=new PageInfo(list);
        return new Response().set(1,pageInfo);
    }
}