From f1fe397df175a7ee809ea28530419116af84af28 Mon Sep 17 00:00:00 2001 From: dengzedong <dengzedong@email> Date: 星期二, 31 十二月 2024 17:32:45 +0800 Subject: [PATCH] t_mm_item_result 索引优化 --- iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmPredictAlarmConfigServiceImpl.java | 61 ++++++++++++++++++++++++++++++ 1 files changed, 60 insertions(+), 1 deletions(-) diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmPredictAlarmConfigServiceImpl.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmPredictAlarmConfigServiceImpl.java index 12b29de..58e5c42 100644 --- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmPredictAlarmConfigServiceImpl.java +++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmPredictAlarmConfigServiceImpl.java @@ -1,11 +1,70 @@ package com.iailab.module.model.mcs.pre.service.impl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.iailab.framework.common.pojo.PageResult; +import com.iailab.framework.common.service.impl.BaseServiceImpl; +import com.iailab.framework.common.util.object.BeanUtils; +import com.iailab.framework.common.util.object.ConvertUtils; +import com.iailab.framework.security.core.util.SecurityFrameworkUtils; +import com.iailab.module.model.api.mcs.dto.AlarmConfigRespDTO; +import com.iailab.module.model.mcs.pre.dao.MmPredictAlarmConfigDao; +import com.iailab.module.model.mcs.pre.entity.MmPredictAlarmConfigEntity; import com.iailab.module.model.mcs.pre.service.MmPredictAlarmConfigService; +import com.iailab.module.model.mcs.pre.vo.MmPredictAlarmConfigPageReqVO; +import com.iailab.module.model.mcs.pre.vo.MmPredictAlarmConfigRespVO; +import com.iailab.module.model.mcs.pre.vo.MmPredictAlarmConfigSaveReqVO; +import org.springframework.stereotype.Service; + +import java.util.*; /** * @author PanZhibao * @Description * @createTime 2024年11月19日 */ -public class MmPredictAlarmConfigServiceImpl implements MmPredictAlarmConfigService { +@Service +public class MmPredictAlarmConfigServiceImpl extends BaseServiceImpl<MmPredictAlarmConfigDao, MmPredictAlarmConfigEntity> + implements MmPredictAlarmConfigService { + + @Override + public PageResult<MmPredictAlarmConfigRespVO> page(MmPredictAlarmConfigPageReqVO reqVO) { + IPage<MmPredictAlarmConfigRespVO> page = baseDao.selectPage(reqVO); + return new PageResult<>(page.getRecords(), page.getTotal()); + } + + @Override + public MmPredictAlarmConfigEntity getInfo(String id) { + return baseDao.selectById(id); + } + + @Override + public void create(MmPredictAlarmConfigSaveReqVO reqVO) { + MmPredictAlarmConfigEntity entity = BeanUtils.toBean(reqVO, MmPredictAlarmConfigEntity.class); + entity.setId(UUID.randomUUID().toString()); + entity.setCreator(SecurityFrameworkUtils.getLoginUserNickname()); + entity.setCreateTime(new Date()); + baseDao.insert(entity); + } + + @Override + public void update(MmPredictAlarmConfigSaveReqVO reqVO) { + MmPredictAlarmConfigEntity entity = BeanUtils.toBean(reqVO, MmPredictAlarmConfigEntity.class); + entity.setUpdater(SecurityFrameworkUtils.getLoginUserNickname()); + entity.setUpdateTime(new Date()); + baseDao.updateById(entity); + } + + @Override + public void delete(String id) { + baseDao.deleteById(id); + } + + @Override + public List<AlarmConfigRespDTO> list(Map<String, Object> params) { + QueryWrapper<MmPredictAlarmConfigEntity> wrapper = new QueryWrapper<>(); + wrapper.eq("is_enable", 1); + List<MmPredictAlarmConfigEntity> list = baseDao.selectList(wrapper); + return ConvertUtils.sourceToTarget(list, AlarmConfigRespDTO.class); + } } \ No newline at end of file -- Gitblit v1.9.3