提交 | 用户 | 时间
|
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.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; |
5c6007
|
8 |
import org.springframework.beans.factory.annotation.Autowired; |
7fd198
|
9 |
import org.springframework.stereotype.Service; |
潘 |
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 |
*/ |
5c6007
|
19 |
@Service |
L |
20 |
public class DmModuleItemServiceImpl extends ServiceImpl<DmModuleItemDao, DmModuleItemEntity> implements DmModuleItemService { |
|
21 |
@Autowired |
|
22 |
private DmModuleItemDao dmModuleItemDao; |
|
23 |
|
7fd198
|
24 |
@Override |
潘 |
25 |
public void saveModuleItem(DmModuleItemEntity moduleItem) { |
|
26 |
moduleItem.setId(UUID.randomUUID().toString()); |
5c6007
|
27 |
dmModuleItemDao.insert(moduleItem); |
7fd198
|
28 |
} |
潘 |
29 |
|
|
30 |
@Override |
|
31 |
public void update(DmModuleItemEntity moduleItem) { |
5c6007
|
32 |
dmModuleItemDao.updateById(moduleItem); |
7fd198
|
33 |
} |
潘 |
34 |
|
|
35 |
public DmModuleItemEntity getByItemid(String itemid) { |
5c6007
|
36 |
List<DmModuleItemEntity> list = dmModuleItemDao.selectList(new QueryWrapper<DmModuleItemEntity>().in("itemid", itemid)); |
7fd198
|
37 |
if (CollectionUtils.isEmpty(list)) { |
潘 |
38 |
return new DmModuleItemEntity(); |
|
39 |
} |
|
40 |
return list.get(0); |
|
41 |
} |
|
42 |
} |