whyclxw
2025-05-07 45ef9e340f9bb4b98fd88a758343470dfe125cb3
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
package com.whyc.service;
 
import com.github.pagehelper.PageInfo;
import com.whyc.dto.Response;
import com.whyc.mapper.BattTestparamMapper;
import com.whyc.pojo.BattTestparam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
 
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
 
@Service
public class BattTestparamService {
    @Resource
    private BattTestparamMapper mapper;
 
    @Autowired
    private SubTablePageInfoService subService;
 
    //查看测试参数
    public Response searchBattTestparam(int battGroupId, int testRecordCount) {
        //判断表是否存在
        //int tableNum = mapper.judgeTable(String.valueOf(battGroupId));
        int tableNum = subService.judgeTable(String.valueOf(battGroupId));
        if (tableNum > 0) {
            List<BattTestparam> list = mapper.searchBattTestparam(battGroupId, testRecordCount);
            PageInfo pageInfo = new PageInfo(list);
            return new Response().setII(1, list.size() > 0 ? true : false, pageInfo, "查询成功");
        } else {
            return new Response().setII(1, false, new PageInfo(new ArrayList()), "测试参数不存在");
        }
    }
}