package com.hw.mes.service.impl;

import java.util.List;
import com.hw.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hw.mes.mapper.MesSaleOrderMapper;
import com.hw.mes.domain.MesSaleOrder;
import com.hw.mes.service.IMesSaleOrderService;

/**
 * 销售订单信息Service业务层处理
 * 
 * @author Yinq
 * @date 2024-02-19
 */
@Service
public class MesSaleOrderServiceImpl implements IMesSaleOrderService 
{
    @Autowired
    private MesSaleOrderMapper mesSaleOrderMapper;

    /**
     * 查询销售订单信息
     * 
     * @param saleOrderId 销售订单信息主键
     * @return 销售订单信息
     */
    @Override
    public MesSaleOrder selectMesSaleOrderBySaleOrderId(Long saleOrderId)
    {
        return mesSaleOrderMapper.selectMesSaleOrderBySaleOrderId(saleOrderId);
    }

    /**
     * 查询销售订单信息列表
     * 
     * @param mesSaleOrder 销售订单信息
     * @return 销售订单信息
     */
    @Override
    public List<MesSaleOrder> selectMesSaleOrderList(MesSaleOrder mesSaleOrder)
    {
        return mesSaleOrderMapper.selectMesSaleOrderList(mesSaleOrder);
    }

    /**
     * 新增销售订单信息
     * 
     * @param mesSaleOrder 销售订单信息
     * @return 结果
     */
    @Override
    public int insertMesSaleOrder(MesSaleOrder mesSaleOrder)
    {
        mesSaleOrder.setCreateTime(DateUtils.getNowDate());
        return mesSaleOrderMapper.insertMesSaleOrder(mesSaleOrder);
    }

    /**
     * 修改销售订单信息
     * 
     * @param mesSaleOrder 销售订单信息
     * @return 结果
     */
    @Override
    public int updateMesSaleOrder(MesSaleOrder mesSaleOrder)
    {
        mesSaleOrder.setUpdateTime(DateUtils.getNowDate());
        return mesSaleOrderMapper.updateMesSaleOrder(mesSaleOrder);
    }

    /**
     * 批量删除销售订单信息
     * 
     * @param saleOrderIds 需要删除的销售订单信息主键
     * @return 结果
     */
    @Override
    public int deleteMesSaleOrderBySaleOrderIds(Long[] saleOrderIds)
    {
        return mesSaleOrderMapper.deleteMesSaleOrderBySaleOrderIds(saleOrderIds);
    }

    /**
     * 删除销售订单信息信息
     * 
     * @param saleOrderId 销售订单信息主键
     * @return 结果
     */
    @Override
    public int deleteMesSaleOrderBySaleOrderId(Long saleOrderId)
    {
        return mesSaleOrderMapper.deleteMesSaleOrderBySaleOrderId(saleOrderId);
    }
}
