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.OrderAddRecordMapper;
import com.ghy.order.domain.OrderAddRecord;
import com.ghy.order.service.IOrderAddRecordService;
import com.ghy.common.core.text.Convert;

/**
 * 发单加价记录Service业务层处理
 *
 * @author clunt
 * @date 2023-11-03
 */
@Service
public class OrderAddRecordServiceImpl implements IOrderAddRecordService
{
    @Autowired
    private OrderAddRecordMapper orderAddRecordMapper;

    /**
     * 查询发单加价记录
     *
     * @param id 发单加价记录主键
     * @return 发单加价记录
     */
    @Override
    public OrderAddRecord selectOrderAddRecordById(Long id)
    {
        return orderAddRecordMapper.selectOrderAddRecordById(id);
    }

    /**
     * 查询发单加价记录列表
     *
     * @param orderAddRecord 发单加价记录
     * @return 发单加价记录
     */
    @Override
    public List<OrderAddRecord> selectOrderAddRecordList(OrderAddRecord orderAddRecord)
    {
        return orderAddRecordMapper.selectOrderAddRecordList(orderAddRecord);
    }

    /**
     * 新增发单加价记录
     *
     * @param orderAddRecord 发单加价记录
     * @return 结果
     */
    @Override
    public int insertOrderAddRecord(OrderAddRecord orderAddRecord)
    {
        orderAddRecord.setCreateTime(DateUtils.getNowDate());
        return orderAddRecordMapper.insertOrderAddRecord(orderAddRecord);
    }

    /**
     * 修改发单加价记录
     *
     * @param orderAddRecord 发单加价记录
     * @return 结果
     */
    @Override
    public int updateOrderAddRecord(OrderAddRecord orderAddRecord)
    {
        orderAddRecord.setUpdateTime(DateUtils.getNowDate());
        return orderAddRecordMapper.updateOrderAddRecord(orderAddRecord);
    }

    /**
     * 批量删除发单加价记录
     *
     * @param ids 需要删除的发单加价记录主键
     * @return 结果
     */
    @Override
    public int deleteOrderAddRecordByIds(String ids)
    {
        return orderAddRecordMapper.deleteOrderAddRecordByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除发单加价记录信息
     *
     * @param id 发单加价记录主键
     * @return 结果
     */
    @Override
    public int deleteOrderAddRecordById(Long id)
    {
        return orderAddRecordMapper.deleteOrderAddRecordById(id);
    }
}