package com.kxs.system.biz.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.kxs.common.security.util.SecurityUtils;
import com.kxs.system.api.model.KxsCamp;
import com.kxs.system.api.vo.admin.camp.SysCampUserPageVO;
import com.kxs.system.api.vo.kxsapp.camp.CampUserPageVO;
import com.kxs.system.biz.mapper.KxsCampMapper;
import com.kxs.system.biz.mapper.KxsCampUserMapper;
import com.kxs.system.api.model.KxsCampUser;
import com.kxs.system.biz.service.KxsCampUserService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 训练营参与创客(KxsCampUser)表服务实现类
 *
 * @author 系统
 * @since 2024-04-08 15:44:02
 */
@Service("kxsCampUserService")
@RequiredArgsConstructor
public class KxsCampUserServiceImpl extends ServiceImpl<KxsCampUserMapper, KxsCampUser> implements KxsCampUserService {

    private final KxsCampMapper kxsCampMapper;
    @Override
    public IPage<CampUserPageVO> getByPage(Page<CampUserPageVO> page, Integer campId) {


        return baseMapper.getByPage(page, campId);
    }

    @Override
    public Object getByCampInfo() {

        return kxsCampMapper.selectUserCamp(SecurityUtils.getUser().getId().intValue());
    }

    @Override
    public IPage<SysCampUserPageVO> getSysByPage(Page<SysCampUserPageVO> page, KxsCampUser param) {

        return baseMapper.getSysByPage(page, param);
    }

    @Override
    public List<SysCampUserPageVO> exportGroupUser(KxsCampUser param) {

        return baseMapper.getSysByPage(param);
    }
}

