package com.ruoyi.bar.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.bar.domain.WyWechatUser;
import com.ruoyi.bar.mapper.WyWechatUserMapper;
import com.ruoyi.bar.service.IWyWechatUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 微信用户Service业务层处理
 * 
 * @author kxl
 * @date 2024-12-16
 */
@Service
public class WyWechatUserServiceImpl implements IWyWechatUserService 
{
    @Autowired
    private WyWechatUserMapper wyWechatUserMapper;

    /**
     * 查询微信用户
     * 
     * @param openId 微信用户主键
     * @return 微信用户
     */
    @Override
    public WyWechatUser selectWyWechatUserByOpenId(String openId)
    {
        return wyWechatUserMapper.selectWyWechatUserByOpenId(openId);
    }

    /**
     * 查询微信用户列表
     * 
     * @param wyWechatUser 微信用户
     * @return 微信用户
     */
    @Override
    public List<WyWechatUser> selectWyWechatUserList(WyWechatUser wyWechatUser)
    {
        return wyWechatUserMapper.selectWyWechatUserList(wyWechatUser);
    }

    /**
     * 新增微信用户
     * 
     * @param wyWechatUser 微信用户
     * @return 结果
     */
    @Override
    public int insertWyWechatUser(WyWechatUser wyWechatUser)
    {
        wyWechatUser.setCreateTime(DateUtils.getNowDate());
        return wyWechatUserMapper.insertWyWechatUser(wyWechatUser);
    }

    /**
     * 修改微信用户
     * 
     * @param wyWechatUser 微信用户
     * @return 结果
     */
    @Override
    public int updateWyWechatUser(WyWechatUser wyWechatUser)
    {
        wyWechatUser.setUpdateTime(DateUtils.getNowDate());
        return wyWechatUserMapper.updateWyWechatUser(wyWechatUser);
    }

    /**
     * 批量删除微信用户
     * 
     * @param openIds 需要删除的微信用户主键
     * @return 结果
     */
    @Override
    public int deleteWyWechatUserByOpenIds(String[] openIds)
    {
        return wyWechatUserMapper.deleteWyWechatUserByOpenIds(openIds);
    }

    /**
     * 删除微信用户信息
     * 
     * @param openId 微信用户主键
     * @return 结果
     */
    @Override
    public int deleteWyWechatUserByOpenId(String openId)
    {
        return wyWechatUserMapper.deleteWyWechatUserByOpenId(openId);
    }
}
