| | |
| | | package com.fgkj.services.Ld9; |
| | | |
| | | import com.fgkj.dto.Ld9testdata; |
| | | import com.fgkj.dto.ServiceModel; |
| | | import com.fgkj.mapper.BattTestData; |
| | | import com.fgkj.mapper.impl.Ld9.Ld9testdataMapper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class Ld9testdataService { |
| | | |
| | | @Autowired |
| | | @Resource |
| | | private Ld9testdataMapper mapper; |
| | | |
| | | |
| | | private ServiceModel model; |
| | | |
| | | //历史监测 |
| | | public ServiceModel serchByCondition(Object obj) { |
| | | List list=mapper.serchByCondition(obj); |
| | | public ServiceModel serchByCondition(Ld9testdata ld9) { |
| | | ServiceModel model = new ServiceModel(); |
| | | //计算roteN |
| | | int number=ld9.getRecord_num();//总数 |
| | | int roteN=0; |
| | | int endN= BattTestData.RC_NUM_PARAM;//总笔数 |
| | | if(number<=endN){ |
| | | roteN=1; |
| | | }else{ |
| | | if(number%endN==0){ |
| | | roteN=number/endN; |
| | | }else{ |
| | | roteN=number/endN+1; |
| | | } |
| | | } |
| | | //将roteN暂存在num中 |
| | | ld9.setNum(roteN); |
| | | |
| | | List list=mapper.serchByCondition(ld9); |
| | | if(list!=null&&list.size()>0){ |
| | | model.setCode(1); |
| | | model.setData(list); |
| | |
| | | return model; |
| | | } |
| | | //查询某次测试下电池组节数放电情况 |
| | | public ServiceModel serchByInfo(Object obj){ |
| | | List list=mapper.serchByInfo(obj); |
| | | public ServiceModel serchByInfo(Ld9testdata ld9){ |
| | | ServiceModel model = new ServiceModel(); |
| | | List list=mapper.serchByInfo(ld9); |
| | | if(list!=null&&list.size()>0){ |
| | | model.setCode(1); |
| | | model.setData(list); |