package com.example.zxweb.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.zxweb.entity.ZxDevice;
import com.example.zxweb.entity.ZxDeviceMethod;
import com.example.zxweb.mapper.ZxDeviceMapper;
import com.example.zxweb.mapper.ZxDeviceMethodMapper;
import com.example.zxweb.service.IZxDeviceService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

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

/**
 * @Description 设备信息
 * @Author ZhouWenTao
 * @Date 2023/9/14 9:14
 */
@Service
@Slf4j
public class ZxDeviceServiceImpl extends ServiceImpl<ZxDeviceMapper, ZxDevice> implements IZxDeviceService {
    @Resource
    private ZxDeviceMethodMapper zxDeviceMethodMapper;
    @Override
    public List<ZxDeviceMethod> getMethodByDeviceModelCode(String modelCode) {
        return zxDeviceMethodMapper.selectList(new LambdaQueryWrapper<ZxDeviceMethod>().eq(ZxDeviceMethod::getModelCode,modelCode).isNotNull(ZxDeviceMethod::getParameter));
    }
}
