package com.ruoyi.shipping.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.shipping.mapper.TCtnpriceItemsMapper;
import com.ruoyi.shipping.domain.TCtnpriceItems;
import com.ruoyi.shipping.service.ITCtnpriceItemsService;

/**
 * 海运运价从Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-04-06
 */
@Service
public class TCtnpriceItemsServiceImpl implements ITCtnpriceItemsService 
{
    @Autowired
    private TCtnpriceItemsMapper tCtnpriceItemsMapper;

    /**
     * 查询海运运价从
     * 
     * @param fId 海运运价从ID
     * @return 海运运价从
     */
    @Override
    public TCtnpriceItems selectTCtnpriceItemsById(Long fId)
    {
        return tCtnpriceItemsMapper.selectTCtnpriceItemsById(fId);
    }

    /**
     * 查询海运运价从列表
     * 
     * @param tCtnpriceItems 海运运价从
     * @return 海运运价从
     */
    @Override
    public List<TCtnpriceItems> selectTCtnpriceItemsList(TCtnpriceItems tCtnpriceItems)
    {
        return tCtnpriceItemsMapper.selectTCtnpriceItemsList(tCtnpriceItems);
    }

    /**
     * 新增海运运价从
     * 
     * @param tCtnpriceItems 海运运价从
     * @return 结果
     */
    @Override
    public int insertTCtnpriceItems(TCtnpriceItems tCtnpriceItems)
    {
        tCtnpriceItems.setCreateTime(DateUtils.getNowDate());
        tCtnpriceItems.setCreateBy(SecurityUtils.getUsername());
        return tCtnpriceItemsMapper.insertTCtnpriceItems(tCtnpriceItems);
    }

    /**
     * 修改海运运价从
     * 
     * @param tCtnpriceItems 海运运价从
     * @return 结果
     */
    @Override
    public int updateTCtnpriceItems(TCtnpriceItems tCtnpriceItems)
    {
        tCtnpriceItems.setUpdateTime(DateUtils.getNowDate());
        tCtnpriceItems.setUpdateBy(SecurityUtils.getUsername());
        return tCtnpriceItemsMapper.updateTCtnpriceItems(tCtnpriceItems);
    }

    /**
     * 批量删除海运运价从
     * 
     * @param fIds 需要删除的海运运价从ID
     * @return 结果
     */
    @Override
    public int deleteTCtnpriceItemsByIds(Long[] fIds)
    {
        return tCtnpriceItemsMapper.deleteTCtnpriceItemsByIds(fIds);
    }

    /**
     * 删除海运运价从信息
     * 
     * @param fId 海运运价从ID
     * @return 结果
     */
    @Override
    public int deleteTCtnpriceItemsById(Long fId)
    {
        return tCtnpriceItemsMapper.deleteTCtnpriceItemsById(fId);
    }

    @Override
    public List<Long> containerPrice(TCtnpriceItems tCtnpriceItems) {
        return tCtnpriceItemsMapper.containerPrice(tCtnpriceItems);
    }
}
