whycrzg
2021-02-23 351b9a53cb9ecebdf8f79db0117f540d9c42c2a4
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
package com.fgkj.services.history;
 
import com.fgkj.dto.BtsStateChangeInf;
import com.fgkj.dto.PageBean;
import com.fgkj.dto.ServiceModel;
import com.fgkj.mapper.impl.history.BtsStateChangeInfMapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;
 
import javax.annotation.Resource;
import java.util.List;
@Service
public class BtsStateChangeInfService {
    
    @Resource
    private BtsStateChangeInfMapper mapper;
    
     //按照时间顺序显示设备的事件信息
    public ServiceModel serchByCondition(BtsStateChangeInf binf) {
        ServiceModel model = new ServiceModel();
        PageBean pageBean = binf.getPageBean();
        //分页
        PageHelper.startPage(pageBean.getPageNum(), pageBean.getPageSize());
        List list=mapper.serchByCondition(binf);
        PageInfo pageInfo = new PageInfo<BtsStateChangeInf> (list);
        if(list!=null&&list.size()>0){
            model.setCode(1);
            model.setData(pageInfo);
            model.setMsg("查询成功!");
        }else{
            model.setCode(0);
            model.setMsg("查询失败!");
        }
        return model;
    }
 
}