package cn.com.ctop.crawler.modules.appium.service.impl;

import cn.com.ctop.crawler.modules.appium.entity.AppiumDevice;
import cn.com.ctop.crawler.modules.appium.mapper.AppiumDeviceMapper;
import cn.com.ctop.crawler.modules.appium.service.IAppiumDeviceService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

/**
 * 手机设备表
 * @author jeecg-boot
 * @date 2019-10-31
 * @version V1.0
 */
@Service
public class AppiumDeviceServiceImpl extends ServiceImpl<AppiumDeviceMapper, AppiumDevice> implements IAppiumDeviceService {

    @Override
    public AppiumDevice getEnabled() {
        QueryWrapper<AppiumDevice> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("status", 1).orderByDesc("id").last("limit 1");
        return getOne(queryWrapper);
    }
}
