package com.miaxis.newgzpt.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.miaxis.common.annotation.DataSource;
import com.miaxis.common.enums.DataSourceTypeEnum;
import com.miaxis.newgzpt.domain.GzptSchActivation;
import com.miaxis.newgzpt.domain.GzptSchPayLog;
import com.miaxis.newgzpt.mapper.GzptSchActivationMapper;
import com.miaxis.newgzpt.mapper.GzptSchPayLogMapper;
import com.miaxis.newgzpt.service.IGzptSchActivationService;
import com.miaxis.newgzpt.service.IGzptSchPayLogService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;


/**
 * <p>
 * 视频VIP表 服务实现类
 * </p>
 *
 * @author ${author}
 * @since 2022-01-27
 */
@Service
@DataSource(value = DataSourceTypeEnum.NEWGZPT)
public class GzptSchActivationServiceImpl extends ServiceImpl<GzptSchActivationMapper, GzptSchActivation> implements IGzptSchActivationService {


    @Resource
    private GzptSchActivationMapper mapper;


    @Override
    public void saveSchActivation(GzptSchActivation schActivation) {
        mapper.saveSchActivation(schActivation);
    }

    @Override
    public int isSchActivation(Long stuId) {
        GzptSchActivation schActivation= mapper.getSchActivation(stuId);
        if(schActivation!=null){
            if(schActivation.getIsDel()!=null && schActivation.getIsDel()==0) {
                return 1;
            }
            return 0;
        } else {
            return 0;
        }
    }

    @Override
    public void delSchActivationByStuId(Long stuId) {
        mapper.delSchActivationByStuId(stuId);
    }

    @Override
    public void upDelSchActivationByStuId(Long stuId) { mapper.upDelSchActivationByStuId(stuId); }

}
