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.DeviceCarTypeDao;
import com.mx.cneeds.server.device.service.DeviceCarTypeService;
import com.mx.cneeds.server.entity.DeviceCarTypeEntity;
import com.mx.cneeds.server.entity.DeviceChannelEntity;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * @ClassName DeviceCarTypeServiceImpl
 * @Author zzr
 * @Date 2020-08-14 16:16
 * @Description TODO
 **/
@Service("deviceCarTypeService")
public class DeviceCarTypeServiceImpl extends ServiceImpl<DeviceCarTypeDao, DeviceCarTypeEntity> implements DeviceCarTypeService {

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

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

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

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

        return new PageUtils(page);
    }
}
