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.OrderWarnRecordMapper;
import com.ghy.order.domain.OrderWarnRecord;
import com.ghy.order.service.IOrderWarnRecordService;
import com.ghy.common.core.text.Convert;

/**
 * 订单急报记录Service业务层处理
 *
 * @author clunt
 * @date 2024-02-18
 */
@Service
public class OrderWarnRecordServiceImpl implements IOrderWarnRecordService
{
    @Autowired
    private OrderWarnRecordMapper orderWarnRecordMapper;

    /**
     * 查询订单急报记录
     *
     * @param id 订单急报记录主键
     * @return 订单急报记录
     */
    @Override
    public OrderWarnRecord selectOrderWarnRecordById(Long id)
    {
        return orderWarnRecordMapper.selectOrderWarnRecordById(id);
    }

    /**
     * 查询订单急报记录列表
     *
     * @param orderWarnRecord 订单急报记录
     * @return 订单急报记录
     */
    @Override
    public List<OrderWarnRecord> selectOrderWarnRecordList(OrderWarnRecord orderWarnRecord)
    {
        return orderWarnRecordMapper.selectOrderWarnRecordList(orderWarnRecord);
    }

    /**
     * 新增订单急报记录
     *
     * @param orderWarnRecord 订单急报记录
     * @return 结果
     */
    @Override
    public int insertOrderWarnRecord(OrderWarnRecord orderWarnRecord)
    {
        orderWarnRecord.setCreateTime(DateUtils.getNowDate());
        return orderWarnRecordMapper.insertOrderWarnRecord(orderWarnRecord);
    }

    /**
     * 修改订单急报记录
     *
     * @param orderWarnRecord 订单急报记录
     * @return 结果
     */
    @Override
    public int updateOrderWarnRecord(OrderWarnRecord orderWarnRecord)
    {
        orderWarnRecord.setUpdateTime(DateUtils.getNowDate());
        return orderWarnRecordMapper.updateOrderWarnRecord(orderWarnRecord);
    }

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

    /**
     * 删除订单急报记录信息
     *
     * @param id 订单急报记录主键
     * @return 结果
     */
    @Override
    public int deleteOrderWarnRecordById(Long id)
    {
        return orderWarnRecordMapper.deleteOrderWarnRecordById(id);
    }
}
