mirror of
https://github.com/FreeeBird/hotel.git
synced 2026-05-01 08:20:26 +08:00
完成RoomTypeService类编写,通过单元测试
This commit is contained in:
@@ -1,20 +1,20 @@
|
||||
package cn.mafangui.hotel.service;
|
||||
|
||||
import cn.mafangui.hotel.entity.RoomType;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public interface RoomTypeService {
|
||||
|
||||
int addRoomType(RoomType roomType);
|
||||
int insert(RoomType roomType);
|
||||
|
||||
int delRoomType(RoomType roomType);
|
||||
int delete(int typeId);
|
||||
|
||||
int delById(int typeId);
|
||||
int update(RoomType roomType);
|
||||
|
||||
int updateRoomType(RoomType roomType);
|
||||
|
||||
RoomType selectByName(RoomType roomType);
|
||||
RoomType selectByName(String roomType);
|
||||
|
||||
RoomType selectById(int typeId);
|
||||
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
package cn.mafangui.hotel.service.impl;
|
||||
|
||||
|
||||
import cn.mafangui.hotel.entity.RoomType;
|
||||
import cn.mafangui.hotel.mapper.RoomTypeMapper;
|
||||
import cn.mafangui.hotel.service.RoomTypeService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class RoomTypeServiceImpl implements RoomTypeService {
|
||||
@Autowired
|
||||
private RoomTypeMapper roomTypeMapper;
|
||||
|
||||
@Override
|
||||
public int insert(RoomType roomType) {
|
||||
return roomTypeMapper.insertSelective(roomType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int delete(int typeId) {
|
||||
return roomTypeMapper.deleteByPrimaryKey(typeId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int update(RoomType roomType) {
|
||||
return roomTypeMapper.updateByPrimaryKeySelective(roomType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RoomType selectByName(String roomType) {
|
||||
return roomTypeMapper.selectByRoomType(roomType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RoomType selectById(int typeId) {
|
||||
return roomTypeMapper.selectByPrimaryKey(typeId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RoomType> findAllType() {
|
||||
return roomTypeMapper.selectAll();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user