package com.unis.crk.hardware.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.unis.crk.basic.entity.UserInfo;
import com.unis.crk.hardware.entity.Devicecode;
import com.unis.crk.hardware.mapper.DevicecodeMapper;
import com.unis.crk.hardware.service.IDevicecodeService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 设备编码表 服务实现类
 * </p>
 *
 * @author ghh
 * @since 2021-09-15
 */
@Service
public class DevicecodeServiceImpl extends ServiceImpl<DevicecodeMapper, Devicecode> implements IDevicecodeService {
    @Resource
    DevicecodeMapper devicecodeMapper;
    @Override
    public List<Devicecode> getAllByHIID(String hiid) {
        QueryWrapper<Devicecode> basicEnumQueryWrapper = new QueryWrapper<>();
        basicEnumQueryWrapper.eq("hiid",hiid);
        List<Devicecode> devicecodes = devicecodeMapper.selectList(basicEnumQueryWrapper);
        return devicecodes;

    }

    @Override
    public IPage<Map<String, Object>> getDevicecodePage(Page<Devicecode> objectPage, QueryWrapper<Devicecode> buttonInfoQueryWrapper) {
        return devicecodeMapper.getPage(objectPage, buttonInfoQueryWrapper);
    }

    @Override
    public List<Devicecode> getDropDown(QueryWrapper<Devicecode> devicecodeQueryWrapper) {
        return devicecodeMapper.selectList(devicecodeQueryWrapper);
    }


}
