package com.mx.cneeds.server.device.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mx.cneeds.common.pager.PageUtils;
import com.mx.cneeds.common.pager.Query;
import com.mx.cneeds.server.dao.DeviceInfoExportDao;
import com.mx.cneeds.server.device.service.DeviceInfoExportService;
import com.mx.cneeds.server.entity.DeviceChannelEntity;
import com.mx.cneeds.server.entity.DeviceInfoExportEntity;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * @ClassName DeviceInfoExportServiceImpl
 * @Author zzrdark
 * @Date 2020-07-27 16:59
 * @Description TODO
 **/
@Service("deviceInfoExportService")
public class DeviceInfoExportServiceImpl extends ServiceImpl<DeviceInfoExportDao, DeviceInfoExportEntity> implements DeviceInfoExportService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {

        QueryWrapper<DeviceInfoExportEntity> queryWrapper = new QueryWrapper<>();

        /*String channelNum = (String) params.get("channelNum");
        if (channelNum != null && !"".equals(channelNum)){
            queryWrapper.eq("channel_num",channelNum);
        }*/

        IPage<DeviceInfoExportEntity> page = this.page(
                new Query<DeviceInfoExportEntity>().getPage(params),
                queryWrapper
        );

        return new PageUtils(page);
    }
}
