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.WhDirectApplyInfoMapper;
import com.bonus.material.warehouse.domain.WhDirectApplyInfo;
import com.bonus.material.warehouse.service.IWhDirectApplyInfoService;

/**
 * 工地直转信息Service业务层处理
 * 
 * @author xsheng
 * @date 2024-09-27
 */
@Service
public class WhDirectApplyInfoServiceImpl implements IWhDirectApplyInfoService 
{
    @Autowired
    private WhDirectApplyInfoMapper whDirectApplyInfoMapper;

    /**
     * 查询工地直转信息
     * 
     * @param id 工地直转信息主键
     * @return 工地直转信息
     */
    @Override
    public WhDirectApplyInfo selectWhDirectApplyInfoById(Long id)
    {
        return whDirectApplyInfoMapper.selectWhDirectApplyInfoById(id);
    }

    /**
     * 查询工地直转信息列表
     * 
     * @param whDirectApplyInfo 工地直转信息
     * @return 工地直转信息
     */
    @Override
    public List<WhDirectApplyInfo> selectWhDirectApplyInfoList(WhDirectApplyInfo whDirectApplyInfo)
    {
        return whDirectApplyInfoMapper.selectWhDirectApplyInfoList(whDirectApplyInfo);
    }

    /**
     * 新增工地直转信息
     * 
     * @param whDirectApplyInfo 工地直转信息
     * @return 结果
     */
    @Override
    public int insertWhDirectApplyInfo(WhDirectApplyInfo whDirectApplyInfo)
    {
        whDirectApplyInfo.setCreateTime(DateUtils.getNowDate());
        return whDirectApplyInfoMapper.insertWhDirectApplyInfo(whDirectApplyInfo);
    }

    /**
     * 修改工地直转信息
     * 
     * @param whDirectApplyInfo 工地直转信息
     * @return 结果
     */
    @Override
    public int updateWhDirectApplyInfo(WhDirectApplyInfo whDirectApplyInfo)
    {
        whDirectApplyInfo.setUpdateTime(DateUtils.getNowDate());
        return whDirectApplyInfoMapper.updateWhDirectApplyInfo(whDirectApplyInfo);
    }

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

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