package com.bonus.material.warehouse.service.impl;

import java.util.List;
import com.bonus.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.bonus.material.warehouse.mapper.WhDirectApplyDetailsMapper;
import com.bonus.material.warehouse.domain.WhDirectApplyDetails;
import com.bonus.material.warehouse.service.IWhDirectApplyDetailsService;

/**
 * 工地直转详情Service业务层处理
 * 
 * @author xsheng
 * @date 2024-09-27
 */
@Service
public class WhDirectApplyDetailsServiceImpl implements IWhDirectApplyDetailsService 
{
    @Autowired
    private WhDirectApplyDetailsMapper whDirectApplyDetailsMapper;

    /**
     * 查询工地直转详情
     * 
     * @param id 工地直转详情主键
     * @return 工地直转详情
     */
    @Override
    public WhDirectApplyDetails selectWhDirectApplyDetailsById(Long id)
    {
        return whDirectApplyDetailsMapper.selectWhDirectApplyDetailsById(id);
    }

    /**
     * 查询工地直转详情列表
     * 
     * @param whDirectApplyDetails 工地直转详情
     * @return 工地直转详情
     */
    @Override
    public List<WhDirectApplyDetails> selectWhDirectApplyDetailsList(WhDirectApplyDetails whDirectApplyDetails)
    {
        return whDirectApplyDetailsMapper.selectWhDirectApplyDetailsList(whDirectApplyDetails);
    }

    /**
     * 新增工地直转详情
     * 
     * @param whDirectApplyDetails 工地直转详情
     * @return 结果
     */
    @Override
    public int insertWhDirectApplyDetails(WhDirectApplyDetails whDirectApplyDetails)
    {
        whDirectApplyDetails.setCreateTime(DateUtils.getNowDate());
        return whDirectApplyDetailsMapper.insertWhDirectApplyDetails(whDirectApplyDetails);
    }

    /**
     * 修改工地直转详情
     * 
     * @param whDirectApplyDetails 工地直转详情
     * @return 结果
     */
    @Override
    public int updateWhDirectApplyDetails(WhDirectApplyDetails whDirectApplyDetails)
    {
        whDirectApplyDetails.setUpdateTime(DateUtils.getNowDate());
        return whDirectApplyDetailsMapper.updateWhDirectApplyDetails(whDirectApplyDetails);
    }

    /**
     * 批量删除工地直转详情
     * 
     * @param ids 需要删除的工地直转详情主键
     * @return 结果
     */
    @Override
    public int deleteWhDirectApplyDetailsByIds(Long[] ids)
    {
        return whDirectApplyDetailsMapper.deleteWhDirectApplyDetailsByIds(ids);
    }

    /**
     * 删除工地直转详情信息
     * 
     * @param id 工地直转详情主键
     * @return 结果
     */
    @Override
    public int deleteWhDirectApplyDetailsById(Long id)
    {
        return whDirectApplyDetailsMapper.deleteWhDirectApplyDetailsById(id);
    }
}
