package com.xingxi.business.Order.service.impl;

import com.xingxi.business.Order.domain.OrderDeliveryExpr;
import com.xingxi.business.Order.mapper.OrderDeliveryExprMapper;
import com.xingxi.business.Order.service.IOrderDeliveryExprService;
import com.xingxi.common.core.text.Convert;
import com.xingxi.common.utils.DateUtils;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 订单商品快递明细Service业务层处理
 *
 * @author xingxi
 * @date 2025-03-06
 */
@Service
public class OrderDeliveryExprServiceImpl implements IOrderDeliveryExprService {
    @Resource
    private OrderDeliveryExprMapper orderDeliveryExprMapper;

    /**
     * 查询订单商品快递明细
     *
     * @param id 订单商品快递明细主键
     * @return 订单商品快递明细
     */
    @Override
    public OrderDeliveryExpr selectOrderDeliveryExprById(Long id) {
        return orderDeliveryExprMapper.selectOrderDeliveryExprById(id);
    }

    /**
     * 查询订单商品快递明细列表
     *
     * @param orderDeliveryExpr 订单商品快递明细
     * @return 订单商品快递明细
     */
    @Override
    public List<OrderDeliveryExpr> selectOrderDeliveryExprList(OrderDeliveryExpr orderDeliveryExpr) {
        return orderDeliveryExprMapper.selectOrderDeliveryExprList(orderDeliveryExpr);
    }

    /**
     * 新增订单商品快递明细
     *
     * @param orderDeliveryExpr 订单商品快递明细
     * @return 结果
     */
    @Override
    public int insertOrderDeliveryExpr(OrderDeliveryExpr orderDeliveryExpr) {
        orderDeliveryExpr.setCreateTime(DateUtils.getNowDate());
        return orderDeliveryExprMapper.insertOrderDeliveryExpr(orderDeliveryExpr);
    }

    /**
     * 新增订单商品快递明细
     *
     * @param orderDeliveryExprList 订单商品快递明细
     * @return 结果
     */
    @Override
    public int batchInsertOrderDeliveryExpr(List<OrderDeliveryExpr> orderDeliveryExprList) {
        return orderDeliveryExprMapper.batchInsertOrderDeliveryExpr(orderDeliveryExprList);
    }

    /**
     * 修改订单商品快递明细
     *
     * @param orderDeliveryExpr 订单商品快递明细
     * @return 结果
     */
    @Override
    public int updateOrderDeliveryExpr(OrderDeliveryExpr orderDeliveryExpr) {
        orderDeliveryExpr.setUpdateTime(DateUtils.getNowDate());
        return orderDeliveryExprMapper.updateOrderDeliveryExpr(orderDeliveryExpr);
    }

    /**
     * 批量删除订单商品快递明细
     *
     * @param ids 需要删除的订单商品快递明细主键
     * @return 结果
     */
    @Override
    public int deleteOrderDeliveryExprByIds(String ids) {
        return orderDeliveryExprMapper.deleteOrderDeliveryExprByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除订单商品快递明细信息
     *
     * @param id 订单商品快递明细主键
     * @return 结果
     */
    @Override
    public int deleteOrderDeliveryExprById(Long id) {
        return orderDeliveryExprMapper.deleteOrderDeliveryExprById(id);
    }

    /**
     * 逻辑删除订单商品快递明细
     *
     * @param id 订单商品快递明细主键
     * @return 结果
     */
    @Override
    public int logicDeleteOrderDeliveryExprById(Long id) {
        return orderDeliveryExprMapper.logicDeleteOrderDeliveryExprById(id);
    }

    /**
     * 逻辑批量删除订单商品快递明细
     *
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    @Override
    public int logicDeleteOrderDeliveryExprByIds(String[] ids) {
        return orderDeliveryExprMapper.logicDeleteOrderDeliveryExprByIds(ids);
    }

    /**
     * 逻辑批量删除订单商品快递明细
     *
     * @param orderDeliveryExpr 订单商品快递明细
     * @return 结果
     */
    @Override
    public int logicDeleteOrderDeliveryExprByCondition(OrderDeliveryExpr orderDeliveryExpr) {
        return orderDeliveryExprMapper.logicDeleteOrderDeliveryExprByCondition(orderDeliveryExpr);
    }
}
