package com.fs.company.service.impl;

import java.util.List;
import com.fs.common.utils.DateUtils;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fs.company.domain.Company;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.fs.company.mapper.CompanyRedPacketBalanceLogsMapper;
import com.fs.company.domain.CompanyRedPacketBalanceLogs;
import com.fs.company.service.ICompanyRedPacketBalanceLogsService;

/**
 * 企业红包余额记录Service业务层处理
 * 
 * @author fs
 * @date 2025-11-19
 */
@Service
public class CompanyRedPacketBalanceLogsServiceImpl extends ServiceImpl<CompanyRedPacketBalanceLogsMapper, CompanyRedPacketBalanceLogs> implements ICompanyRedPacketBalanceLogsService {

    /**
     * 查询企业红包余额记录
     * 
     * @param logsId 企业红包余额记录主键
     * @return 企业红包余额记录
     */
    @Override
    public CompanyRedPacketBalanceLogs selectCompanyRedPacketBalanceLogsByLogsId(Long logsId)
    {
        return baseMapper.selectCompanyRedPacketBalanceLogsByLogsId(logsId);
    }

    /**
     * 查询企业红包余额记录列表
     * 
     * @param companyRedPacketBalanceLogs 企业红包余额记录
     * @return 企业红包余额记录
     */
    @Override
    public List<CompanyRedPacketBalanceLogs> selectCompanyRedPacketBalanceLogsList(CompanyRedPacketBalanceLogs companyRedPacketBalanceLogs)
    {
        return baseMapper.selectCompanyRedPacketBalanceLogsList(companyRedPacketBalanceLogs);
    }

    /**
     * 新增企业红包余额记录
     * 
     * @param companyRedPacketBalanceLogs 企业红包余额记录
     * @return 结果
     */
    @Override
    public int insertCompanyRedPacketBalanceLogs(CompanyRedPacketBalanceLogs companyRedPacketBalanceLogs)
    {
        companyRedPacketBalanceLogs.setCreateTime(DateUtils.getNowDate());
        return baseMapper.insertCompanyRedPacketBalanceLogs(companyRedPacketBalanceLogs);
    }

    /**
     * 修改企业红包余额记录
     * 
     * @param companyRedPacketBalanceLogs 企业红包余额记录
     * @return 结果
     */
    @Override
    public int updateCompanyRedPacketBalanceLogs(CompanyRedPacketBalanceLogs companyRedPacketBalanceLogs)
    {
        return baseMapper.updateCompanyRedPacketBalanceLogs(companyRedPacketBalanceLogs);
    }

    /**
     * 批量删除企业红包余额记录
     * 
     * @param logsIds 需要删除的企业红包余额记录主键
     * @return 结果
     */
    @Override
    public int deleteCompanyRedPacketBalanceLogsByLogsIds(Long[] logsIds)
    {
        return baseMapper.deleteCompanyRedPacketBalanceLogsByLogsIds(logsIds);
    }

    /**
     * 删除企业红包余额记录信息
     * 
     * @param logsId 企业红包余额记录主键
     * @return 结果
     */
    @Override
    public int deleteCompanyRedPacketBalanceLogsByLogsId(Long logsId)
    {
        return baseMapper.deleteCompanyRedPacketBalanceLogsByLogsId(logsId);
    }

    @Override
    public Company getCompanyRedPacketBalance(Long companyId) {
        return baseMapper.getCompanyRedPacketBalance(companyId);
    }
}
