| | |
| | | package com.iailab.module.model.mcs.pre.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.iailab.framework.common.service.impl.BaseServiceImpl; |
| | | import com.iailab.module.model.mcs.pre.dao.MmPredictMergeItemDao; |
| | | import com.iailab.module.model.mcs.pre.dao.MmPredictModelDao; |
| | | import com.iailab.module.model.mcs.pre.entity.MmPredictModelEntity; |
| | | import com.iailab.module.model.mcs.pre.service.MmPredictModelService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | |
| | | * @author PanZhibao |
| | | * @date 2021年04月27日 11:30 |
| | | */ |
| | | @Service("mmPredictModelService") |
| | | public class MmPredictModelServiceImpl extends BaseServiceImpl<MmPredictModelDao, MmPredictModelEntity> implements MmPredictModelService { |
| | | @Service |
| | | public class MmPredictModelServiceImpl extends ServiceImpl<MmPredictModelDao, MmPredictModelEntity> implements MmPredictModelService { |
| | | |
| | | @Autowired |
| | | private MmPredictModelDao mmPredictModelDao; |
| | | @Override |
| | | public void savePredictModel(MmPredictModelEntity predictModel) { |
| | | predictModel.setId(UUID.randomUUID().toString()); |
| | | baseDao.insert(predictModel); |
| | | mmPredictModelDao.insert(predictModel); |
| | | } |
| | | |
| | | @Override |
| | |
| | | |
| | | @Override |
| | | public MmPredictModelEntity getInfo(String id) { |
| | | return baseDao.selectById(id); |
| | | return mmPredictModelDao.selectById(id); |
| | | } |
| | | |
| | | @Override |
| | | public BigDecimal getSampleLength(String id) { |
| | | BigDecimal result = BigDecimal.ZERO; |
| | | List<MmPredictModelEntity> list = baseDao.getSampleLength(id); |
| | | List<MmPredictModelEntity> list = mmPredictModelDao.getSampleLength(id); |
| | | if (CollectionUtils.isEmpty(list)) { |
| | | return result; |
| | | } |
| | |
| | | public void deleteBatch(String[] itemIds) { |
| | | QueryWrapper<MmPredictModelEntity> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.in("itemid", itemIds); |
| | | baseDao.delete(queryWrapper); |
| | | mmPredictModelDao.delete(queryWrapper); |
| | | } |
| | | |
| | | public MmPredictModelEntity getByItemid(String itemid) { |
| | | QueryWrapper<MmPredictModelEntity> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("itemid", itemid); |
| | | List<MmPredictModelEntity> list = baseDao.selectList(queryWrapper); |
| | | List<MmPredictModelEntity> list = mmPredictModelDao.selectList(queryWrapper); |
| | | if (CollectionUtils.isEmpty(list)) { |
| | | return new MmPredictModelEntity(); |
| | | } |
| | |
| | | |
| | | @Override |
| | | public List<MmPredictModelEntity> getNoSettingmapPredictModel(Map<String, Object> params) { |
| | | return baseDao.getNoSettingmapPredictModel(params); |
| | | return mmPredictModelDao.getNoSettingmapPredictModel(params); |
| | | } |
| | | |
| | | @Override |
| | | public List<MmPredictModelEntity> getActiveModelByItemId(String itemId) { |
| | | return baseDao.getActiveModelByItemId(itemId); |
| | | return mmPredictModelDao.getActiveModelByItemId(itemId); |
| | | } |
| | | } |