whyczh
2021-12-10 1ab06fa644b400182dde1621c60f904c4711f2b6
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
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()));
        }
    }
}