package com.ruoyi.model.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.model.mapper.AppletUsersMapper;
import com.ruoyi.model.domain.AppletUsers;
import com.ruoyi.model.service.IAppletUsersService;

/**
 * 用户Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-03-30
 */
@Service
public class AppletUsersServiceImpl implements IAppletUsersService 
{
    @Autowired
    private AppletUsersMapper appletUsersMapper;

    /**
     * 查询用户
     * 
     * @param userId 用户主键
     * @return 用户
     */
    @Override
    public AppletUsers selectAppletUsersByUserId(Long userId)
    {
        return appletUsersMapper.selectAppletUsersByUserId(userId);
    }

    /**
     * 查询用户列表
     * 
     * @param appletUsers 用户
     * @return 用户
     */
    @Override
    public List<AppletUsers> selectAppletUsersList(AppletUsers appletUsers)
    {
        return appletUsersMapper.selectAppletUsersList(appletUsers);
    }

    /**
     * 新增用户
     * 
     * @param appletUsers 用户
     * @return 结果
     */
    @Override
    public int insertAppletUsers(AppletUsers appletUsers)
    {
        appletUsers.setCreateTime(DateUtils.getNowDate());
        return appletUsersMapper.insertAppletUsers(appletUsers);
    }

    /**
     * 修改用户
     * 
     * @param appletUsers 用户
     * @return 结果
     */
    @Override
    public int updateAppletUsers(AppletUsers appletUsers)
    {
        appletUsers.setUpdateTime(DateUtils.getNowDate());
        return appletUsersMapper.updateAppletUsers(appletUsers);
    }

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

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