New file |
| | |
| | | package com.example.springboot.service.device.impl; |
| | | |
| | | import com.example.springboot.entity.device.DeviceEntity; |
| | | import com.example.springboot.mapper.device.DeviceMapper; |
| | | import com.example.springboot.service.device.DeviceService; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | |
| | | public class DeviceServiceImpl implements DeviceService { |
| | | |
| | | private final DeviceMapper deviceDao; |
| | | |
| | | @Autowired |
| | | public DeviceServiceImpl(DeviceMapper deviceDao) { |
| | | this.deviceDao = deviceDao; |
| | | } |
| | | |
| | | @Override |
| | | public List<DeviceEntity> getAllDevices() { |
| | | return deviceDao.selectAllDevices(); |
| | | } |
| | | |
| | | @Override |
| | | public void updateDeviceName(DeviceEntity device) { |
| | | deviceDao.updateDeviceName(device); |
| | | } |
| | | |
| | | @Override |
| | | public void updateMultipleDevices(List<DeviceEntity> devices) { |
| | | deviceDao.updateMultipleDevices(devices); |
| | | } |
| | | |
| | | @Override |
| | | public List<DeviceEntity> callStoredProc(DeviceEntity device) { |
| | | return performStoredProcQuery(device); |
| | | } |
| | | |
| | | private List<DeviceEntity> performStoredProcQuery(DeviceEntity device) { |
| | | // 执行存储过程的查询操作,并返回结果列表 |
| | | List<DeviceEntity> resultList = new ArrayList<>(); |
| | | |
| | | return deviceDao.callStoredProc(device); |
| | | } |
| | | } |