package com.ruoyi.warehouseBusiness.service.impl;


import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.warehouseBusiness.domain.TWarehousebillsitems;
import com.ruoyi.warehouseBusiness.mapper.TWarehousebillsitemsMapper;
import com.ruoyi.warehouseBusiness.service.ITWarehousebillsitemsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 仓库明细从表Service业务层处理
 *
 * @author ruoyi
 * @date 2020-12-11
 */
@Service
public class TWarehousebillsitemsServiceImpl implements ITWarehousebillsitemsService {
    @Autowired
    private TWarehousebillsitemsMapper tWarehousebillsitemsMapper;

    /**
     * 查询仓库明细从表
     *
     * @param fId 仓库明细从表ID
     * @return 仓库明细从表
     */
    @Override
    public TWarehousebillsitems selectTWarehousebillsitemsById(Long fId) {
        return tWarehousebillsitemsMapper.selectTWarehousebillsitemsById(fId);
    }

    /**
     * 查询仓库明细从表列表
     *
     * @param tWarehousebillsitems 仓库明细从表
     * @return 仓库明细从表
     */
    @Override
    public List<TWarehousebillsitems> selectTWarehousebillsitemsList(TWarehousebillsitems tWarehousebillsitems) {
        return tWarehousebillsitemsMapper.selectTWarehousebillsitemsList(tWarehousebillsitems);
    }

    /**
     * 新增仓库明细从表
     *
     * @param tWarehousebillsitems 仓库明细从表
     * @return 结果
     */
    @Override
    public int insertTWarehousebillsitems(TWarehousebillsitems tWarehousebillsitems) {
        tWarehousebillsitems.setCreateTime(DateUtils.getNowDate());
        return tWarehousebillsitemsMapper.insertTWarehousebillsitems(tWarehousebillsitems);
    }

    /**
     * 修改仓库明细从表
     *
     * @param tWarehousebillsitems 仓库明细从表
     * @return 结果
     */
    @Override
    public int updateTWarehousebillsitems(TWarehousebillsitems tWarehousebillsitems) {
        tWarehousebillsitems.setUpdateTime(DateUtils.getNowDate());
        return tWarehousebillsitemsMapper.updateTWarehousebillsitems(tWarehousebillsitems);
    }

    /**
     * 批量删除仓库明细从表
     *
     * @param fIds 需要删除的仓库明细从表ID
     * @return 结果
     */
    @Override
    public int deleteTWarehousebillsitemsByIds(Long[] fIds) {
        return tWarehousebillsitemsMapper.deleteTWarehousebillsitemsByIds(fIds);
    }

    /**
     * 删除仓库明细从表信息
     *
     * @param fId 仓库明细从表ID
     * @return 结果
     */
    @Override
    public int deleteTWarehousebillsitemsById(Long fId) {
        return tWarehousebillsitemsMapper.deleteTWarehousebillsitemsById(fId);
    }
}
