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()), "测试参数不存在");
|
}
|
}
|
}
|