package com.ruoyi.rocketmq.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.rocketmq.mapper.RmPolicyDeviceDetailsMapper;
import com.ruoyi.rocketmq.domain.RmPolicyDeviceDetails;
import com.ruoyi.rocketmq.service.IRmPolicyDeviceDetailsService;

/**
 * 客户端策略关联Service业务层处理
 * 
 * @author gyt
 * @date 2025-10-22
 */
@Service
public class RmPolicyDeviceDetailsServiceImpl implements IRmPolicyDeviceDetailsService 
{
    @Autowired
    private RmPolicyDeviceDetailsMapper rmPolicyDeviceDetailsMapper;

    /**
     * 查询客户端策略关联
     * 
     * @param id 客户端策略关联主键
     * @return 客户端策略关联
     */
    @Override
    public RmPolicyDeviceDetails selectRmPolicyDeviceDetailsById(Long id)
    {
        return rmPolicyDeviceDetailsMapper.selectRmPolicyDeviceDetailsById(id);
    }

    /**
     * 查询客户端策略关联列表
     * 
     * @param rmPolicyDeviceDetails 客户端策略关联
     * @return 客户端策略关联
     */
    @Override
    public List<RmPolicyDeviceDetails> selectRmPolicyDeviceDetailsList(RmPolicyDeviceDetails rmPolicyDeviceDetails)
    {
        return rmPolicyDeviceDetailsMapper.selectRmPolicyDeviceDetailsList(rmPolicyDeviceDetails);
    }

    /**
     * 新增客户端策略关联
     * 
     * @param rmPolicyDeviceDetails 客户端策略关联
     * @return 结果
     */
    @Override
    public int insertRmPolicyDeviceDetails(RmPolicyDeviceDetails rmPolicyDeviceDetails)
    {
        rmPolicyDeviceDetails.setCreateTime(DateUtils.getNowDate());
        return rmPolicyDeviceDetailsMapper.insertRmPolicyDeviceDetails(rmPolicyDeviceDetails);
    }

    /**
     * 修改客户端策略关联
     * 
     * @param rmPolicyDeviceDetails 客户端策略关联
     * @return 结果
     */
    @Override
    public int updateRmPolicyDeviceDetails(RmPolicyDeviceDetails rmPolicyDeviceDetails)
    {
        rmPolicyDeviceDetails.setUpdateTime(DateUtils.getNowDate());
        return rmPolicyDeviceDetailsMapper.updateRmPolicyDeviceDetails(rmPolicyDeviceDetails);
    }

    /**
     * 批量删除客户端策略关联
     * 
     * @param ids 需要删除的客户端策略关联主键
     * @return 结果
     */
    @Override
    public int deleteRmPolicyDeviceDetailsByIds(Long[] ids)
    {
        return rmPolicyDeviceDetailsMapper.deleteRmPolicyDeviceDetailsByIds(ids);
    }

    /**
     * 删除客户端策略关联信息
     * 
     * @param id 客户端策略关联主键
     * @return 结果
     */
    @Override
    public int deleteRmPolicyDeviceDetailsById(Long id)
    {
        return rmPolicyDeviceDetailsMapper.deleteRmPolicyDeviceDetailsById(id);
    }
}
