package com.corewing.app.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.corewing.app.entity.ParamsCenter;
import com.corewing.app.mapper.ParamsCenterMapper;
import com.corewing.app.service.ParamsCenterService;
import com.corewing.app.vo.ParamsCenterVO;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 参数配置中心 Service 实现类
 */
@Service
public class ParamsCenterServiceImpl extends ServiceImpl<ParamsCenterMapper, ParamsCenter> implements ParamsCenterService {

    @Override
    public ParamsCenterVO getVOById(Long id) {
        return this.baseMapper.selectVOById(id);
    }

    @Override
    public List<ParamsCenterVO> listByUserIdAndFcModel(Long userId, String fcModel) {
        return this.baseMapper.selectVOListByUserId(userId, fcModel);
    }

    @Override
    public IPage<ParamsCenterVO> pageByUserIdAndFcModel(Long userId, String fcModel, Page<ParamsCenterVO> page) {
        return this.baseMapper.selectVOPageByUserId(page, userId, fcModel);
    }

    @Override
    public List<ParamsCenterVO> listAllByFcModel(String fcModel) {
        return this.baseMapper.selectAllVOList(fcModel);
    }

    @Override
    public IPage<ParamsCenterVO> pageAllByFcModel(String fcModel, Page<ParamsCenterVO> page) {
        return this.baseMapper.selectAllVOPage(page, fcModel);
    }
}
