package com.ruoyi.ss.realName.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.ss.realName.domain.RealName;
import com.ruoyi.ss.realName.domain.RealNameQuery;
import com.ruoyi.ss.realName.domain.RealNameVO;
import com.ruoyi.ss.realName.mapper.RealNameMapper;
import com.ruoyi.ss.realName.service.RealNameService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 实名认证Service业务层处理
 *
 * @author ruoyi
 * @date 2024-09-23
 */
@Service
public class RealNameServiceImpl implements RealNameService
{
    @Autowired
    private RealNameMapper realNameMapper;

    /**
     * 查询实名认证
     *
     * @param id 实名认证主键
     * @return 实名认证
     */
    @Override
    public RealNameVO selectRealNameById(Long id)
    {
        return realNameMapper.selectRealNameById(id);
    }

    /**
     * 查询实名认证列表
     *
     * @param realName 实名认证
     * @return 实名认证
     */
    @Override
    public List<RealNameVO> selectRealNameList(RealNameQuery realName)
    {
        return realNameMapper.selectRealNameList(realName);
    }

    /**
     * 新增实名认证
     *
     * @param realName 实名认证
     * @return 结果
     */
    @Override
    public int insertRealName(RealName realName)
    {
        realName.setCreateTime(DateUtils.getNowDate());
        return realNameMapper.insertRealName(realName);
    }

    /**
     * 修改实名认证
     *
     * @param realName 实名认证
     * @return 结果
     */
    @Override
    public int updateRealName(RealName realName)
    {
        return realNameMapper.updateRealName(realName);
    }

    /**
     * 批量删除实名认证
     *
     * @param ids 需要删除的实名认证主键
     * @return 结果
     */
    @Override
    public int deleteRealNameByIds(Long[] ids)
    {
        return realNameMapper.deleteRealNameByIds(ids);
    }

    /**
     * 删除实名认证信息
     *
     * @param id 实名认证主键
     * @return 结果
     */
    @Override
    public int deleteRealNameById(Long id)
    {
        return realNameMapper.deleteRealNameById(id);
    }

    @Override
    public int selectCount(RealNameQuery query) {
        return realNameMapper.selectCount(query);
    }
}
