提交 | 用户 | 时间
|
7fd198
|
1 |
package com.iailab.module.model.mcs.pre.service.impl; |
潘 |
2 |
|
|
3 |
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
4 |
import com.iailab.framework.common.service.impl.BaseServiceImpl; |
|
5 |
import com.iailab.module.model.mcs.pre.dao.MmPredictMergeItemDao; |
|
6 |
import com.iailab.module.model.mcs.pre.entity.MmPredictMergeItemEntity; |
|
7 |
import com.iailab.module.model.mcs.pre.service.MmPredictMergeItemService; |
|
8 |
import org.springframework.stereotype.Service; |
|
9 |
import org.springframework.util.CollectionUtils; |
|
10 |
|
|
11 |
import java.util.List; |
|
12 |
import java.util.UUID; |
|
13 |
|
|
14 |
/** |
|
15 |
* @author PanZhibao |
|
16 |
* @date 2021年04月27日 9:27 |
|
17 |
*/ |
|
18 |
@Service("mmPredictMergeItemService") |
|
19 |
public class MmPredictMergeItemServiceImpl extends BaseServiceImpl<MmPredictMergeItemDao, MmPredictMergeItemEntity> implements MmPredictMergeItemService { |
|
20 |
|
|
21 |
@Override |
|
22 |
public void savePredictMergeItem(MmPredictMergeItemEntity predictMergeItem) { |
|
23 |
predictMergeItem.setId(UUID.randomUUID().toString()); |
|
24 |
baseDao.insert(predictMergeItem); |
|
25 |
} |
|
26 |
|
|
27 |
@Override |
|
28 |
public void update(MmPredictMergeItemEntity predictMergeItem) { |
|
29 |
this.updateById(predictMergeItem); |
|
30 |
} |
|
31 |
|
|
32 |
public void deleteBatch(String[] itemIds) { |
|
33 |
QueryWrapper queryWrapper = new QueryWrapper<MmPredictMergeItemEntity>(); |
|
34 |
queryWrapper.in("itemid", itemIds); |
|
35 |
baseDao.delete(queryWrapper); |
|
36 |
} |
|
37 |
|
|
38 |
public MmPredictMergeItemEntity getByItemid(String itemid) { |
|
39 |
QueryWrapper queryWrapper = new QueryWrapper<MmPredictMergeItemEntity>(); |
|
40 |
queryWrapper.eq("itemid", itemid); |
|
41 |
List<MmPredictMergeItemEntity> list = baseDao.selectList(queryWrapper); |
|
42 |
if (CollectionUtils.isEmpty(list)) { |
|
43 |
return new MmPredictMergeItemEntity(); |
|
44 |
} |
|
45 |
return list.get(0); |
|
46 |
} |
|
47 |
} |