lxw
2023-12-12 14fa644167bcadd3f7bd6feddf29dc18c1490068
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
43
44
45
46
47
48
package com.whyc.service;
 
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.whyc.dto.Response;
import com.whyc.mapper.GatewayInfMapper;
import com.whyc.pojo.db_ckpwrdev_inf.BreakerInf;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
 
import java.util.List;
 
@Service
public class GatewayInfService {
    @Autowired(required = false)
    private GatewayInfMapper mapper;
 
    //获取网关配置
    public Response getGatewayInf(int pageCurr, int pageSize, String gatewayType, String commType) {
        PageHelper.startPage(pageCurr,pageSize);
        QueryWrapper wrapper=new QueryWrapper();
        if(gatewayType!=null){
            wrapper.eq("gateway_type",gatewayType);
        }
        if(commType!=null){
            wrapper.eq("comm_type",commType);
        }
        List<BreakerInf> list=mapper.selectList(wrapper);
        PageInfo pageInfo=new PageInfo(list);
        return new Response().setII(1,list!=null,pageInfo,"获取网关配置");
    }
    //获取网关类别
    public Response getGatewayType() {
        List<String> list=mapper.getGatewayType();
        return new Response().setII(1,list!=null,list,"获取网关类别");
    }
    //获取通讯类别
    public Response getCommType() {
        List<String> list=mapper.getCommType();
        return new Response().setII(1,list!=null,list,"获取通讯类别");
    }
    //获取所属网关
    public Response getGatewayName() {
        List<String> list=mapper.getGatewayName();
        return new Response().setII(1,list!=null,list,"获取所属网关");
    }
}