whyclxw
2025-05-30 10a094864f75928f853e1ebb0311b0a20b858901
src/main/java/com/whyc/service/BattInfService.java
@@ -8,6 +8,7 @@
import com.whyc.dto.InfoDto;
import com.whyc.dto.Real.QuarterDto;
import com.whyc.dto.Response;
import com.whyc.dto.Statistic.StationStic;
import com.whyc.factory.InfoFactory;
import com.whyc.mapper.BattInfMapper;
import com.whyc.mapper.PowerInfMapper;
@@ -403,4 +404,17 @@
        }
        return list;
    }
    //设备信息统计
    public Response getDevStatistic(StationStic stic) {
        PageHelper.startPage(stic.getPageNum(),stic.getPageSize());
        List<BattInf> list=mapper.getDevStatistic(stic);
        for (BattInf binf:list) {
            //获取设备下电池组个数
            int battCount=mapper.getBattCountBydevId(binf.getDevId());
            binf.setBattCount(battCount);
        }
        PageInfo<BattInf> pageInfo=new PageInfo<>(list);
        return new Response().setII(1,list.size()>0,pageInfo,"设备信息统计");
    }
}