mirror of
https://github.com/FreeeBird/hotel.git
synced 2026-05-01 08:20:26 +08:00
完成酒店信息接口编写
This commit is contained in:
@@ -6,11 +6,11 @@ import java.util.List;
|
||||
|
||||
public interface HotelService {
|
||||
|
||||
int addHotel(Hotel hotel);
|
||||
int deleteHotel(int hotelId);
|
||||
int updateHotel(Hotel hotel);
|
||||
Hotel selectHotelByName(String hotelName);
|
||||
Hotel selectHotelById(int hotelId);
|
||||
List<Hotel> findAllHotel();
|
||||
int insert(Hotel hotel);
|
||||
int delete(int hotelId);
|
||||
int update(Hotel hotel);
|
||||
Hotel selectByName(String hotelName);
|
||||
Hotel selectById(int hotelId);
|
||||
List<Hotel> selectAll();
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
package cn.mafangui.hotel.service.impl;
|
||||
|
||||
import cn.mafangui.hotel.entity.Hotel;
|
||||
import cn.mafangui.hotel.mapper.HotelMapper;
|
||||
import cn.mafangui.hotel.service.HotelService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class HotelServiceImpl implements HotelService {
|
||||
|
||||
@Autowired
|
||||
private HotelMapper hotelMapper;
|
||||
|
||||
@Override
|
||||
public int insert(Hotel hotel) {
|
||||
return hotelMapper.insertSelective(hotel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int delete(int hotelId) {
|
||||
return hotelMapper.deleteByPrimaryKey(hotelId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int update(Hotel hotel) {
|
||||
return hotelMapper.updateByPrimaryKeySelective(hotel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Hotel selectByName(String hotelName) {
|
||||
return hotelMapper.selectByName(hotelName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Hotel selectById(int hotelId) {
|
||||
return hotelMapper.selectByPrimaryKey(hotelId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Hotel> selectAll() {
|
||||
return hotelMapper.selectAll();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user