提交 | 用户 | 时间
|
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.MmModelParamDao; |
|
6 |
import com.iailab.module.model.mcs.pre.entity.MmModelParamEntity; |
|
7 |
import com.iailab.module.model.mcs.pre.service.MmModelParamService; |
|
8 |
import org.springframework.stereotype.Service; |
|
9 |
import org.springframework.util.CollectionUtils; |
|
10 |
|
|
11 |
import java.util.ArrayList; |
|
12 |
import java.util.List; |
|
13 |
import java.util.UUID; |
|
14 |
|
|
15 |
/** |
|
16 |
* @author PanZhibao |
|
17 |
* @date 2021年04月27日 9:25 |
|
18 |
*/ |
|
19 |
@Service("mmModelParamService") |
|
20 |
public class MmModelParamServiceImpl extends BaseServiceImpl<MmModelParamDao, MmModelParamEntity> implements MmModelParamService { |
|
21 |
|
|
22 |
@Override |
|
23 |
public void saveList(List<MmModelParamEntity> list) { |
|
24 |
QueryWrapper<MmModelParamEntity> queryWrapper = new QueryWrapper(); |
|
25 |
queryWrapper.eq("modelid", list.get(0).getModelid()); |
|
26 |
baseDao.delete(queryWrapper); |
|
27 |
list.forEach(item -> { |
|
28 |
item.setId(UUID.randomUUID().toString()); |
|
29 |
baseDao.insert(item); |
|
30 |
}); |
|
31 |
} |
|
32 |
|
|
33 |
@Override |
|
34 |
public List<MmModelParamEntity> getByModelid(String modelid) { |
|
35 |
QueryWrapper<MmModelParamEntity> queryWrapper = new QueryWrapper(); |
|
36 |
queryWrapper.eq("modelid", modelid); |
|
37 |
queryWrapper.orderByAsc("MODELPARAMPORTORDER"); |
|
38 |
queryWrapper.orderByAsc("MODELPARAMORDER"); |
|
39 |
List<MmModelParamEntity> list = baseDao.selectList(queryWrapper); |
|
40 |
if (CollectionUtils.isEmpty(list)) { |
|
41 |
return new ArrayList<>(); |
|
42 |
} |
|
43 |
return list; |
|
44 |
} |
|
45 |
} |