package com.qnfhq.modules.business.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.qnfhq.modules.business.dao.THelpCenterMapper;
import com.qnfhq.modules.business.entity.HelpCenter;
import com.qnfhq.modules.business.entity.MingProduct;
import com.qnfhq.modules.business.service.ITHelpCenterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 帮助中心Service业务层处理
 * 
 * @author table
 * @date 2023-08-17
 */
@Service
public class THelpCenterServiceImpl extends ServiceImpl<THelpCenterMapper, HelpCenter> implements ITHelpCenterService
{
    @Autowired
    private THelpCenterMapper tHelpCenterMapper;


    @Override
    public IPage<HelpCenter> getHelpList(Integer pageNum, Integer pageSize, Integer type, String enable) {

        IPage<HelpCenter> page = new Page<>(pageNum, pageSize);
        LambdaQueryWrapper<HelpCenter> lambda = new QueryWrapper<HelpCenter>().lambda();
        lambda.eq(HelpCenter::getEnable,enable);
        lambda.eq(type != null ,HelpCenter::getType,type);
        IPage<HelpCenter> helpCenterIPage = tHelpCenterMapper.selectPage(page, lambda);
        return helpCenterIPage;
    }
}
