1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- package com.fdkankan.manage.service.impl;
- import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
- import com.fdkankan.manage.entity.ScenePlusExt;
- import com.fdkankan.manage.mapper.IScenePlusExtMapper;
- import com.fdkankan.manage.service.IScenePlusExtService;
- import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
- import org.springframework.stereotype.Service;
- import java.util.HashMap;
- import java.util.List;
- /**
- * <p>
- * 服务实现类
- * </p>
- *
- * @author
- * @since 2022-08-02
- */
- @Service
- public class ScenePlusExtServiceImpl extends ServiceImpl<IScenePlusExtMapper, ScenePlusExt> implements IScenePlusExtService {
- @Override
- public ScenePlusExt getByPlusId(Long plusId) {
- LambdaQueryWrapper<ScenePlusExt> wrapper = new LambdaQueryWrapper<>();
- wrapper.eq(ScenePlusExt::getPlusId,plusId);
- List<ScenePlusExt> list = this.list(wrapper);
- if(list != null && list.size() >0){
- return list.get(0);
- }
- return null;
- }
- @Override
- public HashMap<Long, ScenePlusExt> getByPlusIds(List<Long> plusIds) {
- HashMap<Long,ScenePlusExt> map = new HashMap<>();
- if(plusIds == null || plusIds.isEmpty()){
- return map;
- }
- LambdaQueryWrapper<ScenePlusExt> wrapper = new LambdaQueryWrapper<>();
- wrapper.in(ScenePlusExt::getPlusId,plusIds);
- List<ScenePlusExt> list = this.list(wrapper);
- list.forEach(entity -> map.put(entity.getPlusId(),entity));
- return map;
- }
- @Override
- public void delByPlus(Long plusId) {
- LambdaQueryWrapper<ScenePlusExt> wrapper = new LambdaQueryWrapper<>();
- wrapper.eq(ScenePlusExt::getPlusId,plusId);
- this.remove(wrapper);
- }
- }
|