package com.whyc.service;
|
|
import com.github.pagehelper.PageHelper;
|
import com.github.pagehelper.PageInfo;
|
import com.whyc.dto.BattState;
|
import com.whyc.dto.Batt_Maint_Dealarm;
|
import com.whyc.dto.Response;
|
import com.whyc.mapper.BattRtstateMapper;
|
import org.springframework.stereotype.Service;
|
|
import javax.annotation.Resource;
|
import java.util.List;
|
|
@Service
|
public class BattTtstateService {
|
|
|
@Resource
|
private BattRtstateMapper battRtstateMapper;
|
|
/**
|
* @param bmd binf.battGroupId、binf.num、binf.stationname.binf、stationname1、uinf.uId、page
|
* 落后单体查询:根据条件查询落后单体
|
* @return
|
*/
|
public Response<List<BattState>> searchBattLife(Batt_Maint_Dealarm bmd) {
|
|
//分页信息
|
PageHelper.startPage(bmd.getPage().getPageCurr(), bmd.getPage().getPageSize());
|
List<BattState> list = battRtstateMapper.searchBattLife(bmd);
|
PageInfo<BattState> pageInfo = new PageInfo<BattState>(list);
|
if (list != null && list.size() > 0) {
|
// System.out.println("list = " + list);
|
return new Response<List<BattState>>().set(1, list, String.valueOf(pageInfo.getTotal()));
|
} else {
|
return new Response<List<BattState>>().set(0, null, String.valueOf(pageInfo.getTotal()));
|
}
|
}
|
}
|