package com.jsowell.pile.service.impl;

import com.jsowell.pile.domain.OrderAbnormalRecord;
import com.jsowell.pile.mapper.OrderAbnormalRecordMapper;
import com.jsowell.pile.service.IOrderAbnormalRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 订单异常记录Service业务层处理
 *
 * @author jsowell
 * @date 2023-02-13
 */
@Service
public class OrderAbnormalRecordServiceImpl implements IOrderAbnormalRecordService {
	@Autowired
	private OrderAbnormalRecordMapper orderAbnormalRecordMapper;

	/**
	 * 查询订单异常记录
	 *
	 * @param id 订单异常记录主键
	 * @return 订单异常记录
	 */
	@Override
	public OrderAbnormalRecord selectOrderAbnormalRecordById(Integer id) {
		return orderAbnormalRecordMapper.selectOrderAbnormalRecordById(id);
	}

	/**
	 * 查询订单异常记录列表
	 *
	 * @param orderAbnormalRecord 订单异常记录
	 * @return 订单异常记录
	 */
	@Override
	public List<OrderAbnormalRecord> selectOrderAbnormalRecordList(OrderAbnormalRecord orderAbnormalRecord) {
		return orderAbnormalRecordMapper.selectOrderAbnormalRecordList(orderAbnormalRecord);
	}

	/**
	 * 新增订单异常记录
	 *
	 * @param orderAbnormalRecord 订单异常记录
	 * @return 结果
	 */
	@Override
	public int insertOrderAbnormalRecord(OrderAbnormalRecord orderAbnormalRecord) {
		// orderAbnormalRecord.setCreateTime(DateUtils.getNowDate());
		return orderAbnormalRecordMapper.insertOrderAbnormalRecord(orderAbnormalRecord);
	}

	/**
	 * 修改订单异常记录
	 *
	 * @param orderAbnormalRecord 订单异常记录
	 * @return 结果
	 */
	@Override
	public int updateOrderAbnormalRecord(OrderAbnormalRecord orderAbnormalRecord) {
		return orderAbnormalRecordMapper.updateOrderAbnormalRecord(orderAbnormalRecord);
	}

	/**
	 * 批量删除订单异常记录
	 *
	 * @param ids 需要删除的订单异常记录主键
	 * @return 结果
	 */
	@Override
	public int deleteOrderAbnormalRecordByIds(Integer[] ids) {
		return orderAbnormalRecordMapper.deleteOrderAbnormalRecordByIds(ids);
	}

	/**
	 * 删除订单异常记录信息
	 *
	 * @param id 订单异常记录主键
	 * @return 结果
	 */
	@Override
	public int deleteOrderAbnormalRecordById(Integer id) {
		return orderAbnormalRecordMapper.deleteOrderAbnormalRecordById(id);
	}
}
