package com.zehong.system.service.impl.track;

import java.util.List;
import com.zehong.common.utils.DateUtils;
import com.zehong.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zehong.system.mapper.track.TProductDeviceTestMapper;
import com.zehong.system.domain.track.TProductDeviceTest;
import com.zehong.system.service.track.ITProductDeviceTestService;

/**
 * 设备检测Service业务层处理
 * 
 * @author zehong
 * @date 2024-08-29
 */
@Service
public class TProductDeviceTestServiceImpl implements ITProductDeviceTestService 
{
    @Autowired
    private TProductDeviceTestMapper tProductDeviceTestMapper;

    /**
     * 查询设备检测
     * 
     * @param id 设备检测ID
     * @return 设备检测
     */
    @Override
    public TProductDeviceTest selectTProductDeviceTestById(Long id)
    {
        return tProductDeviceTestMapper.selectTProductDeviceTestById(id);
    }

    /**
     * 查询设备检测列表
     * 
     * @param tProductDeviceTest 设备检测
     * @return 设备检测
     */
    @Override
    public List<TProductDeviceTest> selectTProductDeviceTestList(TProductDeviceTest tProductDeviceTest)
    {
        return tProductDeviceTestMapper.selectTProductDeviceTestList(tProductDeviceTest);
    }

    /**
     * 新增设备检测
     * 
     * @param tProductDeviceTest 设备检测
     * @return 结果
     */
    @Override
    public int insertTProductDeviceTest(TProductDeviceTest tProductDeviceTest)
    {
        tProductDeviceTest.setCreateTime(DateUtils.getNowDate());
        tProductDeviceTest.setCreateId(SecurityUtils.getLoginUser().getUser().getUserId());
        return tProductDeviceTestMapper.insertTProductDeviceTest(tProductDeviceTest);
    }

    /**
     * 修改设备检测
     * 
     * @param tProductDeviceTest 设备检测
     * @return 结果
     */
    @Override
    public int updateTProductDeviceTest(TProductDeviceTest tProductDeviceTest)
    {
        return tProductDeviceTestMapper.updateTProductDeviceTest(tProductDeviceTest);
    }

    /**
     * 批量删除设备检测
     * 
     * @param ids 需要删除的设备检测ID
     * @return 结果
     */
    @Override
    public int deleteTProductDeviceTestByIds(Long[] ids)
    {
        return tProductDeviceTestMapper.deleteTProductDeviceTestByIds(ids);
    }

    /**
     * 删除设备检测信息
     * 
     * @param id 设备检测ID
     * @return 结果
     */
    @Override
    public int deleteTProductDeviceTestById(Long id)
    {
        return tProductDeviceTestMapper.deleteTProductDeviceTestById(id);
    }
}
