package com.iailab.module.model.mcs.pre.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.iailab.framework.common.service.impl.BaseServiceImpl; import com.iailab.module.model.mcs.pre.dao.MmPredictMergeItemDao; import com.iailab.module.model.mcs.pre.entity.MmPredictMergeItemEntity; import com.iailab.module.model.mcs.pre.service.MmPredictMergeItemService; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; import java.util.List; import java.util.UUID; /** * @author PanZhibao * @date 2021年04月27日 9:27 */ @Service("mmPredictMergeItemService") public class MmPredictMergeItemServiceImpl extends BaseServiceImpl implements MmPredictMergeItemService { @Override public void savePredictMergeItem(MmPredictMergeItemEntity predictMergeItem) { predictMergeItem.setId(UUID.randomUUID().toString()); baseDao.insert(predictMergeItem); } @Override public void update(MmPredictMergeItemEntity predictMergeItem) { this.updateById(predictMergeItem); } public void deleteBatch(String[] itemIds) { QueryWrapper queryWrapper = new QueryWrapper(); queryWrapper.in("itemid", itemIds); baseDao.delete(queryWrapper); } public MmPredictMergeItemEntity getByItemid(String itemid) { QueryWrapper queryWrapper = new QueryWrapper(); queryWrapper.eq("itemid", itemid); List list = baseDao.selectList(queryWrapper); if (CollectionUtils.isEmpty(list)) { return new MmPredictMergeItemEntity(); } return list.get(0); } }