whyclxw
2022-03-01 9ad11cfce6ae8cbba895395208ca78ca13880f97
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
package com.whyc.service;
 
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.PageInfo;
import com.whyc.dto.BattTestData;
import com.whyc.dto.Response;
import com.whyc.mapper.Ld9testdataMapper;
import com.whyc.pojo.Ld9testdata;
import com.whyc.pojo.Ld9testdataInf;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestParam;
 
import javax.annotation.Resource;
import java.util.List;
 
@Service
public class Ld9testdataService {
    @Resource
    private Ld9testdataMapper mapper;
 
    //查询LD9单体测试数据
    public Response serchByCondition(int recordNum,  int testRecordCount, int battGroupId,int testMonNum) {
        int number=recordNum;//总数
        int roteN=0;
        int endN= BattTestData.RC_NUM_PARAM;//总笔数
        if(number<=endN){
            roteN=1;
        }else{
            if(number%endN==0){
                roteN=number/endN;
            }else{
                roteN=number/endN+1;
            }
        }
        List<Ld9testdata> list=mapper.serchByCondition(roteN,testRecordCount,battGroupId,testMonNum);
        PageInfo pageInfo=new PageInfo(list);
        return new Response().set(1,pageInfo);
    }
    //根据电池组id和test_record_count查询出整组的放电记录
    public List<Ld9testdata> getLD9AllGroupByTestRecordCount(Ld9testdataInf ld9inf) {
        List<Ld9testdata> list=mapper.getLD9AllGroupByTestRecordCount(ld9inf);
        return list;
    }
}