package com.hzs.bonus.bonus.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hzs.bonus.bonus.service.ICuMemberShareMaxService;
import com.hzs.common.domain.member.bonus.CuMemberShareMax;
import com.hzs.bonus.bonus.mapper.CuMemberShareMaxMapper;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * <p>
 * 会员奖金-最大分红奖金 服务实现类
 * </p>
 *
 * @author hzs
 * @since 2023-01-06
 */
@Service
public class CuMemberShareMaxServiceImpl extends ServiceImpl<CuMemberShareMaxMapper, CuMemberShareMax> implements ICuMemberShareMaxService {


    @Override
    @Transactional(rollbackFor = Exception.class)
    public void insertMaxShareBonus(CuMemberShareMax cuMemberShareMax) {
        // 删除
        baseMapper.deleteCuMemberShareMax(cuMemberShareMax.getPeriod());
        baseMapper.insert(cuMemberShareMax);
    }
}
