package com.bonus.sgzb.system.service.impl;

import java.util.List;

import com.bonus.sgzb.system.api.domain.SysUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.bonus.sgzb.system.mapper.PurchaseNoticePersonMapper;
import com.bonus.sgzb.system.domain.PurchaseNoticePerson;
import com.bonus.sgzb.system.service.IPurchaseNoticePersonService;

/**
 * 新购短信通知人员purchase_notice_personService业务层处理
 * 
 * @author bonus
 * @date 2023-12-16
 */
@Service
public class PurchaseNoticePersonServiceImpl implements IPurchaseNoticePersonService 
{
    @Autowired
    private PurchaseNoticePersonMapper purchaseNoticePersonMapper;

    /**
     * 查询新购短信通知人员purchase_notice_person
     * 
     * @param id 新购短信通知人员purchase_notice_person主键
     * @return 新购短信通知人员purchase_notice_person
     */
    @Override
    public PurchaseNoticePerson selectPurchaseNoticePersonById(Long id)
    {
        return purchaseNoticePersonMapper.selectPurchaseNoticePersonById(id);
    }

    /**
     * 查询新购短信通知人员purchase_notice_person列表
     * 
     * @param purchaseNoticePerson 新购短信通知人员purchase_notice_person
     * @return 新购短信通知人员purchase_notice_person
     */
    @Override
    public List<PurchaseNoticePerson> selectPurchaseNoticePersonList(PurchaseNoticePerson purchaseNoticePerson)
    {
        List<PurchaseNoticePerson> purchaseNoticePeople = purchaseNoticePersonMapper.selectPurchaseNoticePersonList(purchaseNoticePerson);

        return purchaseNoticePeople;
    }

    /**
     * 新增新购短信通知人员purchase_notice_person
     * 
     * @param purchaseNoticePerson 新购短信通知人员purchase_notice_person
     * @return 结果
     */
    @Override
    public int insertPurchaseNoticePerson(PurchaseNoticePerson purchaseNoticePerson)
    {
        return purchaseNoticePersonMapper.insertPurchaseNoticePerson(purchaseNoticePerson);
    }

    /**
     * 修改新购短信通知人员purchase_notice_person
     * 
     * @param purchaseNoticePerson 新购短信通知人员purchase_notice_person
     * @return 结果
     */
    @Override
    public int updatePurchaseNoticePerson(PurchaseNoticePerson purchaseNoticePerson)
    {
        return purchaseNoticePersonMapper.updatePurchaseNoticePerson(purchaseNoticePerson);
    }

    /**
     * 批量删除新购短信通知人员purchase_notice_person
     * 
     * @param ids 需要删除的新购短信通知人员purchase_notice_person主键
     * @return 结果
     */
    @Override
    public int deletePurchaseNoticePersonByIds(Long[] ids)
    {
        return purchaseNoticePersonMapper.deletePurchaseNoticePersonByIds(ids);
    }

    /**
     * 删除新购短信通知人员purchase_notice_person信息
     * 
     * @param userId 新购短信通知人员purchase_notice_person主键
     * @return 结果
     */
    @Override
    public int deletePurchaseNoticePersonById(Long userId)
    {
        return purchaseNoticePersonMapper.deletePurchaseNoticePersonById(userId);
    }

    /**
     * 查询添加人员
     * @param sysUser
     * @return
     */
    @Override
    public List<PurchaseNoticePerson> getUserByRoleList(SysUser sysUser) {
        return purchaseNoticePersonMapper.getUserByRoleList(sysUser);
    }

    /**
     * 批量添加人员
     * @param purchaseNoticePersonList
     * @return
     */
    @Override
    public int insertPurchaseNoticePersonList(List<PurchaseNoticePerson> purchaseNoticePersonList) {
        for (PurchaseNoticePerson purchaseNoticePerson : purchaseNoticePersonList) {
            insertPurchaseNoticePerson(purchaseNoticePerson);
        }
        return 1;
    }
}
