提交 | 用户 | 时间
|
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.MmPredictModelDao; |
|
6 |
import com.iailab.module.model.mcs.pre.entity.MmPredictModelEntity; |
|
7 |
import com.iailab.module.model.mcs.pre.service.MmPredictModelService; |
|
8 |
import org.springframework.stereotype.Service; |
|
9 |
import org.springframework.util.CollectionUtils; |
|
10 |
|
|
11 |
import java.math.BigDecimal; |
|
12 |
import java.util.List; |
|
13 |
import java.util.Map; |
|
14 |
import java.util.UUID; |
|
15 |
|
|
16 |
/** |
|
17 |
* @author PanZhibao |
|
18 |
* @date 2021年04月27日 11:30 |
|
19 |
*/ |
|
20 |
@Service("mmPredictModelService") |
|
21 |
public class MmPredictModelServiceImpl extends BaseServiceImpl<MmPredictModelDao, MmPredictModelEntity> implements MmPredictModelService { |
|
22 |
|
|
23 |
@Override |
|
24 |
public void savePredictModel(MmPredictModelEntity predictModel) { |
|
25 |
predictModel.setId(UUID.randomUUID().toString()); |
|
26 |
baseDao.insert(predictModel); |
|
27 |
} |
|
28 |
|
|
29 |
@Override |
|
30 |
public void update(MmPredictModelEntity predictModel) { |
|
31 |
this.updateById(predictModel); |
|
32 |
} |
|
33 |
|
|
34 |
@Override |
|
35 |
public MmPredictModelEntity getInfo(String id) { |
|
36 |
return baseDao.selectById(id); |
|
37 |
} |
|
38 |
|
|
39 |
@Override |
|
40 |
public BigDecimal getSampleLength(String id) { |
|
41 |
BigDecimal result = BigDecimal.ZERO; |
|
42 |
List<MmPredictModelEntity> list = baseDao.getSampleLength(id); |
|
43 |
if (CollectionUtils.isEmpty(list)) { |
|
44 |
return result; |
|
45 |
} |
|
46 |
result = list.get(0).getPredictsamplength(); |
|
47 |
|
|
48 |
return result; |
|
49 |
} |
|
50 |
|
|
51 |
public void deleteBatch(String[] itemIds) { |
|
52 |
QueryWrapper<MmPredictModelEntity> queryWrapper = new QueryWrapper<>(); |
|
53 |
queryWrapper.in("itemid", itemIds); |
|
54 |
baseDao.delete(queryWrapper); |
|
55 |
} |
|
56 |
|
|
57 |
public MmPredictModelEntity getByItemid(String itemid) { |
|
58 |
QueryWrapper<MmPredictModelEntity> queryWrapper = new QueryWrapper<>(); |
|
59 |
queryWrapper.eq("itemid", itemid); |
|
60 |
List<MmPredictModelEntity> list = baseDao.selectList(queryWrapper); |
|
61 |
if (CollectionUtils.isEmpty(list)) { |
|
62 |
return new MmPredictModelEntity(); |
|
63 |
} |
|
64 |
return list.get(0); |
|
65 |
} |
|
66 |
|
|
67 |
@Override |
|
68 |
public List<MmPredictModelEntity> getNoSettingmapPredictModel(Map<String, Object> params) { |
|
69 |
return baseDao.getNoSettingmapPredictModel(params); |
|
70 |
} |
|
71 |
|
|
72 |
@Override |
|
73 |
public List<MmPredictModelEntity> getActiveModelByItemId(String itemId) { |
|
74 |
return baseDao.getActiveModelByItemId(itemId); |
|
75 |
} |
|
76 |
} |