lxw
2022-07-14 f39c2d475d0997ad6394bf26d10e913e1afe3e4b
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
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.stereotype.Service;
 
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
 
@Service
public class BattTestparamService {
    @Resource
    private BattTestparamMapper mapper;
 
    //查看测试参数
    public Response searchBattTestparam(int battGroupId, int testRecordCount) {
        //判断表是否存在
        int tableNum = mapper.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()), "测试参数不存在");
        }
    }
}