package com.hw.dms.service.impl;

import java.util.List;
import com.hw.common.core.utils.DateUtils;
import com.hw.system.api.model.LoginUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hw.dms.mapper.DmsBaseDeviceDebuggingMapper;
import com.hw.dms.domain.DmsBaseDeviceDebugging;
import com.hw.dms.service.IDmsBaseDeviceDebuggingService;

/**
 * 设备调试信息Service业务层处理
 *
 * @author xins
 * @date 2024-01-02
 */
@Service
public class DmsBaseDeviceDebuggingServiceImpl implements IDmsBaseDeviceDebuggingService
{
    @Autowired
    private DmsBaseDeviceDebuggingMapper dmsBaseDeviceDebuggingMapper;

    /**
     * 查询设备调试信息
     *
     * @param deviceDebuggingId 设备调试信息主键
     * @return 设备调试信息
     */
    @Override
    public DmsBaseDeviceDebugging selectDmsBaseDeviceDebuggingByDeviceDebuggingId(Long deviceDebuggingId)
    {
        return dmsBaseDeviceDebuggingMapper.selectDmsBaseDeviceDebuggingByDeviceDebuggingId(deviceDebuggingId);
    }

    /**
     * 查询设备调试信息列表
     *
     * @param dmsBaseDeviceDebugging 设备调试信息
     * @return 设备调试信息
     */
    @Override
    public List<DmsBaseDeviceDebugging> selectDmsBaseDeviceDebuggingList(DmsBaseDeviceDebugging dmsBaseDeviceDebugging)
    {
        return dmsBaseDeviceDebuggingMapper.selectDmsBaseDeviceDebuggingList(dmsBaseDeviceDebugging);
    }

    /**
     * 新增设备调试信息
     *
     * @param dmsBaseDeviceDebugging 设备调试信息
     * @return 结果
     */
    @Override
    public int insertDmsBaseDeviceDebugging(DmsBaseDeviceDebugging dmsBaseDeviceDebugging)
    {
        LoginUser loginUser = new LoginUser();
        dmsBaseDeviceDebugging.setCreateBy(loginUser.getUsername());
        dmsBaseDeviceDebugging.setCreateTime(DateUtils.getNowDate());
        return dmsBaseDeviceDebuggingMapper.insertDmsBaseDeviceDebugging(dmsBaseDeviceDebugging);
    }

    /**
     * 修改设备调试信息
     *
     * @param dmsBaseDeviceDebugging 设备调试信息
     * @return 结果
     */
    @Override
    public int updateDmsBaseDeviceDebugging(DmsBaseDeviceDebugging dmsBaseDeviceDebugging)
    {
        LoginUser loginUser = new LoginUser();
        dmsBaseDeviceDebugging.setUpdateBy(loginUser.getUsername());
        dmsBaseDeviceDebugging.setUpdateTime(DateUtils.getNowDate());
        return dmsBaseDeviceDebuggingMapper.updateDmsBaseDeviceDebugging(dmsBaseDeviceDebugging);
    }

    /**
     * 批量删除设备调试信息
     *
     * @param deviceDebuggingIds 需要删除的设备调试信息主键
     * @return 结果
     */
    @Override
    public int deleteDmsBaseDeviceDebuggingByDeviceDebuggingIds(Long[] deviceDebuggingIds)
    {
        return dmsBaseDeviceDebuggingMapper.deleteDmsBaseDeviceDebuggingByDeviceDebuggingIds(deviceDebuggingIds);
    }

    /**
     * 删除设备调试信息信息
     *
     * @param deviceDebuggingId 设备调试信息主键
     * @return 结果
     */
    @Override
    public int deleteDmsBaseDeviceDebuggingByDeviceDebuggingId(Long deviceDebuggingId)
    {
        return dmsBaseDeviceDebuggingMapper.deleteDmsBaseDeviceDebuggingByDeviceDebuggingId(deviceDebuggingId);
    }
}
