package com.ruoyi.nanjing.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.nanjing.mapper.TRpWorktrayhistoryinfoMapper;
import com.ruoyi.nanjing.domain.TRpWorktrayhistoryinfo;
import com.ruoyi.nanjing.service.ITRpWorktrayhistoryinfoService;
import com.ruoyi.common.core.text.Convert;

/**
 * 工位历史生产信息Service业务层处理
 * 
 * @author limy
 * @date 2021-01-28
 */
@Service
public class TRpWorktrayhistoryinfoServiceImpl implements ITRpWorktrayhistoryinfoService 
{
    @Autowired
    private TRpWorktrayhistoryinfoMapper tRpWorktrayhistoryinfoMapper;

    /**
     * 查询工位历史生产信息
     * 
     * @param currentStation 工位历史生产信息ID
     * @return 工位历史生产信息
     */
    @Override
    public TRpWorktrayhistoryinfo selectTRpWorktrayhistoryinfoById(String currentStation)
    {
        return tRpWorktrayhistoryinfoMapper.selectTRpWorktrayhistoryinfoById(currentStation);
    }

    /**
     * 查询工位历史生产信息列表
     * 
     * @param tRpWorktrayhistoryinfo 工位历史生产信息
     * @return 工位历史生产信息
     */
    @Override
    public List<TRpWorktrayhistoryinfo> selectTRpWorktrayhistoryinfoList(TRpWorktrayhistoryinfo tRpWorktrayhistoryinfo)
    {
        return tRpWorktrayhistoryinfoMapper.selectTRpWorktrayhistoryinfoList(tRpWorktrayhistoryinfo);
    }

    /**
     * 新增工位历史生产信息
     * 
     * @param tRpWorktrayhistoryinfo 工位历史生产信息
     * @return 结果
     */
    @Override
    public int insertTRpWorktrayhistoryinfo(TRpWorktrayhistoryinfo tRpWorktrayhistoryinfo)
    {
        return tRpWorktrayhistoryinfoMapper.insertTRpWorktrayhistoryinfo(tRpWorktrayhistoryinfo);
    }

    /**
     * 修改工位历史生产信息
     * 
     * @param tRpWorktrayhistoryinfo 工位历史生产信息
     * @return 结果
     */
    @Override
    public int updateTRpWorktrayhistoryinfo(TRpWorktrayhistoryinfo tRpWorktrayhistoryinfo)
    {
        tRpWorktrayhistoryinfo.setUpdateTime(DateUtils.getNowDate());
        return tRpWorktrayhistoryinfoMapper.updateTRpWorktrayhistoryinfo(tRpWorktrayhistoryinfo);
    }

    /**
     * 删除工位历史生产信息对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteTRpWorktrayhistoryinfoByIds(String ids)
    {
        return tRpWorktrayhistoryinfoMapper.deleteTRpWorktrayhistoryinfoByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除工位历史生产信息信息
     * 
     * @param currentStation 工位历史生产信息ID
     * @return 结果
     */
    @Override
    public int deleteTRpWorktrayhistoryinfoById(String currentStation)
    {
        return tRpWorktrayhistoryinfoMapper.deleteTRpWorktrayhistoryinfoById(currentStation);
    }
}
