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.DeviceLinkProtocolsDao;
import com.mx.cneeds.server.device.service.DeviceLinkProtocolsService;
import com.mx.cneeds.server.entity.DeviceCarTypeEntity;
import com.mx.cneeds.server.entity.DeviceLinkProtocolsEntity;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * @ClassName DeviceLinkProtocolsServiceImpl
 * @Author zzrdark
 * @Date 2020-08-14 16:35
 * @Description TODO
 **/
@Service("deviceLinkProtocolsService")
public class DeviceLinkProtocolsServiceImpl extends ServiceImpl<DeviceLinkProtocolsDao, DeviceLinkProtocolsEntity> implements DeviceLinkProtocolsService {

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

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

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

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

        return new PageUtils(page);
    }
}
