package com.education.business.service.education;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.education.business.mapper.education.ExtKnowledgePointMapper;
import com.education.business.service.BaseService;
import com.education.common.model.PageInfo;
import com.education.common.utils.ResultCode;
import com.education.model.dto.ExtKnowledgePointDto;
import com.education.model.entity.ExtKnowledgePoint;
import com.education.model.request.PageParam;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author zhangj
 * @version 1.0
 * @create_at
 */
@Service
public class ExtKnowledgePointService extends BaseService<ExtKnowledgePointMapper, ExtKnowledgePoint> {

    public PageInfo<ExtKnowledgePointDto> selectPageList(PageParam pageParam, ExtKnowledgePoint extKnowledgePoint) {
        Page<ExtKnowledgePointDto> page = new Page<>(pageParam.getPageNumber(), pageParam.getPageSize());
        return selectPage(baseMapper.selectPageList(page, extKnowledgePoint));
    }

    @Override
    public boolean saveOrUpdate(ExtKnowledgePoint extKnowledgePoint) {
        return super.saveOrUpdate(extKnowledgePoint);
    }

    public List<ExtKnowledgePoint> selectById(Integer id) {
        return baseMapper.selectListById(id);
    }
}