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.TProductDeviceMarkMapper;
import com.zehong.system.domain.track.TProductDeviceMark;
import com.zehong.system.service.track.ITProductDeviceMarkService;

/**
 * 设备装配记录Service业务层处理
 * 
 * @author zehong
 * @date 2024-08-28
 */
@Service
public class TProductDeviceMarkServiceImpl implements ITProductDeviceMarkService 
{
    @Autowired
    private TProductDeviceMarkMapper tProductDeviceMarkMapper;

    /**
     * 查询设备装配记录
     * 
     * @param id 设备装配记录ID
     * @return 设备装配记录
     */
    @Override
    public TProductDeviceMark selectTProductDeviceMarkById(Long id)
    {
        return tProductDeviceMarkMapper.selectTProductDeviceMarkById(id);
    }

    /**
     * 查询设备装配记录列表
     * 
     * @param tProductDeviceMark 设备装配记录
     * @return 设备装配记录
     */
    @Override
    public List<TProductDeviceMark> selectTProductDeviceMarkList(TProductDeviceMark tProductDeviceMark)
    {
        return tProductDeviceMarkMapper.selectTProductDeviceMarkList(tProductDeviceMark);
    }

    /**
     * 新增设备装配记录
     * 
     * @param tProductDeviceMark 设备装配记录
     * @return 结果
     */
    @Override
    public int insertTProductDeviceMark(TProductDeviceMark tProductDeviceMark)
    {
        tProductDeviceMark.setCreateTime(DateUtils.getNowDate());
        tProductDeviceMark.setCreateId(SecurityUtils.getLoginUser().getUser().getUserId());
        return tProductDeviceMarkMapper.insertTProductDeviceMark(tProductDeviceMark);
    }

    /**
     * 修改设备装配记录
     * 
     * @param tProductDeviceMark 设备装配记录
     * @return 结果
     */
    @Override
    public int updateTProductDeviceMark(TProductDeviceMark tProductDeviceMark)
    {
        return tProductDeviceMarkMapper.updateTProductDeviceMark(tProductDeviceMark);
    }

    /**
     * 批量删除设备装配记录
     * 
     * @param ids 需要删除的设备装配记录ID
     * @return 结果
     */
    @Override
    public int deleteTProductDeviceMarkByIds(Long[] ids)
    {
        return tProductDeviceMarkMapper.deleteTProductDeviceMarkByIds(ids);
    }

    /**
     * 删除设备装配记录信息
     * 
     * @param id 设备装配记录ID
     * @return 结果
     */
    @Override
    public int deleteTProductDeviceMarkById(Long id)
    {
        return tProductDeviceMarkMapper.deleteTProductDeviceMarkById(id);
    }

    /**
     * 根据产品获取设备详情
     * @param mark
     * @return
     */
    public List<TProductDeviceMark> selectDeviceMarkInfoByDeviceId(TProductDeviceMark mark){
        return tProductDeviceMarkMapper.selectDeviceMarkInfoByDeviceId(mark);
    }
}
