MqNumLevelServiceImpl.java 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. package com.fdkankan.manage.service.impl;
  2. import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
  3. import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
  4. import com.fdkankan.manage.entity.MqCameraLevel;
  5. import com.fdkankan.manage.entity.MqNumLevel;
  6. import com.fdkankan.manage.mapper.IMqNumLevelMapper;
  7. import com.fdkankan.manage.service.IMqNumLevelService;
  8. import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
  9. import org.springframework.stereotype.Service;
  10. /**
  11. * <p>
  12. * 服务实现类
  13. * </p>
  14. *
  15. * @author
  16. * @since 2024-04-17
  17. */
  18. @Service
  19. public class MqNumLevelServiceImpl extends ServiceImpl<IMqNumLevelMapper, MqNumLevel> implements IMqNumLevelService {
  20. @Override
  21. public MqNumLevel getByNum(String num) {
  22. LambdaQueryWrapper<MqNumLevel> wrapper = new LambdaQueryWrapper<>();
  23. wrapper.eq(MqNumLevel::getNum,num);
  24. return this.getOne(wrapper);
  25. }
  26. @Override
  27. public void saveEntity(String num, Integer configId) {
  28. MqNumLevel mqNumLevel = new MqNumLevel();
  29. mqNumLevel.setNum(num);
  30. mqNumLevel.setQueueConfigId(configId);
  31. this.save(mqNumLevel);
  32. }
  33. @Override
  34. public void updateLevelById(Integer id, Integer configId) {
  35. LambdaUpdateWrapper<MqNumLevel> wrapper = new LambdaUpdateWrapper<>();
  36. wrapper.eq(MqNumLevel::getId,id);
  37. wrapper.set(MqNumLevel::getQueueConfigId,configId);
  38. this.update(wrapper);
  39. }
  40. }