package com.whyc.service;
|
|
import com.github.pagehelper.PageInfo;
|
import com.whyc.dto.Response;
|
import com.whyc.dto.paramter.POIWord;
|
import com.whyc.dto.paramter.TestDataInfDoc;
|
import com.whyc.mapper.BatttestdataMapper;
|
import com.whyc.pojo.BatttestdataId;
|
import org.springframework.stereotype.Service;
|
|
import javax.annotation.Resource;
|
import java.util.Arrays;
|
import java.util.List;
|
|
@Service
|
public class BatttestdataService {
|
@Resource
|
private BatttestdataMapper mapper;
|
|
//查询历史数据
|
public Response findhistory(int battGroupId, int testRecordCount, int dataNew) {
|
BatttestdataId btd = mapper.serchMaxAndMintime(battGroupId, testRecordCount);
|
int number = btd.getRecordNum();//总数
|
int roteN = 0;
|
//int endN= BattTestData.RC_NUM_PARAM;//总笔数
|
int endN = dataNew;//总笔数
|
//去除筛选,将全部数据取出
|
if (number <= endN) {
|
roteN = 1;
|
} else {
|
if (number % endN == 0) {
|
roteN = number / endN;
|
} else {
|
roteN = number / endN + 1;
|
}
|
//roteN = 1;
|
}
|
List list = mapper.findhistory(battGroupId, testRecordCount, roteN, btd.getNum().intValue(), btd.getTestType());
|
PageInfo pageInfo = new PageInfo(list);
|
return new Response().set(1, pageInfo);
|
}
|
|
//word导出
|
public List<TestDataInfDoc> searchWordExport(POIWord poiWord) {
|
poiWord.setRecordNumList(Arrays.asList(poiWord.getRecordNums().split(",")));
|
List<TestDataInfDoc> list = mapper.searchWordExport(poiWord);
|
return list;
|
}
|
}
|