package com.ghy.order.service.impl;

import java.util.List;
import com.ghy.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ghy.order.mapper.OrderOperationRecordMapper;
import com.ghy.order.domain.OrderOperationRecord;
import com.ghy.order.service.IOrderOperationRecordService;
import com.ghy.common.core.text.Convert;

/**
 * 订单操作记录Service业务层处理
 *
 * @author clunt
 * @date 2024-02-17
 */
@Service
public class OrderOperationRecordServiceImpl implements IOrderOperationRecordService
{
    @Autowired
    private OrderOperationRecordMapper orderOperationRecordMapper;

    /**
     * 查询订单操作记录
     *
     * @param id 订单操作记录主键
     * @return 订单操作记录
     */
    @Override
    public OrderOperationRecord selectOrderOperationRecordById(Long id)
    {
        return orderOperationRecordMapper.selectOrderOperationRecordById(id);
    }

    /**
     * 查询订单操作记录列表
     *
     * @param orderOperationRecord 订单操作记录
     * @return 订单操作记录
     */
    @Override
    public List<OrderOperationRecord> selectOrderOperationRecordList(OrderOperationRecord orderOperationRecord)
    {
        return orderOperationRecordMapper.selectOrderOperationRecordList(orderOperationRecord);
    }

    /**
     * 新增订单操作记录
     *
     * @param orderOperationRecord 订单操作记录
     * @return 结果
     */
    @Override
    public int insertOrderOperationRecord(OrderOperationRecord orderOperationRecord)
    {
        orderOperationRecord.setCreateTime(DateUtils.getNowDate());
        return orderOperationRecordMapper.insertOrderOperationRecord(orderOperationRecord);
    }

    /**
     * 修改订单操作记录
     *
     * @param orderOperationRecord 订单操作记录
     * @return 结果
     */
    @Override
    public int updateOrderOperationRecord(OrderOperationRecord orderOperationRecord)
    {
        orderOperationRecord.setUpdateTime(DateUtils.getNowDate());
        return orderOperationRecordMapper.updateOrderOperationRecord(orderOperationRecord);
    }

    /**
     * 批量删除订单操作记录
     *
     * @param ids 需要删除的订单操作记录主键
     * @return 结果
     */
    @Override
    public int deleteOrderOperationRecordByIds(String ids)
    {
        return orderOperationRecordMapper.deleteOrderOperationRecordByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除订单操作记录信息
     *
     * @param id 订单操作记录主键
     * @return 结果
     */
    @Override
    public int deleteOrderOperationRecordById(Long id)
    {
        return orderOperationRecordMapper.deleteOrderOperationRecordById(id);
    }
}
