package com.yunzhi.marketing.sample.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.yunzhi.marketing.base.ResponseBean;
import com.yunzhi.marketing.sample.entity.TaH5Sample;
import com.yunzhi.marketing.sample.mapper.TaH5SampleMapper;
import com.yunzhi.marketing.sample.service.ITaH5SampleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 样例表  服务实现类
 * </p>
 *
 * @author fxf
 * @since 2020-03-18
 */
@Service
public class TaH5SampleServiceImpl extends ServiceImpl<TaH5SampleMapper, TaH5Sample> implements ITaH5SampleService {

    @Autowired
    private TaH5SampleMapper taH5SampleMapper;

    @Override
    public ResponseBean listH5SampleByCondition(Integer pageNum, Integer pageSize, String sampleName) {
        ResponseBean responseBean = new ResponseBean();
        IPage<TaH5Sample> pg = new Page<>(pageNum, pageSize);
        pg = taH5SampleMapper.listH5SampleByCondition(pg, sampleName);
        responseBean.addSuccess(pg);
        return responseBean;
    }
}
