package com.fs.his.service.impl;

import com.fs.common.utils.DateUtils;
import com.fs.his.domain.FsUserRecharge;
import com.fs.his.mapper.FsUserRechargeMapper;
import com.fs.his.param.FsUserRechargeParam;
import com.fs.his.service.IFsUserRechargeService;
import com.fs.his.vo.FsUserRechargeListVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 会员充值Service业务层处理
 *
 * @author fs
 * @date 2023-11-02
 */
@Service
public class FsUserRechargeServiceImpl implements IFsUserRechargeService
{
    @Autowired
    private FsUserRechargeMapper fsUserRechargeMapper;

    /**
     * 查询会员充值
     *
     * @param rechargeId 会员充值主键
     * @return 会员充值
     */
    @Override
    public FsUserRecharge selectFsUserRechargeByRechargeId(Long rechargeId)
    {
        return fsUserRechargeMapper.selectFsUserRechargeByRechargeId(rechargeId);
    }

    /**
     * 查询会员充值列表
     *
     * @param fsUserRecharge 会员充值
     * @return 会员充值
     */
    @Override
    public List<FsUserRecharge> selectFsUserRechargeList(FsUserRecharge fsUserRecharge)
    {
        return fsUserRechargeMapper.selectFsUserRechargeList(fsUserRecharge);
    }

    /**
     * 新增会员充值
     *
     * @param fsUserRecharge 会员充值
     * @return 结果
     */
    @Override
    public int insertFsUserRecharge(FsUserRecharge fsUserRecharge)
    {
        fsUserRecharge.setCreateTime(DateUtils.getNowDate());
        return fsUserRechargeMapper.insertFsUserRecharge(fsUserRecharge);
    }

    /**
     * 修改会员充值
     *
     * @param fsUserRecharge 会员充值
     * @return 结果
     */
    @Override
    public int updateFsUserRecharge(FsUserRecharge fsUserRecharge)
    {
        return fsUserRechargeMapper.updateFsUserRecharge(fsUserRecharge);
    }

    /**
     * 批量删除会员充值
     *
     * @param rechargeIds 需要删除的会员充值主键
     * @return 结果
     */
    @Override
    public int deleteFsUserRechargeByRechargeIds(Long[] rechargeIds)
    {
        return fsUserRechargeMapper.deleteFsUserRechargeByRechargeIds(rechargeIds);
    }

    /**
     * 删除会员充值信息
     *
     * @param rechargeId 会员充值主键
     * @return 结果
     */
    @Override
    public int deleteFsUserRechargeByRechargeId(Long rechargeId)
    {
        return fsUserRechargeMapper.deleteFsUserRechargeByRechargeId(rechargeId);
    }

    @Override
    public List<FsUserRechargeListVO> selectFsUserRechargeListVO(FsUserRechargeParam fsUserRecharge) {
        return fsUserRechargeMapper.selectFsUserRechargeListVO(fsUserRecharge);
    }
}
