提交 | 用户 | 时间
|
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; |
1c9291
|
17 |
import java.util.Map; |
b06c21
|
18 |
import java.util.UUID; |
97d38f
|
19 |
|
潘 |
20 |
/** |
|
21 |
* @author PanZhibao |
|
22 |
* @Description |
|
23 |
* @createTime 2024年11月19日 |
|
24 |
*/ |
b06c21
|
25 |
@Service |
潘 |
26 |
public class MmPredictAlarmMessageServiceImpl extends BaseServiceImpl<MmPredictAlarmMessageDao, MmPredictAlarmMessageEntity> |
|
27 |
implements MmPredictAlarmMessageService { |
|
28 |
|
|
29 |
|
|
30 |
@Override |
|
31 |
public PageResult<MmPredictAlarmMessageEntity> page(MmPredictAlarmMessagePageReqVO reqVO) { |
|
32 |
return baseDao.selectPage(reqVO); |
|
33 |
} |
|
34 |
|
|
35 |
@Override |
|
36 |
public MmPredictAlarmMessageEntity getInfo(String id) { |
|
37 |
return baseDao.selectById(id); |
|
38 |
} |
|
39 |
|
|
40 |
@Override |
c5fe30
|
41 |
public MmPredictAlarmMessageEntity getLast(String alarmObj) { |
潘 |
42 |
QueryWrapper<MmPredictAlarmMessageEntity> queryWrapper = new QueryWrapper<>(); |
|
43 |
queryWrapper.eq("alarm_obj", alarmObj) |
|
44 |
.orderByDesc("alarm_time") |
|
45 |
.last("limit 1"); |
|
46 |
return baseDao.selectOne(queryWrapper); |
|
47 |
} |
|
48 |
|
|
49 |
@Override |
9904da
|
50 |
public List<MmPredictAlarmMessageEntity> getList(String alarmObj, Date alarmTime) { |
潘 |
51 |
QueryWrapper<MmPredictAlarmMessageEntity> queryWrapper = new QueryWrapper<>(); |
|
52 |
queryWrapper.eq("alarm_obj", alarmObj) |
|
53 |
.eq("alarm_time", alarmTime); |
|
54 |
return baseDao.selectList(queryWrapper); |
|
55 |
} |
|
56 |
|
|
57 |
@Override |
b06c21
|
58 |
public void create(MmPredictAlarmMessageSaveReqVO reqVO) { |
潘 |
59 |
MmPredictAlarmMessageEntity entity = BeanUtils.toBean(reqVO, MmPredictAlarmMessageEntity.class); |
|
60 |
entity.setId(UUID.randomUUID().toString()); |
|
61 |
entity.setCreateTime(new Date()); |
|
62 |
baseDao.insert(entity); |
|
63 |
} |
|
64 |
|
|
65 |
@Override |
|
66 |
public void update(MmPredictAlarmMessageSaveReqVO reqVO) { |
|
67 |
MmPredictAlarmMessageEntity entity = BeanUtils.toBean(reqVO, MmPredictAlarmMessageEntity.class); |
|
68 |
baseDao.updateById(entity); |
|
69 |
} |
|
70 |
|
|
71 |
@Override |
|
72 |
public void delete(String id) { |
|
73 |
baseDao.deleteById(id); |
|
74 |
} |
1c9291
|
75 |
|
L |
76 |
@Override |
|
77 |
public void cleanAlarmMessage(Map<String, Date> tMap) { |
|
78 |
baseDao.cleanAlarmMessage(tMap); |
|
79 |
} |
97d38f
|
80 |
} |