完成预订方式接口编写

This commit is contained in:
freeebird
2018-11-15 19:00:19 +08:00
parent 4e51fe2a51
commit c8124bbc70
11 changed files with 160 additions and 19 deletions

View File

@@ -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();
}

View File

@@ -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);

View File

@@ -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();
}
}

View File

@@ -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();