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