package com.miaxis.user.service.impl;


import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.miaxis.user.domain.UserRegister;
import com.miaxis.user.mapper.UserRegisterMapper;
import com.miaxis.user.service.IUserRegisterService;
import com.miaxis.common.utils.DateUtils;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;


/**
 * 用户报名信息Service业务层处理
 *
 * @author miaxis
 * @date 2020-12-25
 */
@Service
public class UserRegisterServiceImpl extends ServiceImpl<UserRegisterMapper, UserRegister> implements IUserRegisterService {

    @Resource
    private UserRegisterMapper userRegisterMapper;

    /**
     * 查询用户报名信息
     *
     * @param id 用户报名信息ID
     * @return 用户报名信息
     */
    @Override
    public UserRegister selectUserRegisterById(Long id){
        return userRegisterMapper.selectUserRegisterById(id);
    }

    /**
     * 查询用户报名信息列表
     *
     * @param userRegister 用户报名信息
     * @return 用户报名信息
     */
    @Override
    public List<UserRegister> selectUserRegisterList(UserRegister userRegister){
        return userRegisterMapper.selectUserRegisterList(userRegister);
    }

    /**
     * 新增用户报名信息
     *
     * @param userRegister 用户报名信息
     * @return 结果
     */
    @Override
    public int insertUserRegister(UserRegister userRegister){
        userRegister.setCreateTime(DateUtils.getNowDate());
        return userRegisterMapper.insertUserRegister(userRegister);
    }

    /**
     * 修改用户报名信息
     *
     * @param userRegister 用户报名信息
     * @return 结果
     */
    @Override
    public int updateUserRegister(UserRegister userRegister){
        userRegister.setUpdateTime(DateUtils.getNowDate());
        return userRegisterMapper.updateUserRegister(userRegister);
    }

    /**
     * 批量删除用户报名信息
     *
     * @param ids 需要删除的用户报名信息ID
     * @return 结果
     */
    @Override
    public int deleteUserRegisterByIds(Long[] ids){
        return userRegisterMapper.deleteUserRegisterByIds(ids);
    }

    /**
     * 删除用户报名信息信息
     *
     * @param id 用户报名信息ID
     * @return 结果
     */
    @Override
    public int deleteUserRegisterById(Long id){
        return userRegisterMapper.deleteUserRegisterById(id);
    }
}
