package com.ruoyi.bar.service.impl;

import java.util.List;

import com.ruoyi.common.core.domain.entity.WyBarUser;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.stereotype.Service;
import com.ruoyi.bar.mapper.WyBarUserMapper;
import com.ruoyi.bar.service.IWyBarUserService;

import javax.annotation.Resource;

/**
 * 品牌方用户信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-01-04
 */
@Service
public class WyBarUserServiceImpl implements IWyBarUserService 
{
    @Resource
    private WyBarUserMapper wyBarUserMapper;

    /**
     * 查询品牌方用户信息
     * 
     * @param userId 品牌方用户信息主键
     * @return 品牌方用户信息
     */
    @Override
    public WyBarUser selectWyBarUserByUserId(Long userId)
    {
        return wyBarUserMapper.selectWyBarUserByUserId(userId);
    }

    @Override
    public WyBarUser selectWyBarUserByUserName(String userName){
        return wyBarUserMapper.selectWyBarUserByUserName(userName);
    }
    @Override
    public WyBarUser selectWyBarUserByPhoneNumber(String phonenumber){
        return wyBarUserMapper.selectWyBarUserByPhoneNumber(phonenumber);
    }

    @Override
    public WyBarUser selectWyBarUserByOpenId(String openId){
        return wyBarUserMapper.selectWyBarUserByOpenId(openId);
    }
    /**
     * 查询品牌方用户信息列表
     * 
     * @param wyBarUser 品牌方用户信息
     * @return 品牌方用户信息
     */
    @Override
    public List<WyBarUser> selectWyBarUserList(WyBarUser wyBarUser)
    {
        return wyBarUserMapper.selectWyBarUserList(wyBarUser);
    }

    /**
     * 新增品牌方用户信息
     * 
     * @param wyBarUser 品牌方用户信息
     * @return 结果
     */
    @Override
    public int insertWyBarUser(WyBarUser wyBarUser)
    {
        wyBarUser.setCreateTime(DateUtils.getNowDate());
        return wyBarUserMapper.insertWyBarUser(wyBarUser);
    }

    /**
     * 修改品牌方用户信息
     * 
     * @param wyBarUser 品牌方用户信息
     * @return 结果
     */
    @Override
    public int updateWyBarUser(WyBarUser wyBarUser)
    {
        wyBarUser.setUpdateTime(DateUtils.getNowDate());
        return wyBarUserMapper.updateWyBarUser(wyBarUser);
    }

    /**
     * 批量删除品牌方用户信息
     * 
     * @param userIds 需要删除的品牌方用户信息主键
     * @return 结果
     */
    @Override
    public int deleteWyBarUserByUserIds(Long[] userIds)
    {
        return wyBarUserMapper.deleteWyBarUserByUserIds(userIds);
    }

    /**
     * 删除品牌方用户信息信息
     * 
     * @param userId 品牌方用户信息主键
     * @return 结果
     */
    @Override
    public int deleteWyBarUserByUserId(Long userId)
    {
        return wyBarUserMapper.deleteWyBarUserByUserId(userId);
    }

    @Override
    public WyBarUser selectUserByUserName(String username) {
        return wyBarUserMapper.selectWyBarUserByUserName(username);
    }
}
