mirror of
https://github.com/FreeeBird/hotel.git
synced 2025-11-02 21:44:50 +08:00
完成预订方式接口编写
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
package cn.mafangui.hotel.service;
|
||||
|
||||
import cn.mafangui.hotel.entity.OrderType;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface OrderTypeService {
|
||||
|
||||
int insertOrderType(OrderType orderType);
|
||||
|
||||
int deleteOrderType(int typeId);
|
||||
|
||||
int updateOrderType(OrderType orderType);
|
||||
|
||||
OrderType selectById(int typeId);
|
||||
|
||||
List<OrderType> selectAll();
|
||||
}
|
||||
@@ -9,6 +9,7 @@ public interface WorkerService {
|
||||
int delete(int workerId);
|
||||
int updateById(Worker worker);
|
||||
Worker selectById(int workerId);
|
||||
Worker selectByUsername(String username);
|
||||
List<Worker> findAll();
|
||||
List<Worker> selectByRole(String role);
|
||||
Worker login(String username,String password,String role);
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
package cn.mafangui.hotel.service.impl;
|
||||
|
||||
import cn.mafangui.hotel.entity.OrderType;
|
||||
import cn.mafangui.hotel.mapper.OrderTypeMapper;
|
||||
import cn.mafangui.hotel.service.OrderTypeService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class OrderTypeServiceImpl implements OrderTypeService {
|
||||
@Autowired
|
||||
private OrderTypeMapper orderTypeMapper;
|
||||
|
||||
@Override
|
||||
public int insertOrderType(OrderType orderType) {
|
||||
return orderTypeMapper.insertSelective(orderType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteOrderType(int typeId) {
|
||||
return orderTypeMapper.deleteByPrimaryKey(typeId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateOrderType(OrderType orderType) {
|
||||
return orderTypeMapper.updateByPrimaryKeySelective(orderType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public OrderType selectById(int typeId) {
|
||||
return orderTypeMapper.selectByPrimaryKey(typeId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OrderType> selectAll() {
|
||||
return orderTypeMapper.selectAll();
|
||||
}
|
||||
}
|
||||
@@ -34,6 +34,11 @@ public class WorkerServiceImpl implements WorkerService {
|
||||
return workerMapper.selectByPrimaryKey(workerId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Worker selectByUsername(String username) {
|
||||
return workerMapper.selectByUsername(username);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Worker> findAll() {
|
||||
return workerMapper.selectAll();
|
||||
|
||||
Reference in New Issue
Block a user