whycxzp
2021-01-07 d7fb9e92779e971954ca59b86848569592f6185b
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
package com.whyc.service;
 
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.whyc.dto.Response;
import com.whyc.mapper.CentralMonitorSysRTMapper;
import com.whyc.mapper.CentralMonitorSysSTMapper;
import com.whyc.pojo.CentralMonitorSysRT;
import com.whyc.pojo.CentralMonitorSysST;
import org.springframework.stereotype.Service;
 
import javax.annotation.Resource;
 
@Service
public class CentralMonitorSysSTService {
    @Resource
    private CentralMonitorSysSTMapper mapper;
 
    public Response getInfoByDevId(int devId) {
        QueryWrapper<CentralMonitorSysST> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("dev_id",devId);
        try{
            CentralMonitorSysST centralMonitorSysST = mapper.selectOne(queryWrapper);
            return new Response<>().set(1,centralMonitorSysST);
        }catch (Exception e){
            e.printStackTrace();
            return new Response<>().setCode(0);
        }
    }
 
}