提交 | 用户 | 时间
|
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.pojo.PageResult; |
潘 |
6 |
import com.iailab.framework.common.service.impl.BaseServiceImpl; |
|
7 |
import com.iailab.framework.common.util.collection.CollectionUtils; |
|
8 |
import com.iailab.module.model.mcs.pre.dao.MmItemTypeDao; |
48c57b
|
9 |
import com.iailab.module.model.mcs.pre.entity.DmModuleItemEntity; |
7fd198
|
10 |
import com.iailab.module.model.mcs.pre.entity.MmItemTypeEntity; |
潘 |
11 |
import com.iailab.module.model.mcs.pre.service.MmItemTypeService; |
|
12 |
import com.iailab.module.model.mcs.pre.vo.MmItemTypePageReqVO; |
|
13 |
import org.apache.commons.lang3.StringUtils; |
5c6007
|
14 |
import org.springframework.beans.factory.annotation.Autowired; |
7fd198
|
15 |
import org.springframework.stereotype.Service; |
潘 |
16 |
import org.springframework.transaction.annotation.Transactional; |
|
17 |
|
5c6007
|
18 |
import java.util.*; |
7fd198
|
19 |
|
潘 |
20 |
/** |
|
21 |
* @author PanZhibao |
|
22 |
* @date 2021年04月23日 15:29 |
|
23 |
*/ |
5c6007
|
24 |
@Service |
L |
25 |
public class MmItemTypeImpl extends ServiceImpl<MmItemTypeDao, MmItemTypeEntity> implements MmItemTypeService { |
7fd198
|
26 |
|
5c6007
|
27 |
@Autowired |
L |
28 |
private MmItemTypeDao mmItemTypeDao; |
|
29 |
|
7fd198
|
30 |
@Override |
潘 |
31 |
public PageResult<MmItemTypeEntity> page(MmItemTypePageReqVO reqVO) { |
5c6007
|
32 |
return mmItemTypeDao.selectPage(reqVO); |
7fd198
|
33 |
} |
潘 |
34 |
|
|
35 |
@Override |
|
36 |
public void saveItemType(MmItemTypeEntity itemType) { |
|
37 |
itemType.setId(UUID.randomUUID().toString()); |
5c6007
|
38 |
mmItemTypeDao.insert(itemType); |
7fd198
|
39 |
} |
潘 |
40 |
|
|
41 |
@Override |
|
42 |
public void update(MmItemTypeEntity itemType) { |
5c6007
|
43 |
mmItemTypeDao.updateById(itemType); |
7fd198
|
44 |
} |
潘 |
45 |
|
|
46 |
@Override |
|
47 |
public void deleteBatch(String[] moduleIds) { |
5c6007
|
48 |
mmItemTypeDao.deleteBatchIds(Arrays.asList(moduleIds)); |
7fd198
|
49 |
} |
潘 |
50 |
|
|
51 |
@Override |
|
52 |
public int check(MmItemTypeEntity itemType) { |
|
53 |
String id = itemType.getId(); |
|
54 |
String itemtypename = itemType.getItemtypename(); |
5c6007
|
55 |
QueryWrapper<MmItemTypeEntity> moduleWrapper = new QueryWrapper(); |
7fd198
|
56 |
moduleWrapper.ne(StringUtils.isNotBlank(id), "id", id); |
潘 |
57 |
moduleWrapper.and(wrapper -> wrapper.eq("itemtypename",itemtypename)); |
5c6007
|
58 |
List<MmItemTypeEntity> list = mmItemTypeDao.selectList(moduleWrapper); |
7fd198
|
59 |
return list.size(); |
潘 |
60 |
} |
|
61 |
|
|
62 |
@Override |
|
63 |
public MmItemTypeEntity getItemTypeByItemId(String itemId) { |
5c6007
|
64 |
List<MmItemTypeEntity> list = mmItemTypeDao.getItemTypeByItemId(itemId); |
7fd198
|
65 |
if (CollectionUtils.isAnyEmpty(list)) { |
潘 |
66 |
return null; |
|
67 |
} |
|
68 |
return list.get(0); |
|
69 |
} |
5c6007
|
70 |
|
L |
71 |
@Override |
|
72 |
public MmItemTypeEntity info(String id) { |
|
73 |
return mmItemTypeDao.selectById(id); |
|
74 |
} |
|
75 |
|
|
76 |
@Override |
|
77 |
public List<MmItemTypeEntity> list(Map<String, Object> params) { |
48c57b
|
78 |
return mmItemTypeDao.selectList(new QueryWrapper<>()); |
5c6007
|
79 |
} |
7fd198
|
80 |
} |