package cn.pluss.platform.officialActivity.impl;

import cn.pluss.platform.entity.OfficialActivity;
import cn.pluss.platform.enums.UserRoleEnum;
import cn.pluss.platform.mapper.OfficialActivityMapper;
import cn.pluss.platform.officialActivity.OfficialActivityService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

/**
 * <p>
 * 官方活动表 服务实现类
 * </p>
 *
 * @author Djh
 * @since 2020-09-24
 */
@Service
public class OfficialActivityServiceImpl extends ServiceImpl<OfficialActivityMapper, OfficialActivity> implements OfficialActivityService {

    @Override
    public void updateActivicyStatus(Date dateTime) {
        baseMapper.updateActivityStatus(dateTime);
    }

    /**
     * 根据角色查询当前角色活动
     * @date: 2022/2/18 15:10
     * @param condition:
     * @return java.util.List<cn.pluss.platform.entity.OfficialActivity>
     */
    @Override
    public List<OfficialActivity> getListByRole(OfficialActivity condition) {
        condition.setCommonType(UserRoleEnum.COMMON.getCode());
        return baseMapper.getListByRole(condition);
    }
}
