package com.whyc.service;
|
|
import com.whyc.dto.Response;
|
import com.whyc.mapper.DeviceTypeMapper;
|
import com.whyc.pojo.DeviceType;
|
import org.springframework.stereotype.Service;
|
|
import javax.annotation.Resource;
|
import java.util.List;
|
|
@Service
|
public class DeviceTypeService {
|
|
@Resource
|
private DeviceTypeMapper mapper;
|
|
public Response<List<DeviceType>> getAll() {
|
List<DeviceType> deviceTypes = mapper.selectList(null);
|
return new Response<List<DeviceType>>().set(1,deviceTypes);
|
}
|
|
public Response update(DeviceType deviceType) {
|
mapper.updateById(deviceType);
|
return new Response().setMsg(1,"修改成功");
|
}
|
|
public Response<DeviceType> get(Integer deviceTypeId) {
|
DeviceType deviceType = mapper.selectById(deviceTypeId);
|
return new Response<DeviceType>().set(1,deviceType);
|
}
|
|
public DeviceType getOneByDeviceTypeId(Integer deviceTypeId){
|
DeviceType deviceType = mapper.selectById(deviceTypeId);
|
return deviceType;
|
}
|
}
|