whyczh
2021-12-27 b7605191cf3b4502c20efdefd9af65954cfa8a1c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
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);
    }
 
}