| | |
| | | package cn.lihu.jh.module.ecg.service.devmanage; |
| | | |
| | | import cn.lihu.jh.module.ecg.dal.dataobject.devmanage.DeviceStatisticDO; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Integer updateDeviceState(DeviceSaveReqVO updateReqVO) { |
| | | // 校验存在 |
| | | validateDeviceExists(updateReqVO.getId()); |
| | | // 更新 |
| | | DeviceDO updateObj = BeanUtils.toBean(updateReqVO, DeviceDO.class); |
| | | return deviceMapper.updateDevState(updateObj.getDevId(), updateObj.getState(), updateObj.getStateDate()); |
| | | } |
| | | |
| | | @Override |
| | | public void deleteDevice(Integer id) { |
| | | // 校验存在 |
| | | validateDeviceExists(id); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public DeviceDO getDevice(String devId) { |
| | | return deviceMapper.getDeviceByDevId(devId); |
| | | } |
| | | |
| | | @Override |
| | | public PageResult<DeviceDO> getDevicePage(DevicePageReqVO pageReqVO) { |
| | | return deviceMapper.selectPage(pageReqVO); |
| | | } |
| | | |
| | | @Override |
| | | public List<DeviceStatisticDO> getDeviceStatistic(DevicePageReqVO pageReqVO) { |
| | | return deviceMapper.getDevStatistic(pageReqVO); |
| | | } |
| | | |
| | | } |