package com.younike.system.service.impl;

import java.util.List;
import java.time.LocalDateTime;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.younike.system.mapper.OrderGoodsServerMapper;
import com.younike.system.domain.OrderGoodsServer;
import com.younike.system.service.IOrderGoodsServerService;

/**
 * 订单服务人员关联Service业务层处理
 * 
 * @author elev
 * @date 2022-01-10
 */
@Service
public class OrderGoodsServerServiceImpl implements IOrderGoodsServerService {
    @Autowired
    private OrderGoodsServerMapper orderGoodsServerMapper;

    /**
     * 查询订单服务人员关联
     * 
     * @param orderId 订单服务人员关联主键
     * @return 订单服务人员关联
     */
    @Override
    public OrderGoodsServer selectOrderGoodsServerByOrderId(Long orderId) {
        return orderGoodsServerMapper.selectOrderGoodsServerByOrderId(orderId);
    }

    /**
     * 查询订单服务人员关联列表
     * 
     * @param orderGoodsServer 订单服务人员关联
     * @return 订单服务人员关联
     */
    @Override
    public List<OrderGoodsServer> selectOrderGoodsServerList(OrderGoodsServer orderGoodsServer) {
        return orderGoodsServerMapper.selectOrderGoodsServerList(orderGoodsServer);
    }

    /**
     * 新增订单服务人员关联
     * 
     * @param orderGoodsServer 订单服务人员关联
     * @return 结果
     */
    @Override
    public int insertOrderGoodsServer(OrderGoodsServer orderGoodsServer) {
        orderGoodsServer.setCreateTime(LocalDateTime.now());
        return orderGoodsServerMapper.insertOrderGoodsServer(orderGoodsServer);
    }

    /**
     * 修改订单服务人员关联
     * 
     * @param orderGoodsServer 订单服务人员关联
     * @return 结果
     */
    @Override
    public int updateOrderGoodsServer(OrderGoodsServer orderGoodsServer) {
        orderGoodsServer.setUpdateTime(LocalDateTime.now());
        return orderGoodsServerMapper.updateOrderGoodsServer(orderGoodsServer);
    }

    /**
     * 批量删除订单服务人员关联
     * 
     * @param orderIds 需要删除的订单服务人员关联主键
     * @return 结果
     */
    @Override
    public int deleteOrderGoodsServerByOrderIds(Long[] orderIds) {
        return orderGoodsServerMapper.deleteOrderGoodsServerByOrderIds(orderIds);
    }

    /**
     * 删除订单服务人员关联信息
     * 
     * @param orderId 订单服务人员关联主键
     * @return 结果
     */
    @Override
    public int deleteOrderGoodsServerByOrderId(Long orderId)
    {
        return orderGoodsServerMapper.deleteOrderGoodsServerByOrderId(orderId);
    }
}
