| | |
| | | package com.iailab.module.model.mcs.pre.service.impl; |
| | | |
| | | 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.security.core.util.SecurityFrameworkUtils; |
| | | 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; |
| | | |
| | |
| | | implements MmPredictAlarmConfigService { |
| | | |
| | | @Override |
| | | public PageResult<MmPredictAlarmConfigEntity> page(MmPredictAlarmConfigPageReqVO reqVO) { |
| | | return baseDao.selectPage(reqVO); |
| | | public PageResult<MmPredictAlarmConfigRespVO> page(MmPredictAlarmConfigPageReqVO reqVO) { |
| | | IPage<MmPredictAlarmConfigRespVO> page = baseDao.selectPage(reqVO); |
| | | return new PageResult<>(page.getRecords(), page.getTotal()); |
| | | } |
| | | |
| | | @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); |
| | | } |
| | | |