package com.playlet.system.service.impl;

import java.util.List;
import com.playlet.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.playlet.system.mapper.PlayletPublicAccountMapper;
import com.playlet.system.domain.PlayletPublicAccount;
import com.playlet.system.service.IPlayletPublicAccountService;
import com.playlet.common.core.text.Convert;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

/**
 * 公众号列Service业务层处理
 *
 * @author ruoyi
 * @date 2024-04-07
 */
@Service
public class PlayletPublicAccountServiceImpl extends ServiceImpl<PlayletPublicAccountMapper, PlayletPublicAccount> implements IPlayletPublicAccountService
{
    @Autowired
    private PlayletPublicAccountMapper playletPublicAccountMapper;

    /**
     * 查询公众号列
     *
     * @param id 公众号列主键
     * @return 公众号列
     */
    @Override
    public PlayletPublicAccount selectPlayletPublicAccountById(Long id)
    {
        return playletPublicAccountMapper.selectPlayletPublicAccountById(id);
    }

    /**
     * 查询公众号列列表
     *
     * @param playletPublicAccount 公众号列
     * @return 公众号列
     */
    @Override
    public List<PlayletPublicAccount> selectPlayletPublicAccountList(PlayletPublicAccount playletPublicAccount)
    {
        return playletPublicAccountMapper.selectPlayletPublicAccountList(playletPublicAccount);
    }

    /**
     * 新增公众号列
     *
     * @param playletPublicAccount 公众号列
     * @return 结果
     */
    @Override
    public int insertPlayletPublicAccount(PlayletPublicAccount playletPublicAccount)
    {
        playletPublicAccount.setCreateTime(DateUtils.getNowDate());
        return playletPublicAccountMapper.insertPlayletPublicAccount(playletPublicAccount);
    }

    /**
     * 修改公众号列
     *
     * @param playletPublicAccount 公众号列
     * @return 结果
     */
    @Override
    public int updatePlayletPublicAccount(PlayletPublicAccount playletPublicAccount)
    {
        playletPublicAccount.setUpdateTime(DateUtils.getNowDate());
        return playletPublicAccountMapper.updatePlayletPublicAccount(playletPublicAccount);
    }

    /**
     * 批量删除公众号列
     *
     * @param ids 需要删除的公众号列主键
     * @return 结果
     */
    @Override
    public int deletePlayletPublicAccountByIds(String ids)
    {
        return playletPublicAccountMapper.deletePlayletPublicAccountByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除公众号列信息
     *
     * @param id 公众号列主键
     * @return 结果
     */
    @Override
    public int deletePlayletPublicAccountById(Long id)
    {
        return playletPublicAccountMapper.deletePlayletPublicAccountById(id);
    }
}
