2026-06-24 f4bd1f3c89d906131495a0aca5aaf82966378510
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package cn.iocoder.yudao.module.iot.dal.mysql.alert;
 
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.iot.controller.admin.alert.vo.recrod.IotAlertRecordPageReqVO;
import cn.iocoder.yudao.module.iot.dal.dataobject.alert.IotAlertRecordDO;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import org.apache.ibatis.annotations.Mapper;
 
import java.util.Collection;
import java.util.List;
 
/**
 * IoT 告警记录 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface IotAlertRecordMapper extends BaseMapperX<IotAlertRecordDO> {
 
    default PageResult<IotAlertRecordDO> selectPage(IotAlertRecordPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<IotAlertRecordDO>()
                .eqIfPresent(IotAlertRecordDO::getConfigId, reqVO.getConfigId())
                .eqIfPresent(IotAlertRecordDO::getConfigLevel, reqVO.getConfigLevel())
                .eqIfPresent(IotAlertRecordDO::getProductId, reqVO.getProductId())
                .eqIfPresent(IotAlertRecordDO::getDeviceId, reqVO.getDeviceId())
                .eqIfPresent(IotAlertRecordDO::getProcessStatus, reqVO.getProcessStatus())
                .betweenIfPresent(IotAlertRecordDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(IotAlertRecordDO::getId));
    }
 
    default List<IotAlertRecordDO> selectListBySceneRuleId(Long sceneRuleId, Long deviceId, Boolean processStatus) {
        return selectList(new LambdaQueryWrapperX<IotAlertRecordDO>()
                .eq(IotAlertRecordDO::getSceneRuleId, sceneRuleId)
                .eqIfPresent(IotAlertRecordDO::getDeviceId, deviceId)
                .eqIfPresent(IotAlertRecordDO::getProcessStatus, processStatus)
                .orderByDesc(IotAlertRecordDO::getId));
    }
 
    default int updateList(Collection<Long> ids, IotAlertRecordDO updateObj) {
        return update(updateObj, new LambdaUpdateWrapper<IotAlertRecordDO>()
                .in(IotAlertRecordDO::getId, ids));
    }
 
}