package com.pm.subsystem.service.impl;

import java.util.List;
import com.pm.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.pm.subsystem.mapper.IbmsBroadcastContentMapper;
import com.pm.subsystem.service.IIbmsBroadcastContentService;
import com.pm.common.config.PageData;

/**
 * 广播内容Service业务层处理
 *
 * @author system
 * @date 2025-01-06
 */
@Service
public class IbmsBroadcastContentServiceImpl implements IIbmsBroadcastContentService
{
    @Autowired
    private IbmsBroadcastContentMapper ibmsBroadcastContentMapper;

    /**
     * 查询广播内容
     *
     * @param id 广播内容主键
     * @return 广播内容
     */
    @Override
    public PageData selectIbmsBroadcastContentById(Long id)
    {
        return ibmsBroadcastContentMapper.selectIbmsBroadcastContentById(id);
    }

    /**
     * 查询广播内容列表
     *
     * @param pd
     * @return 广播内容
     */
    @Override
    public List<PageData> selectIbmsBroadcastContentList(PageData pd)
    {
        return ibmsBroadcastContentMapper.selectIbmsBroadcastContentList(pd);
    }

    /**
     * 新增广播内容
     *
     * @param pd
     * @return 结果
     */
    @Override
    public int insertIbmsBroadcastContent(PageData pd)
    {
        pd.put("createTime", DateUtils.getTime());
        return ibmsBroadcastContentMapper.insertIbmsBroadcastContent(pd);
    }

    /**
     * 修改广播内容
     *
     * @param pd
     * @return 结果
     */
    @Override
    public int updateIbmsBroadcastContent(PageData pd)
    {
        return ibmsBroadcastContentMapper.updateIbmsBroadcastContent(pd);
    }

    /**
     * 批量删除广播内容
     *
     * @param ids 需要删除的广播内容主键
     * @return 结果
     */
    @Override
    public int deleteIbmsBroadcastContentByIds(Long[] ids)
    {
        return ibmsBroadcastContentMapper.deleteIbmsBroadcastContentByIds(ids);
    }

    /**
     * 删除广播内容信息
     *
     * @param id 广播内容主键
     * @return 结果
     */
    @Override
    public int deleteIbmsBroadcastContentById(Long id)
    {
        return ibmsBroadcastContentMapper.deleteIbmsBroadcastContentById(id);
    }
}