whycxzp
2021-06-03 59ec12fe73db1b68b8eddc9150778f276483a6a5
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.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.whyc.dto.Response;
import com.whyc.mapper.CentralMonitorSysCtrlMapper;
import com.whyc.pojo.CentralMonitorSysCtrl;
import org.springframework.stereotype.Service;
 
import javax.annotation.Resource;
 
@Service
public class CentralMonitorSysCtrlService {
 
    @Resource
    private CentralMonitorSysCtrlMapper mapper;
 
    public Response<CentralMonitorSysCtrl> getInfoByDevId(int devId) {
        QueryWrapper<CentralMonitorSysCtrl> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("dev_id",devId);
        try {
            CentralMonitorSysCtrl centralMonitorSysCtrl = mapper.selectOne(queryWrapper);
            return new Response<CentralMonitorSysCtrl>().set(1,centralMonitorSysCtrl);
        }catch (Exception e){
            e.printStackTrace();
            return new Response<CentralMonitorSysCtrl>().setCode(0);
        }
 
    }
}