提交 | 用户 | 时间
|
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.DmModuleItemDao; |
|
6 |
import com.iailab.module.model.mcs.pre.entity.DmModuleItemEntity; |
|
7 |
import com.iailab.module.model.mcs.pre.service.DmModuleItemService; |
|
8 |
import org.springframework.stereotype.Service; |
|
9 |
import org.springframework.transaction.annotation.Transactional; |
|
10 |
import org.springframework.util.CollectionUtils; |
|
11 |
|
|
12 |
import java.util.List; |
|
13 |
import java.util.UUID; |
|
14 |
|
|
15 |
/** |
|
16 |
* @author PanZhibao |
|
17 |
* @date 2021年04月27日 9:20 |
|
18 |
*/ |
|
19 |
@Service("dmModuleItemService") |
|
20 |
public class DmModuleItemServiceImpl extends BaseServiceImpl<DmModuleItemDao, DmModuleItemEntity> implements DmModuleItemService { |
|
21 |
|
|
22 |
@Override |
|
23 |
@Transactional(rollbackFor = Exception.class) |
|
24 |
public void saveModuleItem(DmModuleItemEntity moduleItem) { |
|
25 |
moduleItem.setId(UUID.randomUUID().toString()); |
|
26 |
baseDao.insert(moduleItem); |
|
27 |
} |
|
28 |
|
|
29 |
@Override |
|
30 |
@Transactional(rollbackFor = Exception.class) |
|
31 |
public void update(DmModuleItemEntity moduleItem) { |
|
32 |
baseDao.updateById(moduleItem); |
|
33 |
} |
|
34 |
|
|
35 |
public DmModuleItemEntity getByItemid(String itemid) { |
|
36 |
List<DmModuleItemEntity> list = baseDao.selectList(new QueryWrapper<DmModuleItemEntity>().in("itemid", itemid)); |
|
37 |
if (CollectionUtils.isEmpty(list)) { |
|
38 |
return new DmModuleItemEntity(); |
|
39 |
} |
|
40 |
return list.get(0); |
|
41 |
} |
|
42 |
} |