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