package com.hzs.member.detail.service.impl;

import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hzs.common.core.enums.*;
import com.hzs.common.domain.member.detail.CuMemberAwards;
import com.hzs.member.detail.mapper.CuMemberAwardsMapper;
import com.hzs.member.detail.service.ICuMemberAwardsService;
import org.springframework.stereotype.Service;

import java.util.*;

/**
 * 会员信息-奖衔升级记录 服务实现类
 */
@Service
public class CuMemberAwardsServiceImpl extends ServiceImpl<CuMemberAwardsMapper, CuMemberAwards> implements ICuMemberAwardsService {

    @Override
    public void deleteCuMemberAwards(Long pkOrder, Long pkApprove, Date currentDateTime) {
        LambdaUpdateWrapper<CuMemberAwards> updateWrapper = new LambdaUpdateWrapper<>();
        updateWrapper.set(CuMemberAwards::getDelFlag, EYesNo.NO.getIntValue());
        updateWrapper.set(CuMemberAwards::getPkModified, pkApprove);
        updateWrapper.set(CuMemberAwards::getModifiedTime, currentDateTime);
        updateWrapper.eq(CuMemberAwards::getPkOrder, pkOrder);
        update(updateWrapper);
    }

}
