whyczh
2021-12-08 3f68c6a5a9968cbfd955e958742d38e5ded682c5
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
package com.whyc.service;
 
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.whyc.dto.Batt_Maint_Dealarm;
import com.whyc.dto.Response;
import com.whyc.dto.paramter.BattinfPar;
import com.whyc.mapper.BadbattMonMapper;
import org.springframework.stereotype.Service;
 
import javax.annotation.Resource;
import java.util.List;
 
@Service
public class BadBattMonService {
 
    @Resource
    BadbattMonMapper badbattMonMapper;
 
    public Response<List<Batt_Maint_Dealarm>> searchByInfo(BattinfPar battinfPar) {
 
        //分页信息
        PageHelper.startPage(battinfPar.getPage().getPageCurr(), battinfPar.getPage().getPageSize());
        List<Batt_Maint_Dealarm> list = badbattMonMapper.searchByInfo(battinfPar);
        PageInfo<Batt_Maint_Dealarm> pinfo = new PageInfo<>(list);
 
        return new Response<List<Batt_Maint_Dealarm>>().set(1, list, String.valueOf(pinfo.getTotal()));
    }
}