package com.ruoyi.warehouseBusiness.service.impl;


import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.warehouseBusiness.domain.TWarehouseAgreementitems;
import com.ruoyi.warehouseBusiness.domain.dto.TWarehouseAgreementitem;
import com.ruoyi.warehouseBusiness.mapper.TWarehouseAgreementitemsMapper;
import com.ruoyi.warehouseBusiness.service.ITWarehouseAgreementitemsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * 仓储费明细表Service业务层处理
 *
 * @author ruoyi
 * @date 2020-12-11
 */
@Service
public class TWarehouseAgreementitemsServiceImpl implements ITWarehouseAgreementitemsService {
    @Autowired
    private TWarehouseAgreementitemsMapper tWarehouseAgreementitemsMapper;

    /**
     * 查询仓储费明细表
     *
     * @param fId 仓储费明细表ID
     * @return 仓储费明细表
     */
    @Override
    public TWarehouseAgreementitems selectTWarehouseAgreementitemsById(Long fId) {
        return tWarehouseAgreementitemsMapper.selectTWarehouseAgreementitemsById(fId);
    }

    /**
     * 查询仓储费明细表列表
     *
     * @param tWarehouseAgreementitems 仓储费明细表
     * @return 仓储费明细表
     */
    @Override
    public List<TWarehouseAgreementitems> selectTWarehouseAgreementitemsList(TWarehouseAgreementitems tWarehouseAgreementitems) {
        return tWarehouseAgreementitemsMapper.selectTWarehouseAgreementitemsList(tWarehouseAgreementitems);
    }

    @Override
    public List<Map<String, Object>> selectTWarehouseAgreementitemsList1(TWarehouseAgreementitems tWarehouseAgreementitems) {
        return tWarehouseAgreementitemsMapper.selectTWarehouseAgreementitemsList1(tWarehouseAgreementitems);
    }

    @Override
    public List<Map<String, Object>> selectTWarehouseAgreementitemList(TWarehouseAgreementitem tWarehouseAgreementitem) {
        return tWarehouseAgreementitemsMapper.selectTWarehouseAgreementitemList(tWarehouseAgreementitem);
    }

    /**
     * 新增仓储费明细表
     *
     * @param tWarehouseAgreementitems 仓储费明细表
     * @return 结果
     */
    @Override
    public int insertTWarehouseAgreementitems(TWarehouseAgreementitems tWarehouseAgreementitems) {
        tWarehouseAgreementitems.setCreateTime(DateUtils.getNowDate());
        return tWarehouseAgreementitemsMapper.insertTWarehouseAgreementitems(tWarehouseAgreementitems);
    }

    /**
     * 修改仓储费明细表
     *
     * @param tWarehouseAgreementitems 仓储费明细表
     * @return 结果
     */
    @Override
    public int updateTWarehouseAgreementitems(TWarehouseAgreementitems tWarehouseAgreementitems) {
        tWarehouseAgreementitems.setUpdateTime(DateUtils.getNowDate());
        return tWarehouseAgreementitemsMapper.updateTWarehouseAgreementitems(tWarehouseAgreementitems);
    }

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

    /**
     * 删除仓储费明细表信息
     *
     * @param fId 仓储费明细表ID
     * @return 结果
     */
    @Override
    public int deleteTWarehouseAgreementitemsById(Long fId) {
        return tWarehouseAgreementitemsMapper.deleteTWarehouseAgreementitemsById(fId);
    }
}
