package beilv.voucher.service.impl;

import java.util.Collections;
import java.util.List;

import beilv.common.core.domain.AjaxResult;
import beilv.voucher.domain.BeilvVoucherMember;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import beilv.voucher.mapper.BeilvVoucherMapper;
import beilv.voucher.domain.BeilvVoucher;
import beilv.voucher.service.IBeilvVoucherService;
import beilv.common.core.text.Convert;

/**
 * 代金券Service业务层处理
 *
 * @author ruoyi
 * @date 2025-11-20
 */
@Service
public class BeilvVoucherServiceImpl implements IBeilvVoucherService {
    @Autowired
    private BeilvVoucherMapper beilvVoucherMapper;

    /**
     * 查询代金券
     *
     * @param id 代金券主键
     * @return 代金券
     */
    @Override
    public BeilvVoucher selectBeilvVoucherById(Long id) {
        return beilvVoucherMapper.selectBeilvVoucherById(id);
    }

    /**
     * 查询代金券列表
     *
     * @param beilvVoucher 代金券
     * @return 代金券
     */
    @Override
    public List<BeilvVoucher> selectBeilvVoucherList(BeilvVoucher beilvVoucher) {
        return beilvVoucherMapper.selectBeilvVoucherList(beilvVoucher);
    }

    /**
     * 新增代金券
     *
     * @param beilvVoucher 代金券
     * @return 结果
     */
    @Override
    public int insertBeilvVoucher(BeilvVoucher beilvVoucher) {
        return beilvVoucherMapper.insertBeilvVoucher(beilvVoucher);
    }

    /**
     * 修改代金券
     *
     * @param beilvVoucher 代金券
     * @return 结果
     */
    @Override
    public int updateBeilvVoucher(BeilvVoucher beilvVoucher) {
        return beilvVoucherMapper.updateBeilvVoucher(beilvVoucher);
    }

    /**
     * 批量删除代金券
     *
     * @param ids 需要删除的代金券主键
     * @return 结果
     */
    @Override
    public int deleteBeilvVoucherByIds(String ids) {
        return beilvVoucherMapper.deleteBeilvVoucherByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除代金券信息
     *
     * @param id 代金券主键
     * @return 结果
     */
    @Override
    public int deleteBeilvVoucherById(Long id) {
        return beilvVoucherMapper.deleteBeilvVoucherById(id);
    }


}
