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);
|
}
|
|
}
|
}
|