package com.bonus.material.push.service.impl;

import java.util.List;
import com.bonus.common.core.exception.ServiceException;
import com.bonus.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.bonus.material.push.mapper.PushDataReceiveDetailMapper;
import com.bonus.material.push.domain.PushDataReceiveDetail;
import com.bonus.material.push.service.IPushDataReceiveDetailService;

/**
 * 推送接收明细Service业务层处理
 * 
 * @author xsheng
 * @date 2024-10-16
 */
@Service
public class PushDataReceiveDetailServiceImpl implements IPushDataReceiveDetailService {
    @Autowired
    private PushDataReceiveDetailMapper pushDataReceiveDetailMapper;

    /**
     * 查询推送接收明细
     * 
     * @param id 推送接收明细主键
     * @return 推送接收明细
     */
    @Override
    public PushDataReceiveDetail selectPushDataReceiveDetailById(Long id) {
        return pushDataReceiveDetailMapper.selectPushDataReceiveDetailById(id);
    }

    /**
     * 查询推送接收明细列表
     * 
     * @param pushDataReceiveDetail 推送接收明细
     * @return 推送接收明细
     */
    @Override
    public List<PushDataReceiveDetail> selectPushDataReceiveDetailList(PushDataReceiveDetail pushDataReceiveDetail) {
        return pushDataReceiveDetailMapper.selectPushDataReceiveDetailList(pushDataReceiveDetail);
    }

    /**
     * 新增推送接收明细
     * 
     * @param pushDataReceiveDetail 推送接收明细
     * @return 结果
     */
    @Override
    public int insertPushDataReceiveDetail(PushDataReceiveDetail pushDataReceiveDetail) {
        pushDataReceiveDetail.setCreateTime(DateUtils.getNowDate());
        try {
            return pushDataReceiveDetailMapper.insertPushDataReceiveDetail(pushDataReceiveDetail);
        } catch (Exception e) {
            throw new ServiceException("错误信息描述");
        }
    }

    /**
     * 修改推送接收明细
     * 
     * @param pushDataReceiveDetail 推送接收明细
     * @return 结果
     */
    @Override
    public int updatePushDataReceiveDetail(PushDataReceiveDetail pushDataReceiveDetail) {
        pushDataReceiveDetail.setUpdateTime(DateUtils.getNowDate());
        try {
            return pushDataReceiveDetailMapper.updatePushDataReceiveDetail(pushDataReceiveDetail);
        } catch (Exception e) {
            throw new ServiceException("错误信息描述");
        }
    }

    /**
     * 批量删除推送接收明细
     * 
     * @param ids 需要删除的推送接收明细主键
     * @return 结果
     */
    @Override
    public int deletePushDataReceiveDetailByIds(Long[] ids) {
        return pushDataReceiveDetailMapper.deletePushDataReceiveDetailByIds(ids);
    }

    /**
     * 删除推送接收明细信息
     * 
     * @param id 推送接收明细主键
     * @return 结果
     */
    @Override
    public int deletePushDataReceiveDetailById(Long id) {
        return pushDataReceiveDetailMapper.deletePushDataReceiveDetailById(id);
    }
}
