ScenePlusExtServiceImpl.java 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. package com.fdkankan.manage.service.impl;
  2. import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
  3. import com.fdkankan.manage.entity.ScenePlusExt;
  4. import com.fdkankan.manage.mapper.IScenePlusExtMapper;
  5. import com.fdkankan.manage.service.IScenePlusExtService;
  6. import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
  7. import org.springframework.stereotype.Service;
  8. import java.util.HashMap;
  9. import java.util.List;
  10. /**
  11. * <p>
  12. * 服务实现类
  13. * </p>
  14. *
  15. * @author
  16. * @since 2022-08-02
  17. */
  18. @Service
  19. public class ScenePlusExtServiceImpl extends ServiceImpl<IScenePlusExtMapper, ScenePlusExt> implements IScenePlusExtService {
  20. @Override
  21. public ScenePlusExt getByPlusId(Long plusId) {
  22. LambdaQueryWrapper<ScenePlusExt> wrapper = new LambdaQueryWrapper<>();
  23. wrapper.eq(ScenePlusExt::getPlusId,plusId);
  24. List<ScenePlusExt> list = this.list(wrapper);
  25. if(list != null && list.size() >0){
  26. return list.get(0);
  27. }
  28. return null;
  29. }
  30. @Override
  31. public HashMap<Long, ScenePlusExt> getByPlusIds(List<Long> plusIds) {
  32. HashMap<Long,ScenePlusExt> map = new HashMap<>();
  33. if(plusIds == null || plusIds.isEmpty()){
  34. return map;
  35. }
  36. LambdaQueryWrapper<ScenePlusExt> wrapper = new LambdaQueryWrapper<>();
  37. wrapper.in(ScenePlusExt::getPlusId,plusIds);
  38. List<ScenePlusExt> list = this.list(wrapper);
  39. list.forEach(entity -> map.put(entity.getPlusId(),entity));
  40. return map;
  41. }
  42. @Override
  43. public void delByPlus(Long plusId) {
  44. LambdaQueryWrapper<ScenePlusExt> wrapper = new LambdaQueryWrapper<>();
  45. wrapper.eq(ScenePlusExt::getPlusId,plusId);
  46. this.remove(wrapper);
  47. }
  48. }