提交 | 用户 | 时间
|
97d38f
|
1 |
package com.iailab.module.model.mcs.pre.service.impl; |
潘 |
2 |
|
c5fe30
|
3 |
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
b06c21
|
4 |
import com.iailab.framework.common.pojo.PageResult; |
潘 |
5 |
import com.iailab.framework.common.service.impl.BaseServiceImpl; |
|
6 |
import com.iailab.framework.common.util.object.BeanUtils; |
|
7 |
import com.iailab.module.model.mcs.pre.dao.MmPredictAlarmMessageDao; |
|
8 |
import com.iailab.module.model.mcs.pre.entity.MmPredictAlarmMessageEntity; |
97d38f
|
9 |
import com.iailab.module.model.mcs.pre.service.MmPredictAlarmMessageService; |
b06c21
|
10 |
import com.iailab.module.model.mcs.pre.vo.MmPredictAlarmMessagePageReqVO; |
潘 |
11 |
import com.iailab.module.model.mcs.pre.vo.MmPredictAlarmMessageSaveReqVO; |
|
12 |
import org.springframework.stereotype.Service; |
c5fe30
|
13 |
import org.springframework.util.CollectionUtils; |
b06c21
|
14 |
|
潘 |
15 |
import java.util.Date; |
c5fe30
|
16 |
import java.util.List; |
b06c21
|
17 |
import java.util.UUID; |
97d38f
|
18 |
|
潘 |
19 |
/** |
|
20 |
* @author PanZhibao |
|
21 |
* @Description |
|
22 |
* @createTime 2024年11月19日 |
|
23 |
*/ |
b06c21
|
24 |
@Service |
潘 |
25 |
public class MmPredictAlarmMessageServiceImpl extends BaseServiceImpl<MmPredictAlarmMessageDao, MmPredictAlarmMessageEntity> |
|
26 |
implements MmPredictAlarmMessageService { |
|
27 |
|
|
28 |
|
|
29 |
@Override |
|
30 |
public PageResult<MmPredictAlarmMessageEntity> page(MmPredictAlarmMessagePageReqVO reqVO) { |
|
31 |
return baseDao.selectPage(reqVO); |
|
32 |
} |
|
33 |
|
|
34 |
@Override |
|
35 |
public MmPredictAlarmMessageEntity getInfo(String id) { |
|
36 |
return baseDao.selectById(id); |
|
37 |
} |
|
38 |
|
|
39 |
@Override |
c5fe30
|
40 |
public MmPredictAlarmMessageEntity getLast(String alarmObj) { |
潘 |
41 |
QueryWrapper<MmPredictAlarmMessageEntity> queryWrapper = new QueryWrapper<>(); |
|
42 |
queryWrapper.eq("alarm_obj", alarmObj) |
|
43 |
.orderByDesc("alarm_time") |
|
44 |
.last("limit 1"); |
|
45 |
return baseDao.selectOne(queryWrapper); |
|
46 |
} |
|
47 |
|
|
48 |
@Override |
b06c21
|
49 |
public void create(MmPredictAlarmMessageSaveReqVO reqVO) { |
潘 |
50 |
MmPredictAlarmMessageEntity entity = BeanUtils.toBean(reqVO, MmPredictAlarmMessageEntity.class); |
|
51 |
entity.setId(UUID.randomUUID().toString()); |
|
52 |
entity.setCreateTime(new Date()); |
|
53 |
baseDao.insert(entity); |
|
54 |
} |
|
55 |
|
|
56 |
@Override |
|
57 |
public void update(MmPredictAlarmMessageSaveReqVO reqVO) { |
|
58 |
MmPredictAlarmMessageEntity entity = BeanUtils.toBean(reqVO, MmPredictAlarmMessageEntity.class); |
|
59 |
baseDao.updateById(entity); |
|
60 |
} |
|
61 |
|
|
62 |
@Override |
|
63 |
public void delete(String id) { |
|
64 |
baseDao.deleteById(id); |
|
65 |
} |
97d38f
|
66 |
} |