package com.game.business.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.List;
        import com.game.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.game.business.mapper.AppUserLiveDividedMapper;
import com.game.business.domain.AppUserLiveDivided;
import com.game.business.service.IAppUserLiveDividedService;
import com.game.common.annotation.DataSource;
import com.game.common.enums.DataSourceType;

/**
 * 直播待分成表Service业务层处理
 *
 * @author game
 * @date 2024-06-30
 */
@Service
public class AppUserLiveDividedServiceImpl extends ServiceImpl<AppUserLiveDividedMapper, AppUserLiveDivided> implements IAppUserLiveDividedService {
    @Autowired
    private AppUserLiveDividedMapper appUserLiveDividedMapper;

    /**
     * 查询直播待分成表
     *
     * @param id 直播待分成表主键
     * @return 直播待分成表
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public AppUserLiveDivided selectAppUserLiveDividedById(Long id) {
        return appUserLiveDividedMapper.selectAppUserLiveDividedById(id);
    }

    /**
     * 查询直播待分成表列表
     *
     * @param appUserLiveDivided 直播待分成表
     * @return 直播待分成表
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public List<AppUserLiveDivided> selectAppUserLiveDividedList(AppUserLiveDivided appUserLiveDivided) {
        return appUserLiveDividedMapper.selectAppUserLiveDividedList(appUserLiveDivided);
    }

    /**
     * 新增直播待分成表
     *
     * @param appUserLiveDivided 直播待分成表
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int insertAppUserLiveDivided(AppUserLiveDivided appUserLiveDivided) {
                appUserLiveDivided.setCreateTime(DateUtils.getNowDate());
            return appUserLiveDividedMapper.insertAppUserLiveDivided(appUserLiveDivided);
    }

    /**
     * 修改直播待分成表
     *
     * @param appUserLiveDivided 直播待分成表
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int updateAppUserLiveDivided(AppUserLiveDivided appUserLiveDivided) {
                appUserLiveDivided.setUpdateTime(DateUtils.getNowDate());
        return appUserLiveDividedMapper.updateAppUserLiveDivided(appUserLiveDivided);
    }

    /**
     * 批量删除直播待分成表
     *
     * @param ids 需要删除的直播待分成表主键
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int deleteAppUserLiveDividedByIds(Long[] ids) {
        return appUserLiveDividedMapper.deleteAppUserLiveDividedByIds(ids);
    }

    /**
     * 删除直播待分成表信息
     *
     * @param id 直播待分成表主键
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int deleteAppUserLiveDividedById(Long id) {
        return appUserLiveDividedMapper.deleteAppUserLiveDividedById(id);
    }
}