package com.cmvr.device.service.impl;

import java.util.List;
import com.cmvr.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Service;
import com.cmvr.device.mapper.DeDeviceTerminalConfigMapper;
import com.cmvr.device.domain.DeDeviceTerminalConfig;
import com.cmvr.device.service.IDeDeviceTerminalConfigService;

/**
 * 设备终端配置Service业务层处理
 * 
 * @author cmvr-iot
 * @date 2025-05-08
 */
@Service
public class DeDeviceTerminalConfigServiceImpl implements IDeDeviceTerminalConfigService 
{
    @Autowired
    private DeDeviceTerminalConfigMapper deDeviceTerminalConfigMapper;

    /**
     * 查询设备终端配置
     * 
     * @param id 设备终端配置主键
     * @return 设备终端配置
     */
    @Override
    public DeDeviceTerminalConfig selectDeDeviceTerminalConfigById(String id)
    {
        return deDeviceTerminalConfigMapper.selectDeDeviceTerminalConfigById(id);
    }

    /**
     * 查询设备终端配置列表
     * 
     * @param deDeviceTerminalConfig 设备终端配置
     * @return 设备终端配置
     */
    @Override
    public List<DeDeviceTerminalConfig> selectDeDeviceTerminalConfigList(DeDeviceTerminalConfig deDeviceTerminalConfig)
    {
        return deDeviceTerminalConfigMapper.selectDeDeviceTerminalConfigList(deDeviceTerminalConfig);
    }

    /**
     * 新增设备终端配置
     * 
     * @param deDeviceTerminalConfig 设备终端配置
     * @return 结果
     */
    @Override
    public int insertDeDeviceTerminalConfig(DeDeviceTerminalConfig deDeviceTerminalConfig)
    {
        deDeviceTerminalConfig.setCreateTime(DateUtils.getNowDate());
        deDeviceTerminalConfig.setStatus("1");
        return this.deDeviceTerminalConfigMapper.insert(deDeviceTerminalConfig);
    }

    /**
     * 修改设备终端配置
     * 
     * @param deDeviceTerminalConfig 设备终端配置
     * @return 结果
     */
    @Override
    public int updateDeDeviceTerminalConfig(DeDeviceTerminalConfig deDeviceTerminalConfig)
    {
        deDeviceTerminalConfig.setUpdateTime(DateUtils.getNowDate());
        return deDeviceTerminalConfigMapper.updateDeDeviceTerminalConfig(deDeviceTerminalConfig);
    }

    /**
     * 批量删除设备终端配置
     * 
     * @param ids 需要删除的设备终端配置主键
     * @return 结果
     */
    @Override
    public int deleteDeDeviceTerminalConfigByIds(String[] ids)
    {
        return deDeviceTerminalConfigMapper.deleteDeDeviceTerminalConfigByIds(ids);
    }

    /**
     * 删除设备终端配置信息
     * 
     * @param id 设备终端配置主键
     * @return 结果
     */
    @Override
    public int deleteDeDeviceTerminalConfigById(String id)
    {
        return deDeviceTerminalConfigMapper.deleteDeDeviceTerminalConfigById(id);
    }
}
