package com.flossom.system.service.impl;

import java.util.List;

import com.flossom.common.core.domain.entity.WxUserMember;
import com.flossom.common.core.domain.req.WxUserMemberVm;
import com.flossom.common.core.mapper.WxUserMemberMapper;
import com.flossom.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.flossom.system.service.IWxUserMemberService;

/**
 * 用户Service业务层处理
 *
 * @author flossom
 * @date 2023-12-08
 */
@Service
public class WxUserMemberServiceImpl implements IWxUserMemberService
{
    @Autowired
    private WxUserMemberMapper wxUserMemberMapper;

    /**
     * 查询用户
     *
     * @param id 用户主键
     * @return 用户
     */
    @Override
    public WxUserMember selectWxUserMemberById(Long id)
    {
        return wxUserMemberMapper.selectWxUserMemberById(id);
    }

    /**
     * 查询用户列表
     *
     * @param wxUserMember 用户
     * @return 用户
     */
    @Override
    public List<WxUserMember> selectWxUserMemberList(WxUserMember wxUserMember)
    {
        return wxUserMemberMapper.selectWxUserMemberList(wxUserMember);
    }

    /**
     * 查询用户列表
     *
     * @param wxUserMemberVm 用户
     * @return 用户
     */
    @Override
    public List<WxUserMember> selectWxUserMemberList(WxUserMemberVm wxUserMemberVm)
    {
        return wxUserMemberMapper.selectWxUserMemberListByVm(wxUserMemberVm);
    }

    /**
     * 新增用户
     *
     * @param wxUserMember 用户
     * @return 结果
     */
    @Override
    public int insertWxUserMember(WxUserMember wxUserMember)
    {
        wxUserMember.setCreateTime(DateUtils.getNowDate());
        return wxUserMemberMapper.insertWxUserMember(wxUserMember);
    }

    /**
     * 修改用户
     *
     * @param wxUserMember 用户
     * @return 结果
     */
    @Override
    public int updateWxUserMember(WxUserMember wxUserMember)
    {
        wxUserMember.setUpdateTime(DateUtils.getNowDate());
        return wxUserMemberMapper.updateWxUserMember(wxUserMember);
    }

    /**
     * 批量删除用户
     *
     * @param ids 需要删除的用户主键
     * @return 结果
     */
    @Override
    public int deleteWxUserMemberByIds(Long[] ids)
    {
        return wxUserMemberMapper.deleteWxUserMemberByIds(ids);
    }

    /**
     * 删除用户信息
     *
     * @param id 用户主键
     * @return 结果
     */
    @Override
    public int deleteWxUserMemberById(Long id)
    {
        return wxUserMemberMapper.deleteWxUserMemberById(id);
    }
}
