package cn.cecep.talroad.service.impl;

import cn.cecep.talroad.domain.BMainPollDisGasPoll;
import cn.cecep.talroad.mapper.BMainPollDisGasPollMapper;
import cn.cecep.talroad.service.BMainPollDisGasPollService;
import cn.cecep.talroad.vo.query.BMainPollDisGasToutQuery;
import com.alibaba.csp.sentinel.util.StringUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class BMainPollDisGasPollServiceImpl implements BMainPollDisGasPollService {

    @Resource
    private BMainPollDisGasPollMapper bMainPollDisGasPollMapper;

    @Override
    public IPage<BMainPollDisGasPoll> pullPage(BMainPollDisGasToutQuery bMainPollDisGasTout) {
        return bMainPollDisGasPollMapper.selectPage(new Page<>(bMainPollDisGasTout.getPageNum(), bMainPollDisGasTout.getPageSize()), new QueryWrapper<BMainPollDisGasPoll>().eq(StringUtil.isNotEmpty(bMainPollDisGasTout.getFactoryId()),"factory_id", bMainPollDisGasTout.getFactoryId()).eq("poll_dis_id", bMainPollDisGasTout.getPollDisId()));
    }
}
