package com.whyc.service;
|
|
import com.whyc.dto.Response;
|
import com.whyc.mapper.CommonMapper;
|
import com.whyc.pojo.db_batt_testdata.BatttestdataId;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.stereotype.Service;
|
|
import javax.annotation.Resource;
|
import java.util.List;
|
|
@Service
|
public class BatttestdataIdService {
|
@Autowired
|
private SubTablePageInfoService subTablePageInfoService;
|
@Resource
|
private CommonMapper commonMapper;
|
|
//找这次放电的指定的一笔数据
|
public List<BatttestdataId> getLastDataByBattgroupId(Integer battgroupId, Integer testRecordCount, Integer recordNum) {
|
List<BatttestdataId> list=subTablePageInfoService.getLastDataByBattgroupId(battgroupId, testRecordCount, recordNum);
|
return list;
|
}
|
//历史测试记录具体某一次放电数据详情
|
public Response getTinfDataWithTestRecordCount(Integer battgroupId, Integer testRecordCount,Integer recordNum, Integer granularity) {
|
String tableName ="db_batt_testdata.tb_batttestdata_"+battgroupId;
|
String existTableName = commonMapper.existTable("db_batt_testdata", "tb_batttestdata_"+battgroupId);
|
if(existTableName == null){
|
return new Response().set(1,false,battgroupId+"电池组找不到第"+testRecordCount+"次放电记录");
|
}
|
List<BatttestdataId> list=subTablePageInfoService.getTinfDataWithTestRecordCount(tableName,testRecordCount,recordNum,granularity);
|
return new Response().setII(1,list.size()>0,list,"获取历史测试记录数据详情");
|
}
|
}
|