package com.whyc.service;
|
|
import com.github.pagehelper.PageHelper;
|
import com.github.pagehelper.PageInfo;
|
import com.whyc.dto.BattMaintDealarm;
|
import com.whyc.dto.Response;
|
import com.whyc.dto.paramter.BattinfPar;
|
import com.whyc.mapper.BadbattMonMapper;
|
import com.whyc.pojo.UserInf;
|
import com.whyc.util.ActionUtil;
|
import org.springframework.stereotype.Service;
|
|
import javax.annotation.Resource;
|
import java.util.List;
|
|
@Service
|
public class BadBattMonService {
|
|
@Resource
|
BadbattMonMapper badbattMonMapper;
|
|
public Response<List<BattMaintDealarm>> searchByInfo(BattinfPar battinfPar) {
|
|
//分页信息
|
PageHelper.startPage(battinfPar.getPage().getPageCurr(), battinfPar.getPage().getPageSize());
|
List<BattMaintDealarm> list = badbattMonMapper.searchByInfo(battinfPar);
|
PageInfo<BattMaintDealarm> pinfo = new PageInfo<>(list);
|
|
return new Response<List<BattMaintDealarm>>().set(1, list, String.valueOf(pinfo.getTotal()));
|
}
|
//落后单体数量查询
|
public Response searchNums() {
|
UserInf uinf= ActionUtil.getUser();
|
int badMonNum=badbattMonMapper.searchNums(uinf.getUId().intValue());
|
return new Response().set(1,badMonNum);
|
}
|
|
public int getBadCountByStationId(String stationId){
|
return badbattMonMapper.getBadCountByStationId(stationId);
|
}
|
|
}
|